mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
MDL-36020 overview/report: fix quiz regrade session lock
This commit is contained in:
parent
2d5303cbe7
commit
62af3fe42b
@ -291,6 +291,14 @@ class quiz_overview_report extends quiz_attempts_report {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlock the session and allow the regrading process to run in the background.
|
||||
*/
|
||||
protected function unlock_session() {
|
||||
session_get_instance()->write_close();
|
||||
ignore_user_abort(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Regrade a particular quiz attempt. Either for real ($dryrun = false), or
|
||||
* as a pretend regrade to see which fractions would change. The outcome is
|
||||
@ -306,7 +314,8 @@ class quiz_overview_report extends quiz_attempts_report {
|
||||
*/
|
||||
protected function regrade_attempt($attempt, $dryrun = false, $slots = null) {
|
||||
global $DB;
|
||||
set_time_limit(30);
|
||||
// Need more time for a quiz with many questions.
|
||||
set_time_limit(300);
|
||||
|
||||
$transaction = $DB->start_delegated_transaction();
|
||||
|
||||
@ -359,6 +368,7 @@ class quiz_overview_report extends quiz_attempts_report {
|
||||
protected function regrade_attempts($quiz, $dryrun = false,
|
||||
$groupstudents = array(), $attemptids = array()) {
|
||||
global $DB;
|
||||
$this->unlock_session();
|
||||
|
||||
$where = "quiz = ? AND preview = 0";
|
||||
$params = array($quiz->id);
|
||||
@ -400,6 +410,7 @@ class quiz_overview_report extends quiz_attempts_report {
|
||||
*/
|
||||
protected function regrade_attempts_needing_it($quiz, $groupstudents) {
|
||||
global $DB;
|
||||
$this->unlock_session();
|
||||
|
||||
$where = "quiza.quiz = ? AND quiza.preview = 0 AND qqr.regraded = 0";
|
||||
$params = array($quiz->id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user