Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

Unit tests for (some of) /question/engine/statistics.php

Copyright: 2008 Jamie Pratt
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 197 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 3 classes

testable_all_calculated_for_qubaid_condition:: (1 method):
  cache()

testable_question_statistics:: (4 methods):
  set_step_data()
  get_random_guess_score()
  get_latest_steps()
  cache_stats()

quiz_statistics_question_stats_testcase:: (4 methods):
  test_qstats()
  qstats_q_fields()
  get_fields_from_csv()
  get_records_from_csv()


Class: testable_all_calculated_for_qubaid_condition  - X-Ref

cache($qubaids)   X-Ref
Disabling caching in tests so we are always sure to force the calculation of stats right then and there.

param: qubaid_condition $qubaids

Class: testable_question_statistics  - X-Ref

Test helper subclass of question_statistics

set_step_data($states)   X-Ref


get_random_guess_score($questiondata)   X-Ref
No description

get_latest_steps($qubaids)   X-Ref

param: $qubaids qubaid_condition is ignored in this test
return: array with two items

cache_stats($qubaids)   X-Ref
No description

Class: quiz_statistics_question_stats_testcase  - X-Ref

Unit tests for (some of) question_statistics.

test_qstats()   X-Ref
No description

qstats_q_fields($fieldname, $values, $multiplier=1)   X-Ref
No description

get_fields_from_csv($line)   X-Ref
No description

get_records_from_csv($filename)   X-Ref
No description