Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Class: calendar_event_modified_test  - X-Ref

Unit tests for the calendar event modification callbacks used
for dragging and dropping quiz calendar events in the calendar
UI.

create_quiz_instance(array $properties)   X-Ref
Create an instance of the quiz activity.

param: array $properties Properties to set on the activity
return: stdClass Quiz activity instance

create_quiz_calendar_event(\stdClass $quiz, array $eventproperties)   X-Ref
Create a calendar event for a quiz activity instance.

param: \stdClass $quiz The activity instance
param: array $eventproperties Properties to set on the calendar event
return: calendar_event

test_mod_quiz_core_calendar_event_timestart_updated_unknown_event()   X-Ref
An unkown event type should not change the quiz instance.


test_mod_quiz_core_calendar_event_timestart_updated_open_event()   X-Ref
A QUIZ_EVENT_TYPE_OPEN event should update the timeopen property of
the quiz activity.


test_mod_quiz_core_calendar_event_timestart_updated_close_event()   X-Ref
A QUIZ_EVENT_TYPE_CLOSE event should update the timeclose property of
the quiz activity.


test_mod_quiz_core_calendar_event_timestart_updated_open_event_override()   X-Ref
A QUIZ_EVENT_TYPE_OPEN event should not update the timeopen property of
the quiz activity if it's an override.


test_student_role_cant_update_quiz_activity()   X-Ref
If a student somehow finds a way to update the quiz calendar event
then the callback should not update the quiz activity otherwise that
would be a security issue.


test_teacher_role_can_update_quiz_activity()   X-Ref
A teacher with the capability to modify a quiz module should be
able to update the quiz activity dates by changing the calendar
event.


test_mod_quiz_core_calendar_get_valid_event_timestart_range_unknown_event()   X-Ref
An unkown event type should not have any limits


test_mod_quiz_core_calendar_get_valid_event_timestart_range_open_event()   X-Ref
The open event should be limited by the quiz's timeclose property, if it's set.


test_mod_quiz_core_calendar_get_valid_event_timestart_range_override_event()   X-Ref
An override event should not have any limits.


test_mod_quiz_core_calendar_get_valid_event_timestart_range_close_event()   X-Ref
The close event should be limited by the quiz's timeopen property, if it's set.


test_core_calendar_event_timestart_updated_update_quiz_attempt()   X-Ref
When the close date event is changed and it results in the time close value of
the quiz being updated then the open quiz attempts should also be updated.