Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
|
This class is used to return the stats as calculated by core_question::statistics::questions::calculator. More...
Public Member Functions | |
__construct ($question=null, $slot=null, $variant=null) | |
Set up a calculated instance ready to store a question's (or a variant of a slot's question's) stats for one slot in the quiz. | |
break_down_by_variant () | |
Do we break down the stats for this question by variant or not? | |
cache ($qubaids, $timemodified=null) | |
Cache calculated stats stored in this object in 'question_statistics' table. | |
clear_variants () | |
Delete the data structure for storing variant stats. | |
get_sub_question_ids () | |
Get any sub question ids for this question. | |
get_variants () | |
Array of variants that have appeared in the attempt data for this question. | |
populate_from_record ($record) | |
Load properties of this class from db record. | |
random_selector_string () | |
Used to determine which random questions pull sub questions from the same pools. | |
sort_variants () | |
Sort the variants of this question by variant number. | |
Public Attributes | |
$covariance | |
$covariancemax | |
$covariancemaxsum = 0 | |
$covariancesum = 0 | |
$covariancewithoverallmark | |
$covariancewithoverallmarksum = 0 | |
float | $discriminationindex |
float | $discriminativeefficiency |
float | $effectiveweight |
effective weight of this question. | |
float | $facility |
$markarray = array() | |
$markaverage | |
$markvariance | |
$markvariancesum = 0 | |
float | $maxmark |
max mark achievable for this question. | |
string | $minmedianmaxnotice = '' |
if this stat has been picked as a min, median or maximum facility value then this string says which stat this is. | |
bool | $negcovar |
is covariance of this questions mark with other question marks negative? | |
$othermarkaverage | |
$othermarksarray = array() | |
$othermarkvariance | |
$othermarkvariancesum = 0 | |
string | $positions |
comma separated list of the positions in which this question appears. | |
object | $question |
full question data | |
$questionid | |
null float | $randomguessscore = null |
The average score that students would have got by guessing randomly. | |
int | $s = 0 |
total attempts at this question. | |
float | $sd |
standard deviation | |
$slot = null | |
bool | $subquestion = false |
is this a sub question. | |
$subquestions = '' | |
float | $summarksaverage |
The average for all attempts, of the sum of the marks for all positions in which this item appeared. | |
integer | $timemodified |
Set if this record has been retrieved from cache. | |
$totalmarks = 0 | |
$totalothermarks = 0 | |
float | $totalsummarks = 0 |
The total of marks achieved for all positions in all attempts where this item was seen. | |
null integer | $variant = null |
if this property is not null then this is the stats for a variant of a question or when inherited by calculated_for_subquestion and not null then this is the stats for a variant of a sub question. | |
calculated[] | $variantstats = array() |
An array of calculated stats for each variant of the question. | |
Protected Attributes | |
$fieldsindb | |
This class is used to return the stats as calculated by core_question::statistics::questions::calculator.
core_question\statistics\questions\calculated::__construct | ( | $question = null, | |
$slot = null, | |||
$variant = null ) |
Set up a calculated instance ready to store a question's (or a variant of a slot's question's) stats for one slot in the quiz.
null | object | $question | |
null | int | $slot | |
null | int | $variant |
Reimplemented in core_question\statistics\questions\calculated_question_summary.
core_question\statistics\questions\calculated::break_down_by_variant | ( | ) |
Do we break down the stats for this question by variant or not?
bool | Do we? |
Reimplemented in core_question\statistics\questions\calculated_question_summary.
core_question\statistics\questions\calculated::cache | ( | $qubaids, | |
$timemodified = null ) |
Cache calculated stats stored in this object in 'question_statistics' table.
qubaid_condition | $qubaids | |
int | null | $timemodified | the modified time to store. Defaults to the current time. |
core_question\statistics\questions\calculated::get_sub_question_ids | ( | ) |
Get any sub question ids for this question.
int[] | array of sub-question ids or empty array if there are none. |
core_question\statistics\questions\calculated::get_variants | ( | ) |
Array of variants that have appeared in the attempt data for this question.
Or an empty array if there is only one variant.
int[] | the variant nos. |
core_question\statistics\questions\calculated::populate_from_record | ( | $record | ) |
Load properties of this class from db record.
object | $record | Given a record from 'question_statistics' copy stats from record to properties. |
core_question\statistics\questions\calculated::random_selector_string | ( | ) |
Used to determine which random questions pull sub questions from the same pools.
Where pool means category and possibly all the sub categories of that category.
null|string | represents the pool of questions from which this question draws if it is random, or null if not. |
|
protected |
string core_question\statistics\questions\calculated::$minmedianmaxnotice = '' |
if this stat has been picked as a min, median or maximum facility value then this string says which stat this is.
Prepended to question name for display.
null float core_question\statistics\questions\calculated::$randomguessscore = null |
The average score that students would have got by guessing randomly.
Or null if not calculable.
integer core_question\statistics\questions\calculated::$timemodified |
Set if this record has been retrieved from cache.
This is the time that the statistics were calculated.
calculated [] core_question\statistics\questions\calculated::$variantstats = array() |
An array of calculated stats for each variant of the question.
Even when there is just one variant we still calculate this data as there is no way to know if there are variants before we have finished going through the attempt data one time.
$variants