◆ get_future_time()
static mod_quiz\notification_helper::get_future_time |
( |
?int | $range = null | ) |
|
|
staticprotected |
Get a future time that serves as the cut-off for this notification.
- Parameters
-
int | null | $range | Amount of seconds added to the now time (optional). |
- Return values
-
int | The time now value plus the range. |
◆ get_quizzes_within_date_range()
static mod_quiz\notification_helper::get_quizzes_within_date_range |
( |
| ) |
|
|
static |
Get all quizzes that have an approaching open date (includes users and groups with open date overrides).
- Return values
-
◆ get_time_now()
static mod_quiz\notification_helper::get_time_now |
( |
| ) |
|
|
staticprotected |
Get the time now.
- Return values
-
int | The time now as a timestamp. |
◆ get_users_within_quiz()
static mod_quiz\notification_helper::get_users_within_quiz |
( |
int | $quizid | ) |
|
|
static |
Get all users that have an approaching open date within a quiz.
- Parameters
-
- Return values
-
array | The users after all filtering has been applied. |
◆ has_user_attempted()
static mod_quiz\notification_helper::has_user_attempted |
( |
stdClass | $user | ) |
|
|
staticprotected |
Check if a user has attempted this quiz already.
- Parameters
-
stdClass | $user | The user record we will be checking. |
- Return values
-
bool | Return true if attempt found. |
◆ has_user_been_sent_a_notification_already()
static mod_quiz\notification_helper::has_user_been_sent_a_notification_already |
( |
int | $userid, |
|
|
string | $match ) |
|
staticprotected |
Check if a user has been sent a notification already.
- Parameters
-
int | $userid | The user id. |
string | $match | The custom data string to match on. |
- Return values
-
bool | Returns true if already sent. |
◆ is_time_within_range()
static mod_quiz\notification_helper::is_time_within_range |
( |
int | $time | ) |
|
|
staticprotected |
Check if a time is within the current time now and the future time values.
- Parameters
-
int | $time | The timestamp to check. |
- Return values
-
◆ send_notification_to_user()
static mod_quiz\notification_helper::send_notification_to_user |
( |
stdClass | $user | ) |
|
|
static |
Send the notification to the user.
- Parameters
-
stdClass | $user | The user's custom data. |
◆ update_user_with_date_overrides()
static mod_quiz\notification_helper::update_user_with_date_overrides |
( |
array | $overrides, |
|
|
stdClass | $user ) |
|
staticprotected |
Update user's recorded date based on the overrides.
- Parameters
-
array | $overrides | The overrides to check. |
stdClass | $user | The user records we will be updating. |
The documentation for this class was generated from the following file:
- mod/quiz/classes/notification_helper.php