From 4c51e56d982131deca81822ce84de9dfbffe006e Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 28 Apr 2011 23:31:07 +0100 Subject: [PATCH] MDL-26714 qtype_multianswer regression from the previous commit for numerical subquestions. --- question/type/multianswer/questiontype.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/question/type/multianswer/questiontype.php b/question/type/multianswer/questiontype.php index ff1b3402f03..d6734011f0c 100644 --- a/question/type/multianswer/questiontype.php +++ b/question/type/multianswer/questiontype.php @@ -617,9 +617,17 @@ class embedded_cloze_qtype extends default_questiontype { $teststateforquestion->responses[''] = ''; } - if (!$QTYPES[$wrapped->qtype]->compare_responses($wrapped, - $stateforquestion, $teststateforquestion)) { - return false; + if ($wrapped->qtype == 'numerical') { + // Use shortanswer + if (!$QTYPES['shortanswer']->compare_responses($wrapped, + $stateforquestion, $teststateforquestion)) { + return false; + } + } else { + if (!$QTYPES[$wrapped->qtype]->compare_responses($wrapped, + $stateforquestion, $teststateforquestion)) { + return false; + } } }