Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
|
Public Member Functions | |
__construct ($whichattempts=null) | |
avg () | |
Average grade for the attempts selected by $this->whichattempts. More... | |
cache ($qubaids) | |
Cache the stats contained in this class. More... | |
get_formatted_quiz_info_data ($course, $cm, $quiz) | |
populate_from_record ($record) | |
Given a record from 'quiz_statistics' table load the data into the properties of this class. More... | |
s () | |
Count of attempts selected by $this->whichattempts. More... | |
Protected Member Functions | |
get_field ($field) | |
Get the right field name to fetch a stat for these attempts that is calculated for more than one $whichattempts (count or avg). More... | |
Protected Attributes | |
array | $fieldsindb |
of names of properties of this class that are cached in db record. More... | |
quiz_statistics\calculated::__construct | ( | $whichattempts = null | ) |
string | $whichattempts | which attempts to use, represented internally as one of the constants as used in $quiz->grademethod ie. QUIZ_GRADEAVERAGE, QUIZ_GRADEHIGHEST, QUIZ_ATTEMPTLAST or QUIZ_ATTEMPTFIRST we calculate stats based on which attempts would affect the grade for each student, the default null value is used when constructing an instance whose values will be populated from a db record. |
quiz_statistics\calculated::avg | ( | ) |
Average grade for the attempts selected by $this->whichattempts.
float |
quiz_statistics\calculated::cache | ( | $qubaids | ) |
Cache the stats contained in this class.
$qubaids | qubaid_condition |
|
protected |
Get the right field name to fetch a stat for these attempts that is calculated for more than one $whichattempts (count or avg).
string | $field | name of field |
int|float |
quiz_statistics\calculated::get_formatted_quiz_info_data | ( | $course, | |
$cm, | |||
$quiz | |||
) |
$course | |
$cm | |
$quiz |
array | to display in table or spreadsheet. |
quiz_statistics\calculated::populate_from_record | ( | $record | ) |
Given a record from 'quiz_statistics' table load the data into the properties of this class.
$record | stdClass from db. |
quiz_statistics\calculated::s | ( | ) |
Count of attempts selected by $this->whichattempts.
int |
|
protected |
of names of properties of this class that are cached in db record.