I want to be able to have my students work through questions in a Mathematica notebook and then run a piece of code that compares their solutions to what I want.
I thought along these lines:
NotebookLocate["Q18a"]; SelectionEvaluate[EvaluationNotebook[]];
If[% == 47/12 - 3/2(x + 25/6)^2,"CORRECT", "WRONG"]
Q18a is a Cell Tag for the cell the answer is in. The cell gets evaluated and then the last evaluation (the cell) is compared to the answer. But I keep getting responses like this as the output:
If[Null==47/12 - 3/2(x + 25/6)^2,CORRECT,WRONG]
Anyone able to fix or suggest a better way?
Thanks in advance.