Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 400 and 401] [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 117 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

recalculate:: (4 methods):
  instance()
  get_name()
  execute()
  queue_future_run()


Class: recalculate  - X-Ref

Re-calculate question statistics.

instance(int $quizid)   X-Ref
Create a new instance of the task.

This sets the properties so that only one task will be queued at a time for a given quiz.

param: int $quizid
return: recalculate

get_name()   X-Ref
No description

execute()   X-Ref
No description

queue_future_run(int $quizid)   X-Ref
Queue an instance of this task to happen after a delay.

Multiple events may happen over a short period that require a recalculation. Rather than
run the recalculation each time, this will queue a single run of the task for a given quiz,
within the delay period.

param: int $quizid The quiz to run the recalculation for.
return: bool true of the task was queued.