From 18bd0d680c8addf297067a52c7eb855c99b36b35 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Sun, 19 Mar 2006 10:43:12 +0000 Subject: [PATCH] miniscule change: subquestion code only has to be unique within question --- question/questiontypes/match/questiontype.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question/questiontypes/match/questiontype.php b/question/questiontypes/match/questiontype.php index 91fdd12c03..baca527267 100644 --- a/question/questiontypes/match/questiontype.php +++ b/question/questiontypes/match/questiontype.php @@ -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; -- 2.39.5