Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]
(no description)
File Size: | 179 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
statistics_bulk_loader:: (4 methods):
load_aggregate_statistics()
get_all_places_where_questions_were_attempted()
load_statistics_for_place()
extract_item_value()
Class: statistics_bulk_loader - X-Ref
Helper to efficiently load all the statistics for a set of questions.load_aggregate_statistics(array $questionids, array $requiredstatistics) X-Ref |
Load and aggregate the requested statistics for all the places where the given questions are used. The returned array will contain a values for each questionid and field, which will be null if the value is not available. return: float[][] if a value is not available, it will be set to null. param: int[] $questionids array of question ids. param: string[] $requiredstatistics array of the fields required, e.g. ['facility', 'discriminationindex']. |
get_all_places_where_questions_were_attempted(array $questionids) X-Ref |
For a list of questions find all the places, defined by (component, contextid), where there are attempts. return: \stdClass[] list of objects with fields ->component and ->contextid. param: int[] $questionids array of question ids that we are interested in. |
load_statistics_for_place(string $component,\context $context) X-Ref |
Load the question statistics for all the attempts belonging to a particular component in a particular context. return: all_calculated_for_qubaid_condition|null question statistics. param: string $component frankenstyle component name, e.g. 'mod_quiz'. param: \context $context the context to load the statistics for. |
extract_item_value(all_calculated_for_qubaid_condition $statistics,int $questionid, string $item) X-Ref |
Extract the value for one question and one type of statistic from a set of statistics. return: float|null the required value. param: all_calculated_for_qubaid_condition $statistics the batch of statistics. param: int $questionid a question id. param: string $item one of the field names in all_calculated_for_qubaid_condition, e.g. 'facility'. |