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]

This file contains tests for the question_attempt class. Action methods like start, process_action and finish are assumed to be tested by walkthrough tests in the various behaviours.

Copyright: 2009 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 210 lines (8 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 2 files
 question/engine/lib.php
 question/engine/tests/helpers.php

Defines 1 class


Class: question_attempt_with_steps_test  - X-Ref

These tests use a standard fixture of a {@link question_attempt} with three steps.

setUp()   X-Ref
No description

tearDown()   X-Ref
No description

test_get_step_before_start()   X-Ref
No description

test_get_step_at_start()   X-Ref
No description

test_get_step_at_end()   X-Ref
No description

test_get_step_past_end()   X-Ref
No description

test_get_num_steps()   X-Ref
No description

test_get_last_step()   X-Ref
No description

test_get_last_qt_var_there1()   X-Ref
No description

test_get_last_qt_var_there2()   X-Ref
No description

test_get_last_qt_var_missing()   X-Ref
No description

test_get_last_qt_var_missing_default()   X-Ref
No description

test_get_last_behaviour_var_missing()   X-Ref
No description

test_get_last_behaviour_var_there()   X-Ref
No description

test_get_state_gets_state_of_last()   X-Ref
No description

test_get_mark_gets_mark_of_last()   X-Ref
No description

test_get_fraction_gets_fraction_of_last()   X-Ref
No description

test_get_fraction_returns_null_if_none()   X-Ref
No description

test_format_mark()   X-Ref
No description

test_format_max_mark()   X-Ref
No description

test_get_min_fraction()   X-Ref
No description

test_cannot_get_min_fraction_before_start()   X-Ref
No description

test_get_max_fraction()   X-Ref
No description

test_cannot_get_max_fraction_before_start()   X-Ref
No description

validate_manual_mark_cases()   X-Ref
Test cases for {@see test_validate_manual_mark()}.

return: array test cases

test_validate_manual_mark(float $minfraction, float $maxfraction,float $maxmark, ?string $currentmark, string $expectederror)   X-Ref
Test validate_manual_mark.

param: float $minfraction minimum fraction for the question being attempted.
param: float $maxfraction maximum fraction for the question being attempted.
param: float $maxmark marks for the question attempt.
param: string|null $currentmark submitted mark.
param: string $expectederror expected error, if any.