WeBWorK Main Forum

How to let PGML accept multiple alternative string answers for a single question

by Yuncong Chen -
Number of replies: 1
Hi,

I am wondering if it is possible for PGML to accept multiple alternative answers for a single question. The answers may not compute to the same value. For example, when two strings represent cycle notations of permutation, "(123)(4)" and "(123)" are both acceptable answers.

Thanks,
Yuncong
In reply to Yuncong Chen

Re: How to let PGML accept multiple alternative string answers for a single question

by Davide Cervone -
You can use the OneOf MathObject available from the parserOneOf.pl file (see its documentation for details). For example:
    loadMacros(
"PGML.pl",
"parerOneOf.pl",
);

BEGIN_PGML