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

New Web Service mod_workshop_get_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
      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 sstudent).
      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, assessmentid with one of the assessment ids done by the students and the URL of your moodle instance

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

      1. Now check that you receive the information of the assessments correctly.
      2. Now, replace the wstoken with the student1 and execute the curl request, do the same using the student2 wstoken
      3. In both cases you will get a nopermissions error (you can't see the assessments until the workshop is closed/finished)
      4. As teacher, finish/close the workshop (you will have to grade the assessments, etc...)
      5. And now, if you replace the wstoken with the one from the user who did the submission (the submission where the assessment passed as parameter was done) you should be able to view the assessment because the workshop is finished. Note that the reviewerid field will be set to 0 because students by default can't see the name of the reviewers
      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 sstudent). 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, assessmentid with one of the assessment ids done by the students and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'assessmentid=8&wsfunction=mod_workshop_get_assessment&wstoken=12a2a65aeea2a177055e233f9e303218&moodlewssettingfilter=true' | python -m "json.tool" Now check that you receive the information of the assessments correctly. Now, replace the wstoken with the student1 and execute the curl request, do the same using the student2 wstoken In both cases you will get a nopermissions error (you can't see the assessments until the workshop is closed/finished) As teacher, finish/close the workshop (you will have to grade the assessments, etc...) And now, if you replace the wstoken with the one from the user who did the submission (the submission where the assessment passed as parameter was done) you should be able to view the assessment because the workshop is finished. Note that the reviewerid field will be set to 0 because students by default can't see the name of the reviewers
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59247-master

      Description

      To retrieve an assessment by id

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                jleyva Juan Leyva
                Peer reviewer:
                Pau Ferrer
                Integrator:
                Eloy Lafuente (stronk7)
                Tester:
                Adrian Greeve
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

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