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

New Web Service mod_workshop_get_submission

    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 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 sstudent). Add attachments and images in the editor to the submission.
      5. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      6. 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
      7. Next, you can do a CURL REST call simulating a WS client with the student.
        • You need to replace the wstoken with the student one, submissionid with the id the user did and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'submissionid=4&wsfunction=mod_workshop_get_submission&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool"

      8. Now check that you receive the information of the submission you did including the files you attached in both the editor as an attachment.
      9. Replace the submissionid with the id of the other student submission
      10. Execute the curl request and check that you receive a nopermissions exception (you don't have permission to see other user submissions at this point)
      11. Now, replace the wstoken with the teacher one
      12. Execurte the curl request and check that you can see the submission
      13. Switch to the assessment phase (doing the allocation so each student will assess the other one)
      14. Now, in the Moodle web interface log in as one of the sutdents, do the assessment of your allocated submission.
      15. Now, execute again the CURL request using as submissionid the id of the submission that was assessed in the previouos point and as token, the wstoken of the user who did the assessment.
      16. Check that you receive the submission information (you can see the submission because you were allocated to review it).
      Show
      Create a course with a workshop Enrol a couple users as student 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 sstudent). Add attachments and images in the editor to the submission. 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 student one, submissionid with the id the user did and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'submissionid=4&wsfunction=mod_workshop_get_submission&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that you receive the information of the submission you did including the files you attached in both the editor as an attachment. Replace the submissionid with the id of the other student submission Execute the curl request and check that you receive a nopermissions exception (you don't have permission to see other user submissions at this point) Now, replace the wstoken with the teacher one Execurte the curl request and check that you can see the submission Switch to the assessment phase (doing the allocation so each student will assess the other one) Now, in the Moodle web interface log in as one of the sutdents, do the assessment of your allocated submission. Now, execute again the CURL request using as submissionid the id of the submission that was assessed in the previouos point and as token, the wstoken of the user who did the assessment. Check that you receive the submission information (you can see the submission because you were allocated to review it).
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59242-master

      Description

      To retrieve a single submission by id.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

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