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.

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

Unit tests for (some of) mod/quiz/locallib.php.

Copyright: 2008 The Open University
License: http://www.gnu.org/copyleft/gpl.html GNU Public License
File Size: 985 lines (44 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: lib_test  - X-Ref


test_quiz_has_grades()   X-Ref
No description

test_quiz_format_grade()   X-Ref
No description

test_quiz_get_grade_format()   X-Ref
No description

test_quiz_format_question_grade()   X-Ref
No description

test_quiz_delete_instance()   X-Ref
Test deleting a quiz instance.


test_quiz_get_user_attempts()   X-Ref
No description

test_quiz_get_group_override_priorities()   X-Ref
Test for quiz_get_group_override_priorities().


test_quiz_core_calendar_provide_event_action_open()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_open_for_user()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_closed()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_closed_for_user()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_open_in_future()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_open_in_future_for_user()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_no_capability()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_no_capability_for_user()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_already_finished()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_already_finished_for_user()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_already_completed()   X-Ref
No description

test_quiz_core_calendar_provide_event_action_already_completed_for_user()   X-Ref
No description

create_action_event($courseid, $instanceid, $eventtype)   X-Ref
Creates an action event.

param: int $courseid
param: int $instanceid The quiz id.
param: string $eventtype The event type. eg. QUIZ_EVENT_TYPE_OPEN.
return: bool|calendar_event

test_mod_quiz_completion_get_active_rule_descriptions()   X-Ref
Test the callback responsible for returning the completion rule descriptions.
This function should work given either an instance of the module (cm_info), such as when checking the active rules,
or if passed a stdClass of similar structure, such as when checking the the default completion settings for a mod type.


test_creation_with_no_calendar_capabilities()   X-Ref
A user who does not have capabilities to add events to the calendar should be able to create a quiz.


mod_quiz_inplace_editable_provider()   X-Ref
Data provider for summarise_response() test cases.

return: array List of data sets (test cases)

test_mod_quiz_inplace_editable(int $slotnumber, string $newvalue)   X-Ref
Test customised and automated question numbering for a given slot number and customised value.

param: int $slotnumber
param: string $newvalue