Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

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

(no description)

File Size: 390 lines (19 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: stats_from_steps_walkthrough_test  - X-Ref

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

Similarly the question variant's stats in qstats00.csv are calculated in stats_for_variant_1.xls and stats_for_variant_8.xls
The calculations in the spreadsheets are the same as for the other question stats but applied just to the attempts where the
variants appeared.

get_full_path_of_csv_file(string $setname, string $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