]> git.mjollnir.org Git - moodle.git/commitdiff
matching qtype: MDL-14420 Could not use '0' as a question stem. Oops, more tests...
authortjhunt <tjhunt>
Thu, 11 Dec 2008 05:01:37 +0000 (05:01 +0000)
committertjhunt <tjhunt>
Thu, 11 Dec 2008 05:01:37 +0000 (05:01 +0000)
question/type/match/questiontype.php

index 408f03c9a50e02cbebecabfc2903020050fbccbe..012b9c4998b181e394402951c59ab23b61ec12f1 100644 (file)
@@ -279,7 +279,7 @@ class question_match_qtype extends default_questiontype {
 
         // Print the input controls
         foreach ($subquestions as $key => $subquestion) {
-            if ($subquestion->questiontext != '') {
+            if ($subquestion->questiontext !== '') {
                 // Subquestion text:
                 $a = new stdClass;
                 $a->text = $this->format_text($subquestion->questiontext,
@@ -341,7 +341,7 @@ class question_match_qtype extends default_questiontype {
         $sumgrade = 0;
         $totalgrade = 0;
         foreach ($subquestions as $key => $sub) {
-            if ($sub->questiontext) {
+            if ($sub->questiontext !== '') {
                 $totalgrade += 1;
                 $response = $responses[$key];
                 if ($response && !array_key_exists($response, $sub->options->answers)) {