diff --git a/lib/Value/AnswerChecker.pm b/lib/Value/AnswerChecker.pm index d8c3941dc5..85ed004fb8 100644 --- a/lib/Value/AnswerChecker.pm +++ b/lib/Value/AnswerChecker.pm @@ -182,6 +182,7 @@ sub cmp_parse { $self->cmp_diagnostics($ans); } } else { + $ans->{student_ans} = protectHTML($ans->{student_ans}); $self->cmp_collect($ans); $self->cmp_error($ans); } @@ -337,8 +338,6 @@ sub cmp_error { . protectHTML(substr($string, $s, $e - $s)) . '' . protectHTML(substr($string, $e)); - } else { - $ans->{student_ans} = protectHTML($ans->{student_ans}); } $self->cmp_Error($ans, $message); }