Moodle
  1. Moodle
  2. MDL-34377

Assignments overview page shows a unset due date as Epoch and counts draft submissions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.3.2
    • Component/s: Assignment
    • Labels:
    • Testing Instructions:
      Hide

      As a teacher:

      1. In a blank course create a new instance of the assignment module (mod_assign) in Moodle 2.3
      2. Set a name and description, but make sure that the both the allow submissions from and due date fields are not set.
      3. Save that assignment and return to the course.
      4. Add an instance of the "Activities" block to the course
      5. Click on the "Assignments" link in the activities block
      VERIFY: You should see a list of assignments. The newly created assignment should not have a due date.

      Show
      As a teacher: 1. In a blank course create a new instance of the assignment module (mod_assign) in Moodle 2.3 2. Set a name and description, but make sure that the both the allow submissions from and due date fields are not set. 3. Save that assignment and return to the course. 4. Add an instance of the "Activities" block to the course 5. Click on the "Assignments" link in the activities block VERIFY: You should see a list of assignments. The newly created assignment should not have a due date.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
    • Rank:
      42768

      Description

      Assignments that do not have a due date assigned show a due date of Wednesday, 31 December 1969, 7:00 pm

      Steps to reproduce:
      As a teacher:

      1. In a blank course create a new instance of the assignment module (mod_assign) in Moodle 2.3
      2. Set a name and description, but make sure that the both the allow submissions from and due date fields are not set.
      3. Save that assignment and return to the course.
      4. Add an instance of the "Activities" block to the course
      5. Click on the "Assignments" link in the activities block

      Expected result:
      You should see a list of assignments. The newly created assignment should not have a due date.

      Actual result:
      The newly created assignment has a due date of Wednesday, 31 December 1969, 7:00 pm

        Activity

        Hide
        Stephen Bourget added a comment -

        screenshot showing issue

        Show
        Stephen Bourget added a comment - screenshot showing issue
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting that. I was able to reproduce a similar result.

        This can be checked without the Activities block by pointing your browser to SITE/mod/assign/index.php?id=XXX where XXX is the course id.

        The value in the DB when there is no due date is zero 0, which translates to epoch in GMT. You are seeing 1969 and I am seeing 1970 due to our relative GMT offsets (I'm in Perth, Australia at GMT+8).

        I also noticed that the count of submissions is very simple and includes draft submissions.

        I'll attach a quick patch that checks the duedate field and looks for submitted submissions only. Feel free to manipulate this, Damyon.

        Show
        Michael de Raadt added a comment - Thanks for reporting that. I was able to reproduce a similar result. This can be checked without the Activities block by pointing your browser to SITE/mod/assign/index.php?id=XXX where XXX is the course id. The value in the DB when there is no due date is zero 0, which translates to epoch in GMT. You are seeing 1969 and I am seeing 1970 due to our relative GMT offsets (I'm in Perth, Australia at GMT+8). I also noticed that the count of submissions is very simple and includes draft submissions. I'll attach a quick patch that checks the duedate field and looks for submitted submissions only. Feel free to manipulate this, Damyon.
        Hide
        Raymond Antonio added a comment -

        Hi Michael,

        Damyon asked me to review the patch attached and it looks good to me. I just make a slight change to it and it sits on my github repo : MDL-34377

        https://github.com/raymondAntonio/moodle/tree/MDL-34377

        and here is the diff:

        https://github.com/raymondAntonio/moodle/commit/9da954c0b69d702d4f6fc9f831a6194e46879b2f

        Cheers

        Show
        Raymond Antonio added a comment - Hi Michael, Damyon asked me to review the patch attached and it looks good to me. I just make a slight change to it and it sits on my github repo : MDL-34377 https://github.com/raymondAntonio/moodle/tree/MDL-34377 and here is the diff: https://github.com/raymondAntonio/moodle/commit/9da954c0b69d702d4f6fc9f831a6194e46879b2f Cheers
        Hide
        Damyon Wiese added a comment -

        Raymonds change was to put '-' instead of an empty string if there is no due date - looks better in the table.

        Show
        Damyon Wiese added a comment - Raymonds change was to put '-' instead of an empty string if there is no due date - looks better in the table.
        Hide
        Damyon Wiese added a comment -

        This is ready for integration

        Show
        Damyon Wiese added a comment - This is ready for integration
        Hide
        Dan Poltawski added a comment -

        I've integrated this to 23 and master. Thanks.

        I suppose '-' works across languages, and I couldn't see a lang string for that so I suppose that is fine.

        Show
        Dan Poltawski added a comment - I've integrated this to 23 and master. Thanks. I suppose '-' works across languages, and I couldn't see a lang string for that so I suppose that is fine.
        Hide
        Tim Barker added a comment -

        TEsted and it passed, great work!

        Show
        Tim Barker added a comment - TEsted and it passed, great work!
        Hide
        Eloy Lafuente (stronk7) added a comment -

        YEAR!*

        CAF*, TOT!*

        • Your effort amazingly resulted. (unbelievable :-P)
        • Closing as fixed.
        • Tons of thanks.
        Show
        Eloy Lafuente (stronk7) added a comment - YEAR!* CAF*, TOT!* Your effort amazingly resulted. (unbelievable :-P) Closing as fixed. Tons of thanks.

          People

          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: