How To:
Deal With Letter Case

In questions that can have non-numeric answers we should not restrict the user-entry to lower or upper case. This code will allow either, or any mixture of cases.

In this case the user evaluates a limit. Possible answers include "DNE","infinity","-infinity". We want to allow any combination of upper and lower case in such answers.First you will need to use Maple grading. Second define your answer (call it $Ans in this case) in all lower case (you could also do this in all upper case if you prefer).

Use this grading code:

R:=StringTools[RegSubs]("[()*]"="",StringTools[LowerCase]("$RESPONSE"));

if evalb(R="$Ans") then M:=1
else
{M:=0 or alternate grading code}
end if;
M;

The RegSubs command strips out extraneous characters that Maple T.A. inserts in the answer string. Whille the LowerCase command is obvious, it needs to be done this way. Having it follow the RegSubs command as a separate line does not work, I have no idea why.


How-To Index

Main Index

Last updated: 09/17/2019 SS/MUO