Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-48762

Restrict access to course based on start and end date

XMLWordPrintable

    • MOODLE_28_STABLE, MOODLE_32_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_401_STABLE
    • MOODLE_403_STABLE
    • MDL-48762-master
    • Hide

      Partially covered by PHPUnit tests.

      UI test:

      1. Navigate to admin/tool/task/scheduledtasks.php
      2. Ensure that both \core\task\show_started_courses_task and \core\task\hide_ended_courses_task tasks are disabled
      3. Go to course settings page
      4. Ensure course start date tooltip has this text 

        This setting determines the start of the first week for a course in weekly format. It also determines the earliest date that logs of course activities are available for. If the course is reset and the course start date changed, all dates in the course will be moved in relation to the new start date. 

      1. Ensure course end date tooltip has this text 

        The course end date determines whether a course is listed as past in the course overview. The course end date may also be used by custom reports. Note that users can still enter the course after the end date; in other words the date does not restrict access. 

      1.  Enable both \core\task\show_started_courses_task and \core\task\hide_ended_courses_task tasks
      2. Go to course settings page
      3. Ensure course start date tooltip has this text 

        The date when the course becomes visible to students. Before this date, they will not be able to access the course.
         
        This date also determines the start of the first week for a course in weekly format, and is the start date for logs of course activities. if you reset the course and change this date, all dates in the course will be moved in relation to the new start date.

      1. Ensure course end date tooltip has this text 

        The date when the course becomes hidden for students and they can no longer access it. 

      Show
      Partially covered by PHPUnit tests. UI test: Navigate to admin/tool/task/scheduledtasks.php Ensure that both \core\task\show_started_courses_task and \core\task\hide_ended_courses_task tasks are disabled Go to course settings page Ensure course start date tooltip has this text  This setting determines the start of the first week for a course in weekly format. It also determines the earliest date that logs of course activities are available for . If the course is reset and the course start date changed, all dates in the course will be moved in relation to the new start date. Ensure course end date tooltip has this text  The course end date determines whether a course is listed as past in the course overview. The course end date may also be used by custom reports. Note that users can still enter the course after the end date; in other words the date does not restrict access.  Enable both \core\task\show_started_courses_task and \core\task\hide_ended_courses_task tasks Go to course settings page Ensure course start date tooltip has this text  The date when the course becomes visible to students. Before this date, they will not be able to access the course.   This date also determines the start of the first week for a course in weekly format, and is the start date for logs of course activities. if you reset the course and change this date, all dates in the course will be moved in relation to the new start date. Ensure course end date tooltip has this text  The date when the course becomes hidden for students and they can no longer access it.
    • HQ 2023 Sprint i2.1 Moppies

      When this issue was created, it was not possible to specify a starting/end date in the course settings. 

      When these settings were added, they were only used for calendar purposes (for instance, to display the course in the Past/Present/Future course list). However, this is confusing because some users were expecting this date to affect the course visibility (which is a separate setting).

      This issue adds a couple of scheduled tasks to change the course visibility automatically when the start/end course date matches the current date.

      These tasks will be disabled by default, to keep the current behaviour. Once they are enabled, only courses with start/end dates near the past 24 hours will be checked. The visibility of these courses will only be changed when their start/end dates are higher than the current one, to avoid updating the course visibility early.

      The tasks are based on the code of the https://moodle.org/plugins/local_culcourse_visibility plugin maintained by Amanda Doughty, although the following changes have been applied:

      • Instead of having one single task, it has been split into 2 different tasks (that way, admins will be able to decide which ones they want to enable/disable).
      • A couple of events, course_started and course_ended have been created and are raised when a course visibility is automatically changed.
      • Only courses with start/end dates near the past 24 hours will be checked, but they are only changed if the current date is higher than the one defined in the course settings (the original task was changing any course with the current date, ignoring the hour).
      • A different help message will be displayed for start/end date settings when these tasks are enabled.

            Votes:
            44 Vote for this issue
            Watchers:
            49 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 1 hour, 49 minutes
                2d 1h 49m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.