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

core_completion_get_activities_completion_status is missing the new overrideby field

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      Setup
      1. Login as admin
      2. Create 2 user accounts: 1 for a teacher and 1 for a student. You may use existing accounts.
      3. Navigate to "Site administration / Mobile app / Mobile settings" and enable "Enable web services for mobile devices"
      4. Navigate to "Site administration / Plugins / Web services / Manage tokens"
      5. Add a web service token for the student account.
      6. Navigate to "Site administration / Advanced features".
      7. Make sure that "Enable completion tracking" is checked.
      8. Create a course. Make sure to enable completion tracking in the course.
      9. Enrol a teacher and a student in the course. Take note of their ids, respectively.
      10. Login as a teacher and navigate to the course's page.
      11. Click on the cog menu icon and select "Turn editing on"
      12. Create an Assignment activity.
      13. Under the assignment's "Activity completion" section, set "Compeltion tracking to "Students can manually mark the activity as completed".
      14. Click "Save and return to course"
      15. Create a Page resource.
      16. Under the page resource's "Activity completion" section, set "Compeltion tracking to "Students can manually mark the activity as completed".
      17. Click "Save and return to course"
      18. On the course's page, click on the cog menu icon and select "More..."
      19. On the Course administration page, click "Activity completion" under the "Reports" section.
      20. Mark the Assignment activity as completed for the student.
      Test
      1. Open a terminal and do a CURL REST call simulating a WS client with the student user.
        Note: Substitute the proper values for the wstoken, courseid and userid and the URL of your moodle instance in the following CURL command:

        curl 'http://[PATH_TO_YOUR_MOODLE]/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=[COURSE_ID]&userid=[USER_ID]&wsfunction=core_completion_get_activities_completion_status&wstoken=[YOUR_WS_TOKEN]' --compressed | python -m "json.tool"
        

      2. Check the output of the CURL command.
        • Confirm that you can see a list of activities.
        • Confirm that the he activity that the teacher has overridden has an "overrideby" field containing the teacher's user id.
      Show
      Setup Login as admin Create 2 user accounts: 1 for a teacher and 1 for a student. You may use existing accounts. Navigate to " Site administration / Mobile app / Mobile settings " and enable " Enable web services for mobile devices " Navigate to " Site administration / Plugins / Web services / Manage tokens " Add a web service token for the student account. Navigate to " Site administration / Advanced features ". Make sure that " Enable completion tracking " is checked. Create a course. Make sure to enable completion tracking in the course. Enrol a teacher and a student in the course. Take note of their ids, respectively. Login as a teacher and navigate to the course's page. Click on the cog menu icon and select " Turn editing on " Create an Assignment activity. Under the assignment's " Activity completion " section, set " Compeltion tracking to " Students can manually mark the activity as completed ". Click " Save and return to course " Create a Page resource. Under the page resource's " Activity completion " section, set " Compeltion tracking to " Students can manually mark the activity as completed ". Click " Save and return to course " On the course's page, click on the cog menu icon and select " More... " On the Course administration page, click " Activity completion " under the " Reports " section. Mark the Assignment activity as completed for the student. Test Open a terminal and do a CURL REST call simulating a WS client with the student user. Note : Substitute the proper values for the wstoken, courseid and userid and the URL of your moodle instance in the following CURL command: curl 'http://[PATH_TO_YOUR_MOODLE]/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=[COURSE_ID]&userid=[USER_ID]&wsfunction=core_completion_get_activities_completion_status&wstoken=[YOUR_WS_TOKEN]' --compressed | python -m "json.tool" Check the output of the CURL command. Confirm that you can see a list of activities. Confirm that the he activity that the teacher has overridden has an " overrideby " field containing the teacher's user id.
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull Master Branch:
      MDL-60835-master

      Description

      The core_completion_get_activities_completion_status is missing the "overrideby" field in the WS response so we are not able to mark the completion status in red in the mobile app.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pferre22 Pau Ferrer
              Reporter:
              jleyva Juan Leyva
              Peer reviewer:
              Juan Leyva
              Integrator:
              Jake Dallimore
              Tester:
              Rayna Mae Jayco
              Participants:
              Component watchers:
              Sam Marshall, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                15/Jan/18