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

Lesson index page does not take user and group overrides into account when displaying closing dates

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3.6, 3.4.3, 3.5
    • 3.4.5, 3.5.2
    • Lesson
    • MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • MDL-62761-master
    • Hide
      1. Enable the display of Notices by setting Site Administration → Development → Debugging → Debug messages to "DEVELOPER: extra Moodle debug messages for developers"
      2. Import the attached course. Note COURSEID of the imported course.
      3. Add student101 user to the "Lesson override group" group.
      4. Add a group override for the "Lesson override group" for the "Open in the past (01 Jan 2018) deadline in the future (31 dec 2018)" lesson setting the deadline to January 1st 2019.
      5. Add a user override for the "Student 101" user for the "No open date. Deadline in the future (31 Dec 2018)" lesson setting the deadline to January 1st 2019.
      6. Access the Lesson index page(mod/lesson/index.php?id=COURSEID) as student100.
      7. Cross-check it shows 31 Dec 2018 for for the "Open in the past (01 Jan 2018) deadline in the future (31 dec 2018)" lesson
      8. Cross-check it shows 31 Dec 2018 for for the "No open date. Deadline in the future (31 Dec 2018)" lesson
      9. Also verify that the display is correct for all other lessons.
      10. Access the Lesson index page(mod/lesson/index.php?id=COURSEID) as student101.
      11. Verify that the deadline for the "Open in the past (01 Jan 2018) deadline in the future (31 dec 2018)" lesson shows as 01 Jan 2019 and not 31 Dec 2018.
      12. Verify that the deadline for the "No open date. Deadline in the future (31 Dec 2018)" lesson shows as 01 Jan 2019 and not 31 Dec 2018.
      13. Also verify that the display is correct for all other lessons.

      I will create another issue for the ugly red display of overdue lessons and the very bad use of the font tag that is used to do it. Please don't fail this issue for that

      Show
      Enable the display of Notices by setting Site Administration → Development → Debugging → Debug messages to "DEVELOPER: extra Moodle debug messages for developers" Import the attached course. Note COURSEID of the imported course. Add student101 user to the "Lesson override group" group. Add a group override for the "Lesson override group" for the "Open in the past (01 Jan 2018) deadline in the future (31 dec 2018)" lesson setting the deadline to January 1st 2019. Add a user override for the "Student 101" user for the "No open date. Deadline in the future (31 Dec 2018)" lesson setting the deadline to January 1st 2019. Access the Lesson index page(mod/lesson/index.php?id=COURSEID) as student100. Cross-check it shows 31 Dec 2018 for for the "Open in the past (01 Jan 2018) deadline in the future (31 dec 2018)" lesson Cross-check it shows 31 Dec 2018 for for the "No open date. Deadline in the future (31 Dec 2018)" lesson Also verify that the display is correct for all other lessons. Access the Lesson index page(mod/lesson/index.php?id=COURSEID) as student101. Verify that the deadline for the "Open in the past (01 Jan 2018) deadline in the future (31 dec 2018)" lesson shows as 01 Jan 2019 and not 31 Dec 2018. Verify that the deadline for the "No open date. Deadline in the future (31 Dec 2018)" lesson shows as 01 Jan 2019 and not 31 Dec 2018. Also verify that the display is correct for all other lessons. I will create another issue for the ugly red display of overdue lessons and the very bad use of the font tag that is used to do it. Please don't fail this issue for that

    Description

      This is one thing I forgot to do when I introduced user and group overrides into the lesson activity module in -MDL-49642-.

      On the index page the lessons close date is simply taken from $lesson->deadline, which is wrong if there is an user or group override for the user viewing the page.

      I think we could create a lesson_get_user_deadline function similar to quiz_get_user_timeclose and use it here (and maybe other places too).

      Note that the index page could also benefit from a small lifting as some code here seems rather outdated (there is even a font tag that is deprecated in HTML 5 !) but this should certainly be a separate issue.

      Attachments

        Issue Links

          Activity

            People

              jmvedrine Jean-Michel Vedrine
              jmvedrine Jean-Michel Vedrine
              Mihail Geshoski Mihail Geshoski
              David Monllaó David Monllaó
              Anna Carissa Sadia Anna Carissa Sadia
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                10/Sep/18

                Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 30 minutes
                  2h 30m