Re-calculate question statistics.
More...
|
static | instance (int $quizid) |
| Create a new instance of the task.
|
|
static | queue_future_run (int $quizid) |
| Queue an instance of this task to happen after a delay.
|
|
|
const | DELAY = HOURSECS |
| The time to delay queued runs by, to prevent repeated recalculations.
|
|
Re-calculate question statistics.
- Copyright
- 2022 Catalyst IT Australia Pty Ltd
- Author
- Nathan Nguyen natha.nosp@m.nngu.nosp@m.yen@c.nosp@m.atal.nosp@m.yst-a.nosp@m.u.ne.nosp@m.t
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ execute()
quiz_statistics\task\recalculate::execute |
( |
| ) |
|
Do the job.
Throw exceptions on errors (the job will be retried).
Reimplemented from core\task\task_base.
◆ get_component()
core\task\task_base::get_component |
( |
| ) |
|
|
inherited |
Getter for $component.
- Return values
-
◆ get_concurrency_limit()
core\task\adhoc_task::get_concurrency_limit |
( |
| ) |
|
|
finalinherited |
Returns effective concurrency limit for this task.
- Return values
-
int | effective concurrency limit for this task |
◆ get_cron_lock()
core\task\task_base::get_cron_lock |
( |
| ) |
|
|
inherited |
Get the current lock for the entire cron.
- Return values
-
◆ get_custom_data()
core\task\adhoc_task::get_custom_data |
( |
| ) |
|
|
inherited |
Getter for $customdata.
- Return values
-
mixed | (anything that can be handled by json_decode). |
◆ get_custom_data_as_string()
core\task\adhoc_task::get_custom_data_as_string |
( |
| ) |
|
|
inherited |
Alternate getter for $customdata.
- Return values
-
string | this is the raw json encoded version. |
◆ get_default_concurrency_limit()
core\task\adhoc_task::get_default_concurrency_limit |
( |
| ) |
|
|
protectedinherited |
Returns default concurrency limit for this task.
- Return values
-
int | default concurrency limit |
◆ get_fail_delay()
core\task\task_base::get_fail_delay |
( |
| ) |
|
|
inherited |
Getter for $faildelay.
- Return values
-
◆ get_hostname()
core\task\task_base::get_hostname |
( |
| ) |
|
|
inherited |
Getter for $hostname.
- Return values
-
◆ get_id()
core\task\adhoc_task::get_id |
( |
| ) |
|
|
inherited |
Getter for $id.
- Return values
-
◆ get_lock()
core\task\task_base::get_lock |
( |
| ) |
|
|
inherited |
Get the current lock for this task.
- Return values
-
◆ get_name()
quiz_statistics\task\recalculate::get_name |
( |
| ) |
|
Provide default implementation of the task name for backward compatibility.
Extending classes are expected to implement this method to provide a descriptive name for the task (shown to admins)
- Return values
-
Reimplemented from core\task\adhoc_task.
◆ get_next_run_time()
core\task\task_base::get_next_run_time |
( |
| ) |
|
|
inherited |
Get the next run time for this task.
- Return values
-
◆ get_pid()
core\task\task_base::get_pid |
( |
| ) |
|
|
inherited |
Getter for $pid.
- Return values
-
◆ get_runtime()
core\task\task_base::get_runtime |
( |
| ) |
|
|
inherited |
Returns task runtime.
- Return values
-
◆ get_runtime_result()
core\task\task_base::get_runtime_result |
( |
| ) |
|
|
inherited |
Returns if the task has been running for too long.
- Return values
-
◆ get_timestarted()
core\task\task_base::get_timestarted |
( |
| ) |
|
|
inherited |
Getter for $timestarted.
- Return values
-
◆ get_userid()
core\task\adhoc_task::get_userid |
( |
| ) |
|
|
inherited |
Getter for $userid.
- Return values
-
◆ instance()
static quiz_statistics\task\recalculate::instance |
( |
int | $quizid | ) |
|
|
static |
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.
- Parameters
-
- Return values
-
◆ is_blocking()
core\task\task_base::is_blocking |
( |
| ) |
|
|
inherited |
Getter for $blocking.
- Return values
-
◆ is_component_enabled()
core\task\task_base::is_component_enabled |
( |
| ) |
|
|
inherited |
Informs whether the task's component is enabled.
- Return values
-
bool | true when enabled. false otherwise. |
◆ queue_future_run()
static quiz_statistics\task\recalculate::queue_future_run |
( |
int | $quizid | ) |
|
|
static |
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.
- Parameters
-
int | $quizid | The quiz to run the recalculation for. |
- Return values
-
bool | true of the task was queued. |
◆ set_blocking()
core\task\task_base::set_blocking |
( |
| $blocking | ) |
|
|
inherited |
Setter for $blocking.
- Parameters
-
◆ set_component()
core\task\task_base::set_component |
( |
| $component | ) |
|
|
inherited |
Setter for $component.
- Parameters
-
◆ set_concurrency_lock()
Sets concurrency task lock.
- Parameters
-
◆ set_cron_lock()
Set the current lock for the entire cron process.
- Parameters
-
◆ set_custom_data()
core\task\adhoc_task::set_custom_data |
( |
| $customdata | ) |
|
|
inherited |
Setter for $customdata.
- Parameters
-
mixed | $customdata | (anything that can be handled by json_encode) |
◆ set_custom_data_as_string()
core\task\adhoc_task::set_custom_data_as_string |
( |
| $customdata | ) |
|
|
inherited |
Alternate setter for $customdata.
Expects the data as a json_encoded string.
- Parameters
-
string | $customdata | json_encoded string |
◆ set_fail_delay()
core\task\task_base::set_fail_delay |
( |
| $faildelay | ) |
|
|
inherited |
Setter for $faildelay.
- Parameters
-
◆ set_hostname()
core\task\task_base::set_hostname |
( |
| $hostname = null | ) |
|
|
inherited |
Setter for $hostname.
- Parameters
-
◆ set_id()
core\task\adhoc_task::set_id |
( |
| $id | ) |
|
|
inherited |
Setter for $id.
- Parameters
-
◆ set_lock()
Set the current lock for this task.
- Parameters
-
◆ set_next_run_time()
core\task\task_base::set_next_run_time |
( |
| $nextruntime | ) |
|
|
inherited |
Set the next run time for this task.
- Parameters
-
◆ set_pid()
core\task\task_base::set_pid |
( |
| $pid = null | ) |
|
|
inherited |
Setter for $pid.
- Parameters
-
◆ set_timestarted()
core\task\task_base::set_timestarted |
( |
| $timestarted = null | ) |
|
|
inherited |
Setter for $timestarted.
- Parameters
-
◆ set_userid()
core\task\adhoc_task::set_userid |
( |
| $userid | ) |
|
|
inherited |
Setter for $userid.
- Parameters
-
The documentation for this class was generated from the following file: