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: events_test  - 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.