MDL-68944 mod_workshop: Workshop skips scheduled allocation

This commit is contained in:
Juan Segarra Montesinos
2021-11-25 09:49:27 +01:00
parent 16a5169a43
commit 42fa69943d
8 changed files with 487 additions and 56 deletions
+3 -3
View File
@@ -53,7 +53,6 @@ class cron_task extends \core\task\scheduled_task {
mtrace(' processing workshop subplugins ...');
// Now when the scheduled allocator had a chance to do its job.
// Check if there are some workshops to switch into the assessment phase.
$workshops = $DB->get_records_select("workshop",
"phase = 20 AND phaseswitchassessment = 1 AND submissionend > 0 AND submissionend < ?", [$now]);
@@ -72,10 +71,11 @@ class cron_task extends \core\task\scheduled_task {
'context' => $workshop->context,
'courseid' => $workshop->course->id,
'other' => [
'workshopphase' => $workshop->phase
'targetworkshopphase' => $workshop->phase,
'previousworkshopphase' => \workshop::PHASE_SUBMISSION,
]
];
$event = \mod_workshop\event\phase_switched::create($params);
$event = \mod_workshop\event\phase_automatically_switched::create($params);
$event->trigger();
// Disable the automatic switching now so that it is not executed again by accident.