[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/question/classes/statistics/questions/ -> all_calculated_for_qubaid_condition.php (summary)

A collection of all the question statistics calculated for an activity instance ie. the stats calculated for slots and sub-questions and variants of those questions.

Author: James Pratt me@jamiep.org
Copyright: 2014 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 429 lines (17 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

all_calculated_for_qubaid_condition:: (19 methods):
  initialise_for_subq()
  initialise_for_slot()
  for_subq()
  get_all_subq_ids()
  get_all_slots()
  for_slot()
  get_cached()
  get_last_calculated_time()
  cache()
  get_sub_questions()
  structure_analysis_for_one_slot()
  any_error_messages()
  too_many_subq_and_or_variant_rows()
  find_min_median_and_max_facility_stats_objects()
  all_variant_stats_for_one_slot()
  all_subq_variants_for_one_slot()
  all_subqs_for_one_slot()
  all_subq_and_variant_stats_for_slot()
  make_new_subq_stat_for()


Class: all_calculated_for_qubaid_condition  - X-Ref

A collection of all the question statistics calculated for an activity instance.

initialise_for_subq($step, $variant = null)   X-Ref
Set up a calculated_for_subquestion instance ready to store a randomly selected question's stats.

param: object     $step
param: int|null   $variant Is this to keep track of a variant's stats? If so what is the variant, if not null.

initialise_for_slot($slot, $question, $variant = null)   X-Ref
Set up a calculated instance ready to store a slot question's stats.

param: int      $slot
param: object   $question
param: int|null $variant Is this to keep track of a variant's stats? If so what is the variant, if not null.

for_subq($questionid, $variant = null)   X-Ref
Reference for a item stats instance for a questionid and optional variant no.

param: int  $questionid The id of the sub question.
param: int|null $variant if not null then we want the object to store a variant of a sub-question's stats.
return: calculated_for_subquestion|null null if the stats object does not yet exist.

get_all_subq_ids()   X-Ref
ids of all randomly selected question for all slots.

return: int[] An array of all sub-question ids.

get_all_slots()   X-Ref
All slots nos that stats have been calculated for.

return: int[] An array of all slot nos.

for_slot($slot, $variant = null)   X-Ref
Get position stats instance for a slot and optional variant no.

param: int  $slot The slot no.
param: null $variant if provided then we want the object which stores a variant of a position's stats.
return: calculated|null An instance of the class storing the calculated position stats.

get_cached($qubaids)   X-Ref
Load cached statistics from the database.

param: \qubaid_condition $qubaids Which question usages to load stats for?

get_last_calculated_time($qubaids)   X-Ref
Find time of non-expired statistics in the database.

param: \qubaid_condition $qubaids Which question usages to look for stats for?
return: int|bool Time of cached record that matches this qubaid_condition or false if non found.

cache($qubaids)   X-Ref
Save stats to db.

param: \qubaid_condition $qubaids Which question usages are we caching the stats of?

get_sub_questions()   X-Ref
Return all sub-questions used.

return: \object[] array of questions.

structure_analysis_for_one_slot($slot, $limitvariants = false)   X-Ref
Return all stats for one slot, stats for the slot itself, and either :
- variants of question
- variants of randomly selected questions
- randomly selected questions

param: int      $slot          the slot no
param: bool|int $limitvariants limit number of variants and sub-questions displayed?
return: calculated|calculated_for_subquestion[] stats to display

any_error_messages()   X-Ref
Call after calculations to output any error messages.

return: string[] Array of strings describing error messages found during stats calculation.

too_many_subq_and_or_variant_rows($rows)   X-Ref
Are there too many rows of sub-questions and / or variant rows.

param: array $rows the rows we intend to add.
return: bool Are there too many?

find_min_median_and_max_facility_stats_objects($questionstats)   X-Ref
From a number of calculated instances find the three instances with min, median and maximum facility index values.

param: calculated[] $questionstats The stats from which to find the ones with minimum, median and maximum facility index.
return: calculated[] 3 stat objects with minimum, median and maximum facility index.

all_variant_stats_for_one_slot($slot)   X-Ref
Return all stats for variants of question in slot $slot.

param: int $slot The slot no.
return: calculated[] The instances storing the calculated stats.

all_subq_variants_for_one_slot($slot)   X-Ref
Return all stats for variants of randomly selected questions for one slot $slot.

param: int $slot The slot no.
return: calculated[] The instances storing the calculated stats.

all_subqs_for_one_slot($slot)   X-Ref
Return all stats for randomly selected questions for one slot $slot.

param: int $slot The slot no.
return: calculated[] The instances storing the calculated stats.

all_subq_and_variant_stats_for_slot($slot, $limited)   X-Ref
Return all variant or 'sub-question' stats one slot, either :
- variants of question
- variants of randomly selected questions
- randomly selected questions

param: int $slot the slot no
param: bool $limited limit number of variants and sub-questions displayed?
return: calculated|calculated_for_subquestion[] stats to display

make_new_subq_stat_for($displaynumber, $slot, $subqid, $variant = null)   X-Ref
We need a new object for display. Sub-question stats can appear more than once in different slots.
So we create a clone of the object and then we can set properties on the object that are per slot.

param: int  $displaynumber                   The display number for this sub question.
param: int  $slot                            The slot number.
param: int  $subqid                          The sub question id.
param: null|int $variant                     The variant no.
return: calculated_for_subquestion           The object for display.



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1