Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

Scheduled allocator that internally executes the random allocation later

Copyright: 2012 David Mudrak <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 275 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 4 files
 mod/workshop/allocation/scheduled/settings_form.php
 mod/workshop/locallib.php
 mod/workshop/allocation/lib.php
 mod/workshop/allocation/random/lib.php

Defines 1 class

workshop_scheduled_allocator:: (6 methods):
  __construct()
  init()
  ui()
  execute()
  delete_instance()
  store_settings()


Class: workshop_scheduled_allocator  - X-Ref

Allocates the submissions randomly in a cronjob task

__construct(workshop $workshop)   X-Ref

param: workshop $workshop Workshop API object

init()   X-Ref
Save the settings for the random allocator to execute it later


ui()   X-Ref
Returns the HTML code to print the user interface


execute(bool $checksubmissionphase = true)   X-Ref
Executes the allocation

param: bool $checksubmissionphase Check that the workshop is in submission phase before doing anything else.
return: workshop_allocation_result

delete_instance($workshopid)   X-Ref
Delete all data related to a given workshop module instance

param: int $workshopid id of the workshop module instance being deleted
return: void

store_settings($enabled, $reset, workshop_random_allocator_setting $settings, workshop_allocation_result $result)   X-Ref
Stores the pre-defined random allocation settings for later usage

param: bool $enabled is the scheduled allocation enabled
param: bool $reset reset the recent execution info
param: workshop_random_allocator_setting $settings settings form data
param: workshop_allocation_result $result logger