Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 402] [Versions 311 and 403]

Common functions for the quiz statistics report.

Author: James Pratt me@jamiep.org
Copyright: 2013 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 102 lines (5 kb)
Included or required:0 times
Referenced: 1 time
Includes or requires: 0 files

Defines 3 functions


Functions that are not part of a class:

quiz_statistics_attempts_sql($quizid, \core\dml\sql_join $groupstudentsjoins,$whichattempts = QUIZ_GRADEAVERAGE, $includeungraded = false)   X-Ref
SQL to fetch relevant 'quiz_attempts' records.

param: int    $quizid        quiz id to get attempts for
param: \core\dml\sql_join $groupstudentsjoins Contains joins, wheres, params, empty if not using groups
param: string $whichattempts which attempts to use, represented internally as one of the constants as used in
param: bool   $includeungraded whether to fetch ungraded attempts too
return: array FROM and WHERE sql fragments and sql params

quiz_statistics_qubaids_condition($quizid, \core\dml\sql_join $groupstudentsjoins,$whichattempts = QUIZ_GRADEAVERAGE, $includeungraded = false)   X-Ref
Return a {@link qubaid_condition} from the values returned by {@link quiz_statistics_attempts_sql}.

param: int     $quizid
param: \core\dml\sql_join $groupstudentsjoins Contains joins, wheres, params
param: string $whichattempts which attempts to use, represented internally as one of the constants as used in
param: bool    $includeungraded
return: \qubaid_join

quiz_statistics_graph_get_new_colour()   X-Ref
This helper function returns a sequence of colours each time it is called.
Used for choosing colours for graph data series.

return: string colour name.