mirror of
https://github.com/moodle/moodle.git
synced 2025-03-13 20:26:32 +01:00
MDL-67540 quiz: Start transaction before selecting existing slots.
Co-authored-by: Conn <conn@cmrwarwicker.com>
This commit is contained in:
parent
9df4a4de18
commit
8c287a6696
@ -2152,14 +2152,14 @@ function quiz_add_quiz_question($questionid, $quiz, $page = 0, $maxmark = null)
|
||||
);
|
||||
}
|
||||
|
||||
$trans = $DB->start_delegated_transaction();
|
||||
$slots = $DB->get_records('quiz_slots', array('quizid' => $quiz->id),
|
||||
'slot', 'questionid, slot, page, id');
|
||||
if (array_key_exists($questionid, $slots)) {
|
||||
$trans->allow_commit();
|
||||
return false;
|
||||
}
|
||||
|
||||
$trans = $DB->start_delegated_transaction();
|
||||
|
||||
$maxpage = 1;
|
||||
$numonlastpage = 0;
|
||||
foreach ($slots as $slot) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user