Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
quiz_statistics_question_table Class Reference

This table shows statistics about a particular question. More...

Inheritance diagram for quiz_statistics_question_table:

Public Member Functions

 __construct ($qid)
 Constructor.
 
 other_cols ($colname, $response)
 If there is not a col_{column name} method then we call this method.
 
 question_setup ($reporturl, $questiondata, $s, $responseanalysis)
 Set up columns and column names and other table settings.
 

Protected Member Functions

 col_fraction ($response)
 The mark fraction that this response earns.
 
 col_frequency ($response)
 The frequency with which this response was given.
 
 format_percentage ($fraction)
 Take a float where 1 represents 100% and return a string representing the percentage.
 

Protected Attributes

stdClass $questiondata
 full question object for this question.
 
int $s
 no of attempts.
 

Detailed Description

This table shows statistics about a particular question.

Lists the responses that students made to this question, with frequency counts.

The responses may be grouped, either by sub-part of the question, or by the answer they match.

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

quiz_statistics_question_table::__construct ( $qid)

Constructor.

Parameters
int$qidthe id of the particular question whose statistics are being displayed.

Member Function Documentation

◆ col_fraction()

quiz_statistics_question_table::col_fraction ( $response)
protected

The mark fraction that this response earns.

Parameters
stdClass$responsecontainst the data to display.
Return values
stringcontents of this table cell.

◆ col_frequency()

quiz_statistics_question_table::col_frequency ( $response)
protected

The frequency with which this response was given.

Parameters
stdClass$responsecontains the data to display.
Return values
stringcontents of this table cell.

◆ format_percentage()

quiz_statistics_question_table::format_percentage ( $fraction)
protected

Take a float where 1 represents 100% and return a string representing the percentage.

Parameters
float$fractionThe fraction.
Return values
stringThe fraction as a percentage.

◆ other_cols()

quiz_statistics_question_table::other_cols ( $colname,
$response )

If there is not a col_{column name} method then we call this method.

If it returns null that means just output the property as in the table raw data. If this returns none null then this is the output for this cell of the table.

Parameters
string$colnameThe name of this column.
stdClass$responseThe raw data for this row.
Return values
string|nullThe value for this cell of the table or null means use raw data.

◆ question_setup()

quiz_statistics_question_table::question_setup ( $reporturl,
$questiondata,
$s,
$responseanalysis )

Set up columns and column names and other table settings.

Parameters
moodle_url$reporturl
stdClass$questiondata
integer$snumber of attempts on this question.
core_question\statistics\responses\analysis_for_question$responseanalysis

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