Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

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

This file contains the date criteria type

Author: Aaron Barnes <aaronb@catalyst.net.nz>
Copyright: 2009 Catalyst IT Ltd
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 230 lines (7 kb)
Included or required:0 times
Referenced: 4 times
Includes or requires: 0 files

Defines 1 class

completion_criteria_date:: (12 methods):
  fetch()
  config_form_display()
  update_config()
  review()
  get_title()
  get_title_detailed()
  get_type_title()
  get_status()
  cron()
  get_details()
  get_icon()
  update_date()


Class: completion_criteria_date  - X-Ref

Course completion critieria - completion on specified date

fetch($params)   X-Ref
Finds and returns a data_object instance based on params.

return: data_object data_object instance or false if none found.
param: array $params associative arrays varname=>value

config_form_display(&$mform, $data = null)   X-Ref
Add appropriate form elements to the critieria form

param: moodleform $mform Moodle forms object
param: stdClass $data not used

update_config(&$data)   X-Ref
Update the criteria information stored in the database

param: stdClass $data Form data

review($completion, $mark = true)   X-Ref
Review this criteria and decide if the user has completed

return: bool
param: completion_completion $completion The user's completion record
param: bool $mark Optionally set false to not save changes to database

get_title()   X-Ref
Return criteria title for display in reports

return: string

get_title_detailed()   X-Ref
Return a more detailed criteria title for display in reports

return: string

get_type_title()   X-Ref
Return criteria type title for display in reports

return: string

get_status($completion)   X-Ref
Return criteria status text for display in reports

return: string
param: completion_completion $completion The user's completion record

cron()   X-Ref
Find user's who have completed this criteria


get_details($completion)   X-Ref
Return criteria progress details for display in reports

return: array An array with the following keys:
param: completion_completion $completion The user's completion record

get_icon($alt, array $attributes = null)   X-Ref
Return pix_icon for display in reports.

return: pix_icon
param: string $alt The alt text to use for the icon
param: array $attributes html attributes

update_date($courseid, $timeshift)   X-Ref
Shift the date when resetting course.

return: boolean was the operation successful?
param: int $courseid the course id
param: int $timeshift number of seconds to shift date