Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Class: questionattempt_with_steps_test  - X-Ref

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

Action methods like start, process_action and finish are assumed to be
tested by walkthrough tests in the various behaviours.

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.