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

mod_assign_get_submission_status doesn't take overrides into account

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Integration review in progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.7.1
    • Fix Version/s: None
    • Component/s: Assignment, Web Services
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with a student, the course must have at least one section.
      2. Create an assign with a cut-off date that has already passed.
      3. Create a user override for the student in that assign with a future cut-off date (Gear icon > User overrides).
      4. As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
      5. Create a Token for the student user
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the student user .
        • You need to replace the wstoken, assignid (the assign instance value) and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=1&wsfunction=mod_assign_get_submission_status&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' --compressed

      1. Confirm that
        • The value of lastattempt->canedit is true
      Show
      Create a course with a student, the course must have at least one section. Create an assign with a cut-off date that has already passed. Create a user override for the student in that assign with a future cut-off date (Gear icon > User overrides). As admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a Token for the student user Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student user . You need to replace the wstoken, assignid (the assign instance value) and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assignid=1&wsfunction=mod_assign_get_submission_status&wstoken=a70d553bbaf6d9b260a9e5c701b3c46e' --compressed Confirm that The value of lastattempt->canedit is true
    • Affected Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.6 Branch:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-66113-master

      Description

      The WS mod_assign_get_assignments applies overrides to the returned times: allowsubmissionsfromdate, cutoffdate and duedate. This is done with the function update_effective_access.

      However, the WS mod_assign_get_submission_status doesn't apply the overrides to the assign instance, and so the calculated values canedit and cansubmit are wrong (they use the default times, not the overridden ones).

      How to reproduce:

      1. Create an assign with a cut-off date that has already passed.
      2. Create a user override in that assign with a future cut-off date (Gear icon > User overrides).
      3. Call the WS mod_assign_get_submission_status for the user that you created the override. Check that the value of canedit is false. 

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                dpalou Dani Palou
                Peer reviewer:
                Dani Palou
                Integrator:
                Sara Arjona (@sarjona)
                Participants:
                Component watchers:
                Damyon Wiese, Adrian Greeve, Mihail Geshoski, Peter Dias, Juan Leyva, Jake Dallimore, Jun Pataleta, Ryan Wyllie
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 47 minutes
                  47m