Differences Between: [Versions 310 and 403] [Versions 311 and 403] [Versions 39 and 403]
Question statistics calculations class. Used in the quiz statistics report but also available for use elsewhere.
Author: | Jamie Pratt <me@jamiep.org> |
Copyright: | 2013 Open University |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 304 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
calculated:: (9 methods):
__construct()
random_selector_string()
cache()
populate_from_record()
sort_variants()
get_sub_question_ids()
get_variants()
break_down_by_variant()
clear_variants()
Class: calculated - X-Ref
This class is used to return the stats as calculated by {@link \core_question\statistics\questions\calculator}__construct($question = null, $slot = null, $variant = null) X-Ref |
Set up a calculated instance ready to store a question's (or a variant of a slot's question's) stats for one slot in the quiz. param: null|object $question param: null|int $slot param: null|int $variant |
random_selector_string() X-Ref |
Used to determine which random questions pull sub questions from the same pools. Where pool means category and possibly all the sub categories of that category. return: null|string represents the pool of questions from which this question draws if it is random, or null if not. |
cache($qubaids, $timemodified = null) X-Ref |
Cache calculated stats stored in this object in 'question_statistics' table. param: \qubaid_condition $qubaids param: int|null $timemodified the modified time to store. Defaults to the current time. |
populate_from_record($record) X-Ref |
Load properties of this class from db record. param: object $record Given a record from 'question_statistics' copy stats from record to properties. |
sort_variants() X-Ref |
Sort the variants of this question by variant number. |
get_sub_question_ids() X-Ref |
Get any sub question ids for this question. return: int[] array of sub-question ids or empty array if there are none. |
get_variants() X-Ref |
Array of variants that have appeared in the attempt data for this question. Or an empty array if there is only one variant. return: int[] the variant nos. |
break_down_by_variant() X-Ref |
Do we break down the stats for this question by variant or not? return: bool Do we? |
clear_variants() X-Ref |
Delete the data structure for storing variant stats. |