Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.6.3, 3.7, 3.8
-
MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_36_STABLE, MOODLE_37_STABLE
-
MDL-65555-Master -
Description
DESCRIPTION
A group override is applied to a quiz overriding the default quiz open and close dates. The course is backed up without including groups and then restored into a new course. In the new course the quiz override is restored into the mdl_quiz_overrides table with a groupid of 0. This leads to the create of calendar events in the new course reflecting both the default open and close dates for the quiz but also the open and close dates from the quiz override. These calendar events are also set with groupid of 0 meaning all of these calendar events are visible to all students causing confusion as to the actual dates of availability for the quiz.
STEPS TO REPLICATE
1. Create a new course.
2. Create a group in the course.
3. Create a quiz in the course. Set and open and close date for the quiz.
4. Add a group override to the quiz for the group created in step 2. Set the quiz open and close dates a week later than the quiz defaults.
5. Add the calendar block to the course, if not already available. Observe that events for only the default quiz and open and close dates are display (so long as you are not a member of the group).
6. Observe in the database that there are four calendar events, two for the quiz defaults and two for the group override.
select id, from_unixtime(timestart) timestart, name, courseid, groupid, userid, modulename, instance from mdl_event
where courseid = <enter courseid>
order by instance, groupid, type;
original_course_calendar_events.png
7. Create a backup of the course. Do NOT select "Include groups and groupings" in the backup settings.
8. Go to Site administration > Courses > Restore course. Restore the backup created above into a new course.
9. Immediately after the restore the new course will contain only a single calendar event for the default quiz open time. There will be an instance of the adhoc task \core\task\refresh_mod_calendar_events_task created in mdl_task_adhoc set to run against the new course.
10. Once the adhoc task has run (should run next time admin cron runs) run the query above entering the courseid of the new course. Observe that there are now two quiz open events with different dates both for groupid = 0 and two quiz close events with different dates both for groupid = 0. new_course_calendar_events.png
11. The adhoc task probably not really at fault as this query shows that the restored quiz contains an override for groupid = 0.
select q.name as quiz_name, qo.* from mdl_quiz_overrides qo
inner join mdl_quiz q on q.id = qo.quiz
where q.course = <enter courseid of new course>;
new_course_quiz_overrides.png
12. Navigate to the calendar block in the new course.
OBSERVED BEHAVIOR:
Four calendar events are displayed for the quiz. Two quiz opens events on different dates and two quiz closes events on different dates.
EXPECTED BEHAVIOR:
The calendar displays only two events which match the open and close dates observed in the quiz settings.
REPLICATION LOCATIONS
3.5.3 and 3.6.3
ADDITIONAL INVESTIGATION NOTES
If using the Snap theme which displays the quiz close date course page, the presence of the extra calendar events in the new course could results in the incorrect close date being displayed. The close date associated with the group override in the original course may display rather than the default quiz date.
USER IMPACT
Students are confused about actual dates of availability on quizzes. The extra calendar events cannot be deleted in the user interface.
Attachments
Issue Links
- will help resolve
-
MDL-65885 Remove overrides and deactivate dates/times when a course or an activity is copied
-
- Open
-