parserWordCompletion.pl
Provides free response, fill in the blank questions. As a student types in the answer blank, a drop-down list of allowable answers appears that matches what has already been typed is shown. A warning message is shown if an answer is submitted that is not among the allowed choices. 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.
To create a WordCompletion object, use
$w = WordCompletion(['choice 1', 'choice 2', ...], correct);
where 'choice 1', 'choice 2', ...
are the allowed answers that will be shown in the drop-down list and correct
is the correct answer from the list.
To insert the WordCompletion answer rule into a problem use
BEGIN_PGML
[_]{$w}{40}
END_PGML
or
BEGIN_TEXT
\{ $w->ans_rule(40) \}
END_TEXT
ANS($wb->cmp);
You can explicitly list all of the choices using
$w->choices_text
for a comma separated list of the choices (inline, text style) and
$w->choices_list
for an unordered list (display style).