This class can compute, store and cache the analysis of the responses to a particular question.
More...
|
| __construct ($questiondata, $whichtries=question_attempt::LAST_TRY) |
| Create a new instance of this class for holding/computing the statistics for a particular question.
|
|
| calculate ($qubaids, $whichtries=question_attempt::LAST_TRY) |
| Analyse all the response data for all the specified attempts at this question.
|
|
| get_last_analysed_time ($qubaids, $whichtries) |
| Find time of non-expired analysis in the database.
|
|
| has_response_classes () |
| Does the computed analysis's sub parts have classes?
|
|
| has_subparts () |
| Does the computed analysis have sub parts?
|
|
| load_cached ($qubaids, $whichtries) |
| Retrieve the computed response analysis from the question_response_analysis table.
|
|
|
analysis_for_question analysis_for_question_all_tries | $analysis |
|
array | $responseclasses = array() |
| Two index array first index is unique string for each sub question part, the second string index is the 'class' that sub-question part can be classified into.
|
|
int const | MAX_TRY_COUNTED = 5 |
| When analysing responses and breaking down the count of responses per try, how many columns should we break down tries into? This is set to 5 columns, any response in a try more than try 5 will be counted in the fifth column.
|
|
int const | TIME_TO_CACHE = 900 |
| previously, the time after which statistics are automatically recomputed.
|
|
|
bool | $breakdownbyvariant |
| whether to break down response analysis by variant.
|
|
int | $calculationtime |
| used during calculations, so all results are stored with the same timestamp.
|
|
object | $questiondata |
| full question data from db.
|
|
This class can compute, store and cache the analysis of the responses to a particular question.
- Copyright
- 2014 The Open University
- Author
- James Pratt me@ja.nosp@m.miep.nosp@m..org
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
core_question\statistics\responses\analyser::__construct |
( |
| $questiondata, |
|
|
| $whichtries = question_attempt::LAST_TRY ) |
Create a new instance of this class for holding/computing the statistics for a particular question.
- Parameters
-
object | $questiondata | the full question data from the database defining this question. |
string | $whichtries | which tries to analyse. |
◆ calculate()
core_question\statistics\responses\analyser::calculate |
( |
| $qubaids, |
|
|
| $whichtries = question_attempt::LAST_TRY ) |
Analyse all the response data for all the specified attempts at this question.
- Parameters
-
qubaid_condition | $qubaids | which attempts to consider. |
string | $whichtries | which tries to analyse. Will be one of question_attempt\FIRST_TRY, LAST_TRY or ALL_TRIES. |
- Return values
-
◆ get_last_analysed_time()
core_question\statistics\responses\analyser::get_last_analysed_time |
( |
| $qubaids, |
|
|
| $whichtries ) |
Find time of non-expired analysis in the database.
- Parameters
-
qubaid_condition | $qubaids | check for the analysis of which question usages? |
string | $whichtries | check for the analysis of which tries? |
- Return values
-
integer|boolean | Time of cached record that matches this qubaid_condition or false if none found. |
◆ has_response_classes()
core_question\statistics\responses\analyser::has_response_classes |
( |
| ) |
|
Does the computed analysis's sub parts have classes?
- Return values
-
bool | whether this analysis has (a subpart with) more than one response class. |
◆ has_subparts()
core_question\statistics\responses\analyser::has_subparts |
( |
| ) |
|
Does the computed analysis have sub parts?
- Return values
-
bool | whether this analysis has more than one subpart. |
◆ load_cached()
core_question\statistics\responses\analyser::load_cached |
( |
| $qubaids, |
|
|
| $whichtries ) |
Retrieve the computed response analysis from the question_response_analysis table.
- Parameters
-
qubaid_condition | $qubaids | load the analysis of which question usages? |
string | $whichtries | load the analysis of which tries? |
- Return values
-
analysis_for_question|boolean | analysis or false if no cached analysis found. |
◆ $breakdownbyvariant
bool core_question\statistics\responses\analyser::$breakdownbyvariant |
|
protected |
whether to break down response analysis by variant.
This only applies to questions that have variants and is used to suppress the break down of analysis by variant when there are going to be very many variants.
◆ $responseclasses
array core_question\statistics\responses\analyser::$responseclasses = array() |
Two index array first index is unique string for each sub question part, the second string index is the 'class' that sub-question part can be classified into.
This is the return value from question_type::get_possible_responses() see that method for fuller documentation.
◆ TIME_TO_CACHE
int const core_question\statistics\responses\analyser::TIME_TO_CACHE = 900 |
previously, the time after which statistics are automatically recomputed.
- Deprecated
- since Moodle 4.3. Use of pre-computed stats is no longer time-limited.
- Todo
- MDL-78090 Final deprecation in Moodle 4.7
The documentation for this class was generated from the following file:
- question/classes/statistics/responses/analyser.php