|
Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Award criteria abstract definition. More...
Public Member Functions | |
| __construct ($params) | |
| The base constructor. More... | |
| config_form_criteria ($data) | |
| Add appropriate criteria elements. More... | |
| config_options (&$mform, $param) | |
| Add appropriate parameter elements to the criteria form. | |
| delete () | |
| Delete this criterion. | |
| get_completed_criteria_sql () | |
| Returns array with sql code and parameters returning all ids of users who meet this particular criterion. More... | |
| get_details ($short='') | |
| Get criteria details for displaying to users. More... | |
| get_options (&$mform) | |
| Add appropriate criteria options to the form. | |
| get_params ($cid) | |
| Return criteria parameters. More... | |
| get_title () | |
| Return criteria title. More... | |
| make_clone ($newbadgeid) | |
| Saves intial criteria records with required parameters set up. | |
| mark_complete ($userid) | |
| Mark this criteria as complete for a user. More... | |
| review ($userid, $filtered=false) | |
| Review this criteria and decide if the user has completed. More... | |
| save ($params=array()) | |
| Saves intial criteria records with required parameters set up. More... | |
Static Public Member Functions | |
| static | build ($params) |
| Factory method for creating criteria class object. More... | |
| static | is_enabled () |
| Allow some specific criteria types to be disabled based on config. More... | |
Public Attributes | |
| integer | $badgeid |
| ID of a badge this criterion belongs to. | |
| string | $description |
| Criterion HTML/plain text description. | |
| integer | $descriptionformat |
| Format of the criterion description. | |
| integer | $id |
| ID of the criterion. | |
| integer | $method |
| Aggregation method [BADGE_CRITERIA_AGGREGATION_ANY, BADGE_CRITERIA_AGGREGATION_ALL]. | |
| array | $params = array() |
| Any additional parameters. | |
Award criteria abstract definition.
| award_criteria::__construct | ( | $params | ) |
The base constructor.
| array | $params |
Reimplemented in award_criteria_course, and award_criteria_activity.
|
static |
Factory method for creating criteria class object.
| array | $params | associative arrays varname => value |
| award_criteria |
| award_criteria::config_form_criteria | ( | $data | ) |
Add appropriate criteria elements.
| stdClass | $data | details of various criteria |
Reimplemented in award_criteria_overall, and award_criteria_course.
|
abstract |
Returns array with sql code and parameters returning all ids of users who meet this particular criterion.
| array | list($join, $where, $params) |
Reimplemented in award_criteria_profile, award_criteria_overall, award_criteria_manual, award_criteria_courseset, award_criteria_course, award_criteria_competency, award_criteria_cohort, award_criteria_badge, and award_criteria_activity.
|
abstract |
Get criteria details for displaying to users.
| string | $short | Print short version of criteria |
| string |
Reimplemented in award_criteria_profile, award_criteria_overall, award_criteria_manual, award_criteria_courseset, award_criteria_course, award_criteria_competency, award_criteria_cohort, award_criteria_badge, and award_criteria_activity.
| award_criteria::get_params | ( | $cid | ) |
Return criteria parameters.
| int | $critid | Criterion ID |
| array |
Reimplemented in award_criteria_overall.
| award_criteria::get_title | ( | ) |
Return criteria title.
| string |
|
static |
Allow some specific criteria types to be disabled based on config.
| boolean |
Reimplemented in award_criteria_competency.
| award_criteria::mark_complete | ( | $userid | ) |
Mark this criteria as complete for a user.
| int | $userid | User whose criteria is completed. |
|
abstract |
Review this criteria and decide if the user has completed.
| int | $userid | User whose criteria completion needs to be reviewed. |
| bool | $filtered | An additional parameter indicating that user list has been reduced and some expensive checks can be skipped. |
| bool | Whether criteria is complete |
Reimplemented in award_criteria_profile, award_criteria_overall, award_criteria_manual, award_criteria_courseset, award_criteria_course, award_criteria_competency, award_criteria_cohort, award_criteria_badge, and award_criteria_activity.
| award_criteria::save | ( | $params = array() | ) |
Saves intial criteria records with required parameters set up.
| array | $params | Values from the form or any other array. |
Reimplemented in award_criteria_overall, award_criteria_competency, award_criteria_cohort, and award_criteria_badge.