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

New Web Service mod_workshop_get_reviewer_assessments (originally mod_workshop_get_user_assessments)

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: Workshop
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a course with a workshop
      2. Enrol a couple users as student (student2 and student1) and one user as teacher
      3. As teacher, move the workshop to the submission phase (doing all the required configuration steps indicated by the activity)
      4. As the two students, do a submission (total of 2 submissions, one per student).
      5. As teacher, move the workshop to the assessment phase, allocating the assessment of the submissions: student2 will assess student1 and vice versa.
      6. As the students, do your assessments (student2 will assess the submission done by student1 and vice versa)
      7. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      8. Create a Token in the mobile app service for one of the students and the teacher:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      9. Next, you can do a CURL REST call simulating a WS client with the student.
        • You need to replace the wstoken with the teacher one, workshopid with the workshop id and userid with student1 id and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'workshopid=8&userid=136&wsfunction=mod_workshop_get_reviewer_assessments&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      10. Now check that you receive the information of the submission assessments done by student1 (you will see just one assessment).
      11. Now, replace the wstoken with the student1 and execute the curl request, check that you receive correctly the assessments student1 did
      12. Remove the userid field from the curl request, execute it and check that you receive the same response that in the previous step
      13. Now, add again the userid field but with value student2 id
      14. Execute the curl request you should get an exception (missing capability viewallassessments)
      Show
      Create a course with a workshop Enrol a couple users as student (student2 and student1) and one user as teacher As teacher, move the workshop to the submission phase (doing all the required configuration steps indicated by the activity) As the two students, do a submission (total of 2 submissions, one per student). As teacher, move the workshop to the assessment phase, allocating the assessment of the submissions: student2 will assess student1 and vice versa. As the students, do your assessments (student2 will assess the submission done by student1 and vice versa) Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for one of the students and the teacher: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the student. You need to replace the wstoken with the teacher one, workshopid with the workshop id and userid with student1 id and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'workshopid=8&userid=136&wsfunction=mod_workshop_get_reviewer_assessments&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that you receive the information of the submission assessments done by student1 (you will see just one assessment). Now, replace the wstoken with the student1 and execute the curl request, check that you receive correctly the assessments student1 did Remove the userid field from the curl request, execute it and check that you receive the same response that in the previous step Now, add again the userid field but with value student2 id Execute the curl request you should get an exception (missing capability viewallassessments)
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59401-master

      Description

      Return all the assessments assigned or done by the given user.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17