Consider the following MWE:
DOCUMENT();
loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl');
BEGIN_PGML
[_]{List(1,2)->cmp(list_checker => sub {return(0,"Your answer is incorrect");})}
END_PGML
ENDDOCUMENT();
This should display the feedback message "Your answer is incorrect" to the student when they submit, but it doesn't.
The culprit is:
|
if ($score == 0) { |
|
my $i = 0; |
|
while ($i <= $#errors) { |
|
if ($errors[ $i++ ] =~ m/^Your .* is incorrect$/) { splice(@errors, --$i, 1) } |
|
} |
The problem is that this can match a custom error message set by a problem author, which is then silently deleted.
Consider the following MWE:
This should display the feedback message "Your answer is incorrect" to the student when they submit, but it doesn't.
The culprit is:
pg/lib/Value/AnswerChecker.pm
Lines 1689 to 1693 in 1603ef5
The problem is that this can match a custom error message set by a problem author, which is then silently deleted.