WeBWorK Main Forum

Setting the answer as one of a few answers

Re: Setting the answer as one of a few answers

by Alex Jordan -
Number of replies: 0
Hi Utku,

If there are only a few options, one approach is to load parserOneOf.pl. Then you can define the answer to be OneOf(0,2,4,6,8);

http://webwork.maa.org/pod/pg_TRUNK/macros/parserOneOf.pl.html

You can write a custom answer checker that literally checks if the submitted answer is even, greater than or equal to 0, and less than or equal to 8:

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

With that approach, you have to declare one number to be "the correct answer" as far as what gets displayed to a student as the correct answer after the answer date.

Alex