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

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.6, 3.4.3, 3.5
    • Fix Version/s: 3.4.5, 3.5.2
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      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
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE
    • Pull 3.4 Branch:
    • Pull 3.5 Branch:
    • Pull Master Branch:
      MDL-62761-master

      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

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  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