Moodle PHP Documentation 4.2
Moodle 4.2.8 (Build: 20240610) (2d41ac46f45)
award_criteria Class Reference

Award criteria abstract definition. More...

Inheritance diagram for award_criteria:
award_criteria_activity award_criteria_badge award_criteria_cohort award_criteria_competency award_criteria_course award_criteria_courseset award_criteria_manual award_criteria_overall award_criteria_profile

Public Member Functions

 __construct ($params)
 The base constructor.
 
 config_form_criteria ($data)
 Add appropriate criteria elements.
 
 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.
 
 get_details ($short='')
 Get criteria details for displaying to users.
 
 get_options (&$mform)
 Add appropriate criteria options to the form.
 
 get_params ($cid)
 Return criteria parameters.
 
 get_title ()
 Return criteria title.
 
 make_clone ($newbadgeid)
 Saves intial criteria records with required parameters set up.
 
 mark_complete ($userid)
 Mark this criteria as complete for a user.
 
 review ($userid, $filtered=false)
 Review this criteria and decide if the user has completed.
 
 save ($params=array())
 Saves intial criteria records with required parameters set up.
 

Static Public Member Functions

static build ($params)
 Factory method for creating criteria class object.
 
static is_enabled ()
 Allow some specific criteria types to be disabled based on config.
 

Public Attributes

integer $badgeid
 ID of a badge this criterion belongs to.
 
string $criteriatype
 Criteria type.
 
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 $optional_params = []
 Optional parameters.
 
array $params = array()
 Any additional parameters.
 
string $required_param = ''
 Required parameters.
 

Detailed Description

Award criteria abstract definition.

Constructor & Destructor Documentation

◆ __construct()

award_criteria::__construct ( $params)

The base constructor.

Parameters
array$params

Reimplemented in award_criteria_activity, and award_criteria_course.

Member Function Documentation

◆ build()

static award_criteria::build ( $params)
static

Factory method for creating criteria class object.

Parameters
array$paramsassociative arrays varname => value
Return values
award_criteria

◆ config_form_criteria()

award_criteria::config_form_criteria ( $data)

Add appropriate criteria elements.

Parameters
stdClass$datadetails of various criteria

Reimplemented in award_criteria_course, and award_criteria_overall.

◆ config_options()

award_criteria::config_options ( & $mform,
$param )

Add appropriate parameter elements to the criteria form.

Reimplemented in award_criteria_overall.

◆ delete()

award_criteria::delete ( )

Delete this criterion.

Reimplemented in award_criteria_manual.

◆ get_completed_criteria_sql()

award_criteria::get_completed_criteria_sql ( )
abstract

Returns array with sql code and parameters returning all ids of users who meet this particular criterion.

Return values
arraylist($join, $where, $params)

Reimplemented in award_criteria_activity, award_criteria_badge, award_criteria_cohort, award_criteria_competency, award_criteria_course, award_criteria_courseset, award_criteria_manual, award_criteria_overall, and award_criteria_profile.

◆ get_details()

award_criteria::get_details ( $short = '')
abstract

Get criteria details for displaying to users.

Parameters
string$shortPrint short version of criteria
Return values
string

Reimplemented in award_criteria_activity, award_criteria_badge, award_criteria_cohort, award_criteria_competency, award_criteria_course, award_criteria_courseset, award_criteria_manual, award_criteria_overall, and award_criteria_profile.

◆ get_options()

award_criteria::get_options ( & $mform)
abstract

◆ get_params()

award_criteria::get_params ( $cid)

Return criteria parameters.

Parameters
int$critidCriterion ID
Return values
array

Reimplemented in award_criteria_overall.

◆ get_title()

award_criteria::get_title ( )

Return criteria title.

Return values
string

◆ is_enabled()

static award_criteria::is_enabled ( )
static

Allow some specific criteria types to be disabled based on config.

Return values
boolean

Reimplemented in award_criteria_competency.

◆ mark_complete()

award_criteria::mark_complete ( $userid)

Mark this criteria as complete for a user.

Parameters
int$useridUser whose criteria is completed.

◆ review()

award_criteria::review ( $userid,
$filtered = false )
abstract

Review this criteria and decide if the user has completed.

Parameters
int$useridUser whose criteria completion needs to be reviewed.
bool$filteredAn additional parameter indicating that user list has been reduced and some expensive checks can be skipped.
Return values
boolWhether criteria is complete

Reimplemented in award_criteria_activity, award_criteria_badge, award_criteria_cohort, award_criteria_competency, award_criteria_course, award_criteria_courseset, award_criteria_manual, award_criteria_overall, and award_criteria_profile.

◆ save()

award_criteria::save ( $params = array())

Saves intial criteria records with required parameters set up.

Parameters
array$paramsValues from the form or any other array.

Reimplemented in award_criteria_badge, award_criteria_cohort, award_criteria_competency, and award_criteria_overall.


The documentation for this class was generated from the following file: