Moodle
  1. Moodle
  2. MDL-38301

Assign date validation should use >=

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.4, 2.4.1
    • Fix Version/s: FRONTEND
    • Component/s: Assignment
    • Labels:
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Rank:
      48165

      Description

      I was looking at the code for validating dates for the new assignment.

      if ($data['allowsubmissionsfromdate'] && $data['duedate']) {
          if ($data['allowsubmissionsfromdate'] > $data['duedate']) {
              $errors['duedate'] = get_string('duedatevalidation', 'assign');
          }
      }
      if ($data['duedate'] && $data['cutoffdate']) {
          if ($data['duedate'] > $data['cutoffdate']) {
              $errors['cutoffdate'] = get_string('cutoffdatevalidation', 'assign');
          }
      }
      if ($data['allowsubmissionsfromdate'] && $data['cutoffdate']) {
          if ($data['allowsubmissionsfromdate'] > $data['cutoffdate']) {
              $errors['cutoffdate'] = get_string('cutoffdatefromdatevalidation', 'assign');
          }
      }
      

      Considering the ranges tested, I was wondering if the first and last tests should allow the submissionfrom and compared dates (duedate and cutoffdate) to be equal. I suggest that these two comparisons should use >= to prevent the case where the dates are equal to allow students to have time to submit. The validation strings support this assumption. I can't think of a contradictory case (perhaps an offline assignment).

      (Damyon: Sounds correct to me - but the upgrade code will need to do something sensible for assignments with these dates already set to == - and if this is valid for offline assignments that will need special handling)

        Activity

        Hide
        Jayesh Anandani added a comment -

        yeah the instructions look right!Should be modified with >= sign!

        Show
        Jayesh Anandani added a comment - yeah the instructions look right!Should be modified with >= sign!
        Hide
        Damyon Wiese added a comment -

        This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue.

        For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

        Show
        Damyon Wiese added a comment - This issue was assigned to me automatically, however I will not be able to work on this issue in the immediate future. In order to create a truer sense of the state of this issue and to allow other developers to have chance to become involved, I am removing myself as the assignee of this issue. For more information, see http://docs.moodle.org/dev/Changes_to_issue_assignment

          People

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

            Dates

            • Created:
              Updated: