Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
quiz_statistics\calculated Class Reference

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...
 

Public Attributes

 $allattemptsavg
 
 $allattemptscount = 0
 
 $cic
 
 $errorratio
 
 $firstattemptsavg
 
 $firstattemptscount = 0
 
 $highestattemptsavg
 
 $highestattemptscount = 0
 
 $kurtosis
 
 $lastattemptsavg
 
 $lastattemptscount = 0
 
 $median
 
 $skewness
 
 $standarddeviation
 
 $standarderror
 
int $timemodified
 time these stats where calculated and cached.
 
int $whichattempts
 which attempts we are calculating calculate stats from.
 

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...
 

Constructor & Destructor Documentation

◆ __construct()

quiz_statistics\calculated::__construct (   $whichattempts = null)
Parameters
string$whichattemptswhich 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.

Member Function Documentation

◆ avg()

quiz_statistics\calculated::avg ( )

Average grade for the attempts selected by $this->whichattempts.

Return values
float

◆ cache()

quiz_statistics\calculated::cache (   $qubaids)

Cache the stats contained in this class.

Parameters
$qubaidsqubaid_condition

◆ get_field()

quiz_statistics\calculated::get_field (   $field)
protected

Get the right field name to fetch a stat for these attempts that is calculated for more than one $whichattempts (count or avg).

Parameters
string$fieldname of field
Return values
int|float

◆ get_formatted_quiz_info_data()

quiz_statistics\calculated::get_formatted_quiz_info_data (   $course,
  $cm,
  $quiz 
)
Parameters
$course
$cm
$quiz
Return values
arrayto display in table or spreadsheet.

◆ populate_from_record()

quiz_statistics\calculated::populate_from_record (   $record)

Given a record from 'quiz_statistics' table load the data into the properties of this class.

Parameters
$recordstdClass from db.

◆ s()

quiz_statistics\calculated::s ( )

Count of attempts selected by $this->whichattempts.

Return values
int

Member Data Documentation

◆ $fieldsindb

array quiz_statistics\calculated::$fieldsindb
protected
Initial value:
= array('whichattempts', 'firstattemptscount', 'allattemptscount', 'firstattemptsavg', 'allattemptsavg',
'lastattemptscount', 'highestattemptscount', 'lastattemptsavg', 'highestattemptsavg',
'median', 'standarddeviation', 'skewness',
'kurtosis', 'cic', 'errorratio', 'standarderror')

of names of properties of this class that are cached in db record.


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