Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]
This file contains the code to analyse all the responses to a particular question.
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: | 247 lines (10 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
analysis_for_question:: (12 methods):
__construct()
initialise_stats_for_variant()
get_variant_nos()
get_subpart_ids()
get_analysis_for_subpart()
has_multiple_response_classes()
has_subparts()
has_multiple_tries_data()
get_maximum_tries()
count_response_parts()
cache()
has_actual_responses()
Class: analysis_for_question - X-Ref
Analysis for possible responses for parts of a question. It is up to a question type designer to decide on how many parts their__construct(array $possiblereponses = null) X-Ref |
Constructor method. param: array[] Two index array, first index is unique string for each sub question part, |
initialise_stats_for_variant($variantno) X-Ref |
Initialise data structure for response analysis of one variant. param: int $variantno |
get_variant_nos() X-Ref |
Variant nos found in this question's attempt data. return: int[] |
get_subpart_ids($variantno) X-Ref |
Unique ids for sub parts. return: string[] param: int $variantno |
get_analysis_for_subpart($variantno, $subpartid) X-Ref |
Get the response counts etc. for variant $variantno, question sub part $subpartid. Or if there is no recorded analysis yet then initialise the data structure for that part of the analysis and return the initialised analysis objects. return: analysis_for_subpart param: int $variantno param: string $subpartid id for sub part. |
has_multiple_response_classes() X-Ref |
Used to work out what kind of table is needed to display stats. return: bool whether this question has (a subpart with) more than one response class. |
has_subparts() X-Ref |
Used to work out what kind of table is needed to display stats. return: bool whether this analysis has more than one subpart. |
has_multiple_tries_data() X-Ref |
return: bool Does this response analysis include counts for responses for multiple tries of the question? |
get_maximum_tries() X-Ref |
What is the highest number of tries at this question? return: int always 1 as this class is for analysing only one try. |
count_response_parts($variantno, $responseparts) X-Ref |
Takes an array of {@link \question_classified_response} and adds counts of the responses to the sub parts and classes. param: int $variantno param: \question_classified_response[] $responseparts keys are sub-part id. |
cache($qubaids, $whichtries, $questionid, $calculationtime = null) X-Ref |
Save the analysis to the DB, first cleaning up any old ones. 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|null $calculationtime time when the analysis was done. (Defaults to time()). |
has_actual_responses() X-Ref |
return: bool whether this analysis has a response class with more than one |