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

mod_assign_get_submission_status doesn't take overrides into account

XMLWordPrintable

    • MOODLE_37_STABLE
    • MOODLE_36_STABLE, MOODLE_37_STABLE
    • MDL-66113-master
    • 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

      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. 

            jleyva Juan Leyva
            dpalou Dani Palou
            Dani Palou Dani Palou
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.