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