mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-76897 quiz: fix incorrect StdClass
This commit is contained in:
parent
20ccfc162d
commit
1b72db7082
@ -1800,7 +1800,7 @@ function quiz_add_quiz_question($questionid, $quiz, $page = 0, $maxmark = null)
|
||||
|
||||
if (!$qreferenceitem) {
|
||||
// Create a new reference record for questions created already.
|
||||
$questionreferences = new \StdClass();
|
||||
$questionreferences = new stdClass();
|
||||
$questionreferences->usingcontextid = context_module::instance($quiz->cmid)->id;
|
||||
$questionreferences->component = 'mod_quiz';
|
||||
$questionreferences->questionarea = 'slot';
|
||||
@ -1810,13 +1810,13 @@ function quiz_add_quiz_question($questionid, $quiz, $page = 0, $maxmark = null)
|
||||
$DB->insert_record('question_references', $questionreferences);
|
||||
|
||||
} else if ($qreferenceitem->itemid === 0 || $qreferenceitem->itemid === null) {
|
||||
$questionreferences = new \StdClass();
|
||||
$questionreferences = new stdClass();
|
||||
$questionreferences->id = $qreferenceitem->id;
|
||||
$questionreferences->itemid = $slotid;
|
||||
$DB->update_record('question_references', $questionreferences);
|
||||
} else {
|
||||
// If the reference record exits for another quiz.
|
||||
$questionreferences = new \StdClass();
|
||||
$questionreferences = new stdClass();
|
||||
$questionreferences->usingcontextid = context_module::instance($quiz->cmid)->id;
|
||||
$questionreferences->component = 'mod_quiz';
|
||||
$questionreferences->questionarea = 'slot';
|
||||
|
Loading…
x
Reference in New Issue
Block a user