Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 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 310 and 311] [Versions 310 and 400] [Versions 310 and 401] [Versions 310 and 402] [Versions 310 and 403] [Versions 39 and 310]

Quiz attempt walk through using data from csv file. The quiz stats below and the question stats found in qstats00.csv were calculated independently in a spreadsheet which is available in open document or excel format here : https://github.com/jamiepratt/moodle-quiz-tools/tree/master/statsspreadsheet

Author: Jamie Pratt <me@jamiep.org>
Copyright: 2013 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 393 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: quiz_report_statistics_from_steps_testcase  - X-Ref

Quiz attempt walk through using data from csv file.

get_full_path_of_csv_file($setname, $test)   X-Ref


test_walkthrough_from_csv($quizsettings, $csvdata)   X-Ref
Create a quiz add questions to it, walk through quiz attempts and then check results.

param: array $csvdata data read from csv file "questionsXX.csv", "stepsXX.csv" and "resultsXX.csv".

check_question_stats($qstats, $questionstats)   X-Ref
Check actual question stats are the same as that found in csv file.

param: $qstats         array data from csv file.
param: $questionstats  \core_question\statistics\questions\all_calculated_for_qubaid_condition Calculated stats.

assert_stat_equals($expected, $questionstats, $slot, $subqname, $variant, $statname)   X-Ref
Check that the stat is as expected within a reasonable tolerance.

param: float|string|bool $expected expected value of stat.
param: \core_question\statistics\questions\all_calculated_for_qubaid_condition $questionstats
param: int $slot
param: string $subqname if empty string then not an item stat.
param: int|string $variant if empty string then not a variantstat.
param: string $statname

assert_response_count_equals($question, $qubaids, $expected, $whichtries)   X-Ref
No description

get_response_subpart_and_class_id($question, $subpart, $modelresponse)   X-Ref
No description

check_response_counts($responsecounts, $qubaids, $questions, $whichtries)   X-Ref

param: $responsecounts
param: $qubaids
param: $questions
param: $whichtries

check_variants_count_for_quiz_00($questions, $questionstats, $whichtries, $qubaids)   X-Ref

param: $questions
param: $questionstats
param: $whichtries
param: $qubaids

check_quiz_stats_for_quiz_00($quizstats)   X-Ref

param: $quizstats

check_stats_calculations_and_response_analysis($csvdata, $whichattempts, $whichtries,\core\dml\sql_join $groupstudentsjoins)   X-Ref
Check the question stats and the response counts used in the statistics report. If the appropriate files exist in fixtures/.

param: array $csvdata Data loaded from csv files for this test.
param: string $whichattempts
param: string $whichtries
param: \core\dml\sql_join $groupstudentsjoins
return: array with contents 0 => $questions, 1 => $quizstats, 2=> $questionstats, 3=> $qubaids Might be needed for further