MDL-28183 fix for problem during integration
authorJean-Michel Vedrine <vedrine@vedrine.org>
Tue, 8 Jan 2013 09:26:55 +0000 (10:26 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Tue, 8 Jan 2013 11:03:48 +0000 (12:03 +0100)
Conflicts:
question/type/multianswer/question.php

question/type/multianswer/question.php

index 0759616..43c2ca7 100644 (file)
@@ -238,8 +238,8 @@ class qtype_multianswer_question extends question_graded_automatically_with_coun
             list($subfraction, $newstate) = $subq->grade_response($subresp);
             if ($newstate != question_state::$gradedright) {
                 foreach ($subresp as $ind => $resp) {
-                    if (($subq->layout == qtype_multichoice_base::LAYOUT_VERTICAL)
-                            || ($subq->layout == qtype_multichoice_base::LAYOUT_HORIZONTAL)) {
+                    if ($subq->qtype == 'multichoice' && ($subq->layout == qtype_multichoice_base::LAYOUT_VERTICAL
+                            || $subq->layout == qtype_multichoice_base::LAYOUT_HORIZONTAL)) {
                         $response[$substep->add_prefix($ind)] = '-1';
                     } else {
                         $response[$substep->add_prefix($ind)] = '';