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.

Quiz events tests.

Copyright: 2013 Adrian Greeve
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 788 lines (32 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: mod_quiz_events_testcase  - X-Ref

Unit tests for quiz events.

prepare_quiz()   X-Ref
Setup a quiz.

return: quiz the generated quiz.

prepare_quiz_attempt($quizobj, $ispreview = false)   X-Ref
Setup a quiz attempt at the quiz created by {@link prepare_quiz()}.

param: quiz $quizobj the generated quiz.
param: bool $ispreview Make the attempt a preview attempt when true.
return: array with three elements, array($quizobj, $quba, $attempt)

prepare_quiz_data($ispreview = false)   X-Ref
Setup some convenience test data with a single attempt.

param: bool $ispreview Make the attempt a preview attempt when true.
return: array with three elements, array($quizobj, $quba, $attempt)

test_attempt_submitted()   X-Ref
No description

test_attempt_becameoverdue()   X-Ref
No description

test_attempt_abandoned()   X-Ref
No description

test_attempt_started()   X-Ref
No description

test_edit_page_viewed()   X-Ref
Test the edit page viewed event.

There is no external API for updating a quiz, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_attempt_deleted()   X-Ref
Test the attempt deleted event.


test_preview_attempt_deleted()   X-Ref
Test that preview attempt deletions are not logged.


test_report_viewed()   X-Ref
Test the report viewed event.

There is no external API for viewing reports, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_attempt_reviewed()   X-Ref
Test the attempt reviewed event.

There is no external API for reviewing attempts, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_attempt_summary_viewed()   X-Ref
Test the attempt summary viewed event.

There is no external API for viewing the attempt summary, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_user_override_created()   X-Ref
Test the user override created event.

There is no external API for creating a user override, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_group_override_created()   X-Ref
Test the group override created event.

There is no external API for creating a group override, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_user_override_updated()   X-Ref
Test the user override updated event.

There is no external API for updating a user override, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_group_override_updated()   X-Ref
Test the group override updated event.

There is no external API for updating a group override, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_user_override_deleted()   X-Ref
Test the user override deleted event.


test_group_override_deleted()   X-Ref
Test the group override deleted event.


test_attempt_viewed()   X-Ref
Test the attempt viewed event.

There is no external API for continuing an attempt, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_attempt_preview_started()   X-Ref
Test the attempt previewed event.


test_question_manually_graded()   X-Ref
Test the question manually graded event.

There is no external API for manually grading a question, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.

test_attempt_regraded()   X-Ref
Test the attempt regraded event.

There is no external API for regrading attempts, so the unit test will simply
create and trigger the event and ensure the event data is returned as expected.