Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 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 39 and 310] [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 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: 1003 lines (45 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: mod_quiz_lib_testcase  - 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_completion_state()   X-Ref
Test checking the completion state of a quiz.


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.