Skip to content

unorderedAnswer.pl conflict with other answer checkers. #670

Open
@jirilebl

Description

@jirilebl

The following is a minimal example showing the problem. Basically if there are two answer blanks that are supposed to be unordered and then one that follows that has a normal answer checker. The problem never accepts the answers in any order and in fact. The "show correct answers" always shows the answers in the opposite order.

Removing the third answer checker fixes the problem, and so does moving to named unordered answer checkers.

I've looked at the code a little bit in unorderedAnswer.pl, but I can't quite see what's wrong.

Here's the minimal example. The answers should be "x,x^2,x+x^2" or "x^2,x,x+x^2"

DOCUMENT();      

loadMacros(
  "PGstandard.pl",
  "MathObjects.pl",
  "unorderedAnswer.pl",
  "PGcourse.pl"
);

TEXT(beginproblem());

Context("Numeric");

$sol1 = Formula("x");
$sol2 = Formula("x^2");
$soli = Formula("x+x^2");

Context()->texStrings;
BEGIN_TEXT
\( y_1 = \) 
\{ ans_rule(20); \}
$PAR
\( y_2 = \) 
\{ ans_rule(20); \}
$PAR
\( y = \) 
\{ ans_rule(20); \}
END_TEXT
Context()->normalStrings;

UNORDERED_ANS( $sol1->cmp(), $sol2->cmp() );
ANS( $soli->cmp() );

ENDDOCUMENT();    

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions