Forum archive 2000-2006

Andy Miller - How does num_cmp_list work?

Andy Miller - How does num_cmp_list work?

by Arnold Pizer -
Number of replies: 0
inactiveTopicHow does num_cmp_list work? topic started 9/12/2006; 11:03:50 PM
last post 9/13/2006; 8:14:32 AM
userAndy Miller - How does num_cmp_list work?  blueArrow
9/12/2006; 11:03:50 PM (reads: 190, responses: 1)
I was reading the PGanswermacros.pl documentation to learn more about the array of answer evaluators, and it wasn't clear to me how the num_cmp_list evaluators work. It appears that you specify the correct answer list as an array. In that case, though, is the correct answer any number in the list, or is the correct answer an identical list? If the latter, does the student need to enter the list in the same order as given in the correct answer array, or is any order accepted? Finally, does the student enter "(a, b, c)" (Perl array syntax) or just a comma-separated list "a, b, c"?

Thanks! I'd check this out in the problem library, but I didn't know how to find problems that use a specific evaluator.

--Andy

<| Post or View Comments |>


userGavin LaRose - Re: How does num_cmp_list work?  blueArrow
9/13/2006; 8:14:32 AM (reads: 276, responses: 0)
Hi Andy,

I believe the num_cmp_list evaluators (et al.) produce a list of evaluators for successive answer blanks, not a list of evaluators for a single answer blank. That is,

  BEGIN_TEXT
Enter 1: \{ans_rule(5)\} $BR
Enter 2: \{ans_rule(5)\} $BR
END_TEXT
ANS( num_cmp_list( (1,2) ) );

Is equivalent to the same text with the answer evaluators

  ANS( num_cmp(1) );
ANS( num_cmp(2) );

or, for that matter,

  ANS( num_cmp( [1,2] ) );

I think marking answers that are actually lists is most elegantly done with the Parser.

Gavin

<| Post or View Comments |>