WeBWorK Main Forum

parserAutoStrings.pl

parserAutoStrings.pl

by Wojciech Komornicki -
Number of replies: 1
From the documentation, I understand that the macros file parserAutoStings.pl allows for the entry of any string but I am having trouble implementing it.

I would like the student to put in a free form strings in a question that uses MultiAnswer and then check whether particular relations exist between the entered answers. In what I have tried, I keep getting the message

Variable 'xxxxx' is not defined in this context

where xxxxx is what the user entered.

Any suggestions or pointers to documentation I should look at?
In reply to Wojciech Komornicki

Re: parserAutoStrings.pl

by Davide Cervone -
I'm afraid you have misunderstood the purpose of the parserAutoString.pl macros. These allow PROFESSORS to create stings without having to add them to the context; STUDENTS are still restricted to using the ones that are in the context already.

I did put together a context and MathObject class that allows a student to enter an arbitrary string that you can process any way you want, but I never added it to the macros directory, as it didn't seem to me to be needed when there is str_cmp. Your need to use it with MultiAnswer suggests that it is a useful context after all, so I've added it to the macros directory. I also attache a copy here.

See the comments in the file for details of how to use it. Also, check out the original forum discussion where it was developed (the versions given there are not quite the same as this one, so use this one instead).

http://wwrk.maa.org/moodle/mod/forum/discuss.php?d=205#776

Davide