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

New Web Service mod_workshop_update_assessment

    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 with Grading strategy set to comments
      2. Enrol a couple users as student (student2 and student1) and one user as teacher
      3. Edit the workshop assessment form creating only two evaluable comments
      4. As teacher, move the workshop to the submission phase (doing all the required configuration steps indicated by the activity)
      5. As the two students, do a submission (total of 2 submissions, one per sstudent).
      6. As teacher, move the workshop to the assessment phase, allocating the assessment of the submissions: student2 will assess student1 and vice versa.
      7. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      8. Create a Token in the mobile app service for student1 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 student1 one, assessmentid with the id of the assessment assigned to this user during the allocation (the id from table workshop_assessments where the reviewerid is the student1 id)

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

      1. Now you need to execute following curl request replacing only the values of the element dimensionid_idx* with the values received in the previous curl request for the same elements:

        curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assessmentid=12&wsfunction=mod_workshop_update_assessment&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true&data[0][name]=feedbackauthor&data[0][value]=feedback&data[1][name]=feedbackauthorformat&data[1][value]=0&data[2][name]=nodims&data[2][value]=2&data[3][name]=peercomment_idx_0&data[3][value]=comment1&data[4][name]=peercommentidx_1&data[4][value]=comment2&data[5][name]=dimensionid__idx_0&data[5][value]=TO_REPLACE&data[6][name]=dimensionid__idx_1&data[6][value]=TO_REPLACE&data[7][name]=gradeididx_0&data[7][value]=0&data[8][name]=gradeid_idx_1&data[8][value]=0' | python -m "json.tool"

      1. With this curl request you have created a submission assessment, you can go to the Moodle web interface, access as student1 and check that you see the assessment you created.
      2. You can update the assessment using the same curl request but you need to change the values of gradeid_idx* with the values returned by the mod_workshop_get_assessment_form curl request. (In the response "current" field you will see the values you need to change)
      Show
      Create a course with a workshop with Grading strategy set to comments Enrol a couple users as student (student2 and student1) and one user as teacher Edit the workshop assessment form creating only two evaluable comments 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). As teacher, move the workshop to the assessment phase, allocating the assessment of the submissions: student2 will assess student1 and vice versa. Enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for student1 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 student1 one, assessmentid with the id of the assessment assigned to this user during the allocation (the id from table workshop_assessments where the reviewerid is the student1 id) curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assessmentid=3&wsfunction=mod_workshop_get_assessment_form_definition&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now you need to execute following curl request replacing only the values of the element dimensionid_ idx * with the values received in the previous curl request for the same elements: curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assessmentid=12&wsfunction=mod_workshop_update_assessment&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true&data [0] [name] =feedbackauthor&data [0] [value] =feedback&data [1] [name] =feedbackauthorformat&data [1] [value] =0&data [2] [name] =nodims&data [2] [value] =2&data [3] [name] =peercomment_ idx_0&data [3] [value] =comment1&data [4] [name] =peercomment idx_1&data [4] [value] =comment2&data [5] [name] =dimensionid __ idx_0&data [5] [value] =TO_REPLACE&data [6] [name] =dimensionid __ idx_1&data [6] [value] =TO_REPLACE&data [7] [name] =gradeid idx_0&data [7] [value] =0&data [8] [name] =gradeid _idx_1&data [8] [value] =0' | python -m "json.tool" With this curl request you have created a submission assessment, you can go to the Moodle web interface, access as student1 and check that you see the assessment you created. You can update the assessment using the same curl request but you need to change the values of gradeid_ idx * with the values returned by the mod_workshop_get_assessment_form curl request. (In the response "current" field you will see the values you need to change)
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59250-master

      Description

      To update an existing assessment

        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