Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250530) (c39b7370636)
quiz_statistics_table Class Reference

This table has one row for each question in the quiz, with sub-rows when random questions and variants appear. More...

Inheritance diagram for quiz_statistics_table:

Public Member Functions

 __construct ()
 Constructor.
 
 statistics_setup ($quiz, $cmid, $reporturl, $s)
 Set up the columns and headers and other properties of the table and then call flexible_table::setup() method.
 
 wrap_html_finish ()
 Close a statistics table div.
 
 wrap_html_start ()
 Open a div tag to wrap statistics table.
 

Protected Member Functions

 col_actions ($questionstat)
 Actions that can be performed on the question by this user (e.g.
 
 col_discrimination_index ($questionstat)
 Discrimination index.
 
 col_discriminative_efficiency ($questionstat)
 Discrimination efficiency, similar to, but different from, the Discrimination index.
 
 col_effective_weight ($questionstat)
 The effective question weight.
 
 col_facility ($questionstat)
 The facility index (average fraction).
 
 col_icon ($questionstat)
 The question type icon.
 
 col_intended_weight ($questionstat)
 The intended question weight.
 
 col_name ($questionstat)
 The question name.
 
 col_number ($questionstat)
 The question number.
 
 col_qtype ($questionstat)
 The question type name.
 
 col_random_guess_score ($questionstat)
 An estimate of the fraction a student would get by guessing randomly.
 
 col_s ($questionstat)
 The number of attempts at this question.
 
 col_sd ($questionstat)
 The standard deviation of the fractions.
 
 format_percentage (float $number, bool $fraction=true, int $decimals=2)
 Format a number to a localised percentage with specified decimal points.
 
 format_percentage_range (?float $min=null, ?float $max=null, bool $fraction=true, int $decimals=2)
 Format $min and $max to localised percentages and form a string that represents a range between them.
 
 format_range (?string $min=null, ?string $max=null)
 Format inputs to represent a range between $min and $max.
 
 is_calculated_question_summary ($questionstat)
 Check if the given stats object is an instance of calculated_question_summary.
 
 is_dubious_question ($questionstat)
 This method encapsulates the test for wheter a question should be considered dubious.
 

Protected Attributes

integer $cmid
 the quiz course_module id.
 
stdClass $quiz
 the quiz settings.
 

Detailed Description

This table has one row for each question in the quiz, with sub-rows when random questions and variants appear.

There are columns for the various item and position statistics.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ col_actions()

quiz_statistics_table::col_actions ( $questionstat)
protected

Actions that can be performed on the question by this user (e.g.

edit or preview).

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_discrimination_index()

quiz_statistics_table::col_discrimination_index ( $questionstat)
protected

Discrimination index.

This is the product moment correlation coefficient between the fraction for this question, and the average fraction for the other questions in this quiz.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_discriminative_efficiency()

quiz_statistics_table::col_discriminative_efficiency ( $questionstat)
protected

Discrimination efficiency, similar to, but different from, the Discrimination index.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_effective_weight()

quiz_statistics_table::col_effective_weight ( $questionstat)
protected

The effective question weight.

That is, an estimate of the actual influence this question has on the student's overall mark.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_facility()

quiz_statistics_table::col_facility ( $questionstat)
protected

The facility index (average fraction).

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_icon()

quiz_statistics_table::col_icon ( $questionstat)
protected

The question type icon.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_intended_weight()

quiz_statistics_table::col_intended_weight ( $questionstat)
protected

The intended question weight.

Maximum mark for the question as a percentage of maximum mark for the quiz. That is, the indended influence this question on the student's overall mark.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_name()

quiz_statistics_table::col_name ( $questionstat)
protected

The question name.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_number()

quiz_statistics_table::col_number ( $questionstat)
protected

The question number.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_qtype()

quiz_statistics_table::col_qtype ( $questionstat)
protected

The question type name.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_random_guess_score()

quiz_statistics_table::col_random_guess_score ( $questionstat)
protected

An estimate of the fraction a student would get by guessing randomly.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_s()

quiz_statistics_table::col_s ( $questionstat)
protected

The number of attempts at this question.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ col_sd()

quiz_statistics_table::col_sd ( $questionstat)
protected

The standard deviation of the fractions.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
stringcontents of this table cell.

◆ format_percentage()

quiz_statistics_table::format_percentage ( float $number,
bool $fraction = true,
int $decimals = 2 )
protected

Format a number to a localised percentage with specified decimal points.

Parameters
float$numberThe number being formatted
bool$fractionAn indicator for whether the number is a fraction or is already multiplied by 100
int$decimalsSets the number of decimal points
Return values
string

◆ format_percentage_range()

quiz_statistics_table::format_percentage_range ( ?float $min = null,
?float $max = null,
bool $fraction = true,
int $decimals = 2 )
protected

Format $min and $max to localised percentages and form a string that represents a range between them.

This function does not check if $min is less than $max or not. If both $min and $max are equal to null, this function returns an empty string.

Parameters
float | null$minThe minimum value of the range
float | null$maxThe maximum value of the range
bool$fractionAn indicator for whether min and max are a fractions or are already multiplied by 100
int$decimalsSets the number of decimal points
Return values
stringA formatted string that represents a range between $min to $max.

◆ format_range()

quiz_statistics_table::format_range ( ?string $min = null,
?string $max = null )
protected

Format inputs to represent a range between $min and $max.

This function does not check if $min is less than $max or not. If both $min and $max are equal to null, this function returns an empty string.

Parameters
string | null$minThe minimum value in the range
string | null$maxThe maximum value in the range
Return values
string

◆ is_calculated_question_summary()

quiz_statistics_table::is_calculated_question_summary ( $questionstat)
protected

Check if the given stats object is an instance of calculated_question_summary.

Parameters
core_question\statistics\questions\calculated$questionstatStats object
Return values
bool

◆ is_dubious_question()

quiz_statistics_table::is_dubious_question ( $questionstat)
protected

This method encapsulates the test for wheter a question should be considered dubious.

Parameters
core_question\statistics\questions\calculated$questionstatstats for the question.
Return values
boolis this question possibly not pulling it's weight?

◆ statistics_setup()

quiz_statistics_table::statistics_setup ( $quiz,
$cmid,
$reporturl,
$s )

Set up the columns and headers and other properties of the table and then call flexible_table::setup() method.

Parameters
stdClass$quizthe quiz settings
int$cmidthe quiz course_module id
moodle_url$reporturlthe URL to redisplay this report.
int$snumber of attempts included in the statistics.

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