Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
award_criteria_competency Class Reference

Badge award criteria – award on competency completion. More...

Inheritance diagram for award_criteria_competency:
award_criteria

Public Member Functions

 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 new criteria options to the form. More...
 
 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 it has been completed. More...
 
 save ($params=array())
 Save criteria records. More...
 

Static Public Member Functions

static build ($params)
 Factory method for creating criteria class object. More...
 
static has_records_for_competencies ($competencyids)
 Check if any badge has records for competencies. More...
 
static is_enabled ()
 Hide this criteria when competencies are disabled. More...
 

Public Attributes

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

Detailed Description

Badge award criteria – award on competency completion.

@subpackage badges

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ build()

static award_criteria::build (   $params)
staticinherited

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)
inherited

Add appropriate criteria elements.

Parameters
stdClass$datadetails of various criteria

Reimplemented in award_criteria_overall, and award_criteria_course.

◆ get_completed_criteria_sql()

award_criteria_competency::get_completed_criteria_sql ( )

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

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

Reimplemented from award_criteria.

◆ get_details()

award_criteria_competency::get_details (   $short = '')

Get criteria details for displaying to users.

Parameters
string$shortPrint short version of criteria
Return values
string

Reimplemented from award_criteria.

◆ get_options()

award_criteria_competency::get_options ( $mform)

Add appropriate new criteria options to the form.

Parameters
object$mformmoodle form
Return values
arrayFirst item is a boolean to indicate an error and the second is the error message.

Reimplemented from award_criteria.

◆ get_params()

award_criteria::get_params (   $cid)
inherited

Return criteria parameters.

Parameters
int$critidCriterion ID
Return values
array

Reimplemented in award_criteria_overall.

◆ get_title()

award_criteria::get_title ( )
inherited

Return criteria title.

Return values
string

◆ has_records_for_competencies()

static award_criteria_competency::has_records_for_competencies (   $competencyids)
static

Check if any badge has records for competencies.

Parameters
array$competencyidsArray of competencies ids.
Return values
booleanReturn true if competencies were found in any badge.

◆ is_enabled()

static award_criteria_competency::is_enabled ( )
static

Hide this criteria when competencies are disabled.

Return values
boolean

Reimplemented from award_criteria.

◆ mark_complete()

award_criteria::mark_complete (   $userid)
inherited

Mark this criteria as complete for a user.

Parameters
int$useridUser whose criteria is completed.

◆ review()

award_criteria_competency::review (   $userid,
  $filtered = false 
)

Review this criteria and decide if it has been 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 from award_criteria.

◆ save()

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

Save criteria records.

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

Reimplemented from award_criteria.


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