Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403] [Versions 400 and 403] [Versions 401 and 403]

(no description)

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: 176 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

analysis_for_actual_response:: (6 methods):
  __construct()
  increment_count()
  set_count()
  cache()
  data_for_question_response_table()
  get_maximum_tries()


Class: analysis_for_actual_response  - X-Ref

The leafs of the analysis data structure.

- There is a separate data structure for each question or sub question's analysis
{@link \core_question\statistics\responses\analysis_for_question}
or {@link \core_question\statistics\responses\analysis_for_question_all_tries}.
- There are separate analysis for each variant in this top level instance.
- Then there are class instances representing the analysis of each of the sub parts of each variant of the question.
{@link \core_question\statistics\responses\analysis_for_subpart}.
- Then within the sub part analysis there are response class analysis
{@link \core_question\statistics\responses\analysis_for_class}.
- Then within each class analysis there are analysis for each actual response
{@link \core_question\statistics\responses\analysis_for_actual_response}.

__construct($response, $fraction)   X-Ref

param: string $response
param: float  $fraction

increment_count($try = 0)   X-Ref
Used to count the occurrences of response sub parts.

param: int $try the try number, or 0 if only keeping one count, not a count for each try.

set_count($try, $count)   X-Ref
Used to set the count of occurrences of response sub parts, when loading count from cache.

param: int $try the try number, or 0 if only keeping one count, not a count for each try.
param: int $count

cache($qubaids, $whichtries, $questionid, $variantno, $subpartid, $responseclassid, $calculationtime = null)   X-Ref
Cache analysis for class.

param: \qubaid_condition $qubaids    which question usages have been analysed.
param: string            $whichtries which tries have been analysed?
param: int               $questionid which question.
param: int               $variantno  which variant.
param: string            $subpartid which sub part is this actual response in?
param: string            $responseclassid which response class is this actual response in?
param: int|null          $calculationtime time when the analysis was done. (Defaults to time()).

data_for_question_response_table($partid, $modelresponse)   X-Ref
Returns an object with a property for each column of the question response analysis table.

param: string $partid
param: string $modelresponse
return: object

get_maximum_tries()   X-Ref
What is the highest try number that this response has been seen?

return: int try number