Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Protected Attributes | List of all members
core_question\statistics\responses\analysis_for_actual_response Class Reference

The leafs of the analysis data structure. More...

Public Member Functions

 __construct ($response, $fraction)
 
 cache ($qubaids, $whichtries, $questionid, $variantno, $subpartid, $responseclassid)
 Cache analysis for class. More...
 
 data_for_question_response_table ($partid, $modelresponse)
 Returns an object with a property for each column of the question response analysis table. More...
 
 get_maximum_tries ()
 What is the highest try number that this response has been seen? More...
 
 increment_count ($try=0)
 Used to count the occurrences of response sub parts. More...
 
 set_count ($try, $count)
 Used to set the count of occurrences of response sub parts, when loading count from cache. More...
 

Protected Attributes

float $fraction
 grade for this response, normally between 0 and 1.
 
string $response
 the response as it will be displayed in report.
 
int $totalcount = 0
 total count of tries with this response.
 
int[] $trycount = array()
 count per try for this response.
 

Detailed Description

The leafs of the analysis data structure.

Author
James Pratt me@ja.nosp@m.miep.nosp@m..org
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

core_question\statistics\responses\analysis_for_actual_response::__construct (   $response,
  $fraction 
)
Parameters
string$response
float$fraction

Member Function Documentation

◆ cache()

core_question\statistics\responses\analysis_for_actual_response::cache (   $qubaids,
  $whichtries,
  $questionid,
  $variantno,
  $subpartid,
  $responseclassid 
)

Cache analysis for class.

Parameters
qubaid_condition$qubaidswhich question usages have been analysed.
string$whichtrieswhich tries have been analysed?
int$questionidwhich question.
int$variantnowhich variant.
string$subpartidwhich sub part is this actual response in?
string$responseclassidwhich response class is this actual response in?

◆ data_for_question_response_table()

core_question\statistics\responses\analysis_for_actual_response::data_for_question_response_table (   $partid,
  $modelresponse 
)

Returns an object with a property for each column of the question response analysis table.

Parameters
string$partid
string$modelresponse
Return values
object

◆ get_maximum_tries()

core_question\statistics\responses\analysis_for_actual_response::get_maximum_tries ( )

What is the highest try number that this response has been seen?

Return values
inttry number

◆ increment_count()

core_question\statistics\responses\analysis_for_actual_response::increment_count (   $try = 0)

Used to count the occurrences of response sub parts.

Parameters
int$trythe try number, or 0 if only keeping one count, not a count for each try.

◆ set_count()

core_question\statistics\responses\analysis_for_actual_response::set_count (   $try,
  $count 
)

Used to set the count of occurrences of response sub parts, when loading count from cache.

Parameters
int$trythe try number, or 0 if only keeping one count, not a count for each try.
int$count

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