]> git.mjollnir.org Git - moodle.git/commitdiff
miniscule change: subquestion code only has to be unique within question
authorgustav_delius <gustav_delius>
Sun, 19 Mar 2006 10:43:12 +0000 (10:43 +0000)
committergustav_delius <gustav_delius>
Sun, 19 Mar 2006 10:43:12 +0000 (10:43 +0000)
question/questiontypes/match/questiontype.php

index 91fdd12c03673125c82c872109937adc9598449a..baca52726721f847ccbfa124d08978c96430f176 100644 (file)
@@ -55,7 +55,7 @@ class question_match_qtype extends quiz_default_questiontype {
                     unset($subquestion);
                     // Determine a unique random code
                     $subquestion->code = rand(1,999999999);
-                    while (record_exists('question_match_sub', 'code', $subquestion->code)) {
+                    while (record_exists('question_match_sub', 'code', $subquestion->code, 'question', $question->id)) {
                         $subquestion->code = rand();
                     }
                     $subquestion->question = $question->id;