mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
miniscule change: subquestion code only has to be unique within question
This commit is contained in:
parent
549880a59d
commit
18bd0d680c
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue