MDL-46852 mod_lesson: More accurate comparison of shortanswer answers

This commit is contained in:
Frederic Massart 2014-09-01 14:23:50 +08:00
parent a2bf889706
commit 5fbebc3c18

View File

@ -77,7 +77,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$answers = $this->get_answers();
foreach ($answers as $answer) {
$i++;
$expectedanswer = $answer->answer; // for easier handling of $answer->answer
// Applying PARAM_TEXT as it is applied to the answer submitted by the user.
$expectedanswer = clean_param($answer->answer, PARAM_TEXT);
$ismatch = false;
$markit = false;
$useregexp = ($this->qoption);