Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
workshopallocation_scheduled\observer Class Reference

Class for workshopallocation_scheduled observers. More...

Static Public Member Functions

static phase_automatically_switched (\mod_workshop\event\phase_automatically_switched $event)
 Called when the 'mod_workshop\event\phase_automatically_switched' event is triggered.
 
static workshop_viewed ($event)
 Triggered when the 'mod_workshop\event\course_module_viewed' event is triggered.
 

Detailed Description

Class for workshopallocation_scheduled observers.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ phase_automatically_switched()

static workshopallocation_scheduled\observer::phase_automatically_switched ( \mod_workshop\event\phase_automatically_switched $event)
static

Called when the 'mod_workshop\event\phase_automatically_switched' event is triggered.

This observer handles the phase_automatically_switched event triggered when phaseswithassesment is active and the phase is automatically switched.

When this happens, this situation can occur:

* cron_task transition the workshop to PHASE_ASESSMENT.
* scheduled_allocator task executes.
* scheduled_allocator task cannot allocate parcipants because workshop is not
  in PHASE_SUBMISSION state (it's in PHASE_ASSESMENT).
Parameters
mod_workshop\event\phase_automatically_switched$event

◆ workshop_viewed()

static workshopallocation_scheduled\observer::workshop_viewed ( $event)
static

Triggered when the 'mod_workshop\event\course_module_viewed' event is triggered.

This does the same job as workshopallocation_scheduled_cron() but for the single workshop. The idea is that we do not need to wait for cron to execute. Displaying the workshop main view.php can trigger the scheduled allocation, too.

Parameters
mod_workshop\event\course_module_viewed$event
Return values
bool

The documentation for this class was generated from the following file: