I would advocate using (named) constants in the context instead of variables. The fewer variables there are in the context, the fewer variables there are to check during answer evaluation. As a result of using fewer variables, the answer checker should be more robust and make fewer computations during answer checking. I would recommend reading

http://webwork.maa.org/wiki/ConstantsInProblems

and using

Context()->flags->set( formatStudentAnswer=>'parsed' );

Also, if you want students to use names for constants instead of substituting values for those constants, you can set unrealistic values for constants. For instance, instead of setting a gravity constant to be g = 9.8, you could set g = 2.3618 (some randomly chosen number that students are unlikely to use in their answer).

Best regards,

Paul Pearson