Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
add new macro parserWordCompletion.pl #258
Provides free response, fill in the blank questions with interactive help. As a student types their answer into the answer blank, jQuery's
Provides free response, fill in the blank questions with interactive help. As a student types their answer into the answer blank, jQuery's autocomplete feature generates a drop-down list of allowable answers that match what has already been typed. When the student presses the "Check Answers" or "Submit Answers" button, jQuery generates a warning message if the student answer is not one of the allowable answers. Choices in the drop-down list and the correct answer are specified by the problem author. WordCompletion objects are compatible with Value objects, and in particular, can be used with MultiAnswer objects.
$ans1 = WordCompletion( ["BASIC","Haskell","Perl","Python"], "Python" );
$fac1 = WordCompletion( ["Perl","Python"], "Perl" );
$multians = MultiAnswer($fac1, $fac2)->with(
ANS( Compute("pi")->cmp );
This works well on ordinary answers. It doesn't work well for me on multians. I keep getting error warnings about extra answer blanks. I think this is all bound up with determining the right names for answer blanks and answer evaluators -- which is a bit tricky in general and even more so for multians. I'll look at it again but you might want to some experiments yourself and make sure that it works for you..
The WordCompletion macro works with MultiAnswer on the Hope server running ww_version 2.8 & pg_version 2.8.1. When I push it to the MAA TestCourses server running ww_version develop & pg_version 2.11, however, I get errors just like you said. So, something has changed with MultiAnswer between version ~2.8 and version ~2.11, and I'll have to update the WordCompletion macro accordingly.