Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.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.