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 f0640eb7d2
commit 69866e0377

View file

@ -78,7 +78,8 @@ class lesson_page_type_shortanswer extends lesson_page {
$answers = $this->get_answers(); $answers = $this->get_answers();
foreach ($answers as $answer) { foreach ($answers as $answer) {
$i++; $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; $ismatch = false;
$markit = false; $markit = false;
$useregexp = ($this->qoption); $useregexp = ($this->qoption);