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

gradereport_user_get_grade_items is not processing correctly empty grades

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a new user
      2. Enrol it as student in an existing course with more than one activity gradabble
      3. Edit one of the activity grades items, and change it to make the grade hidden until a future date (using the Hidden until field)
      4. As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings
      5. Create a Token in the mobile app service for the student user:
        • Click on Site administration ► Plugins ► Web services ► Manage tokens
      6. Next, you can do a CURL REST call simulating a WS client with the user.
        • You need to replace the wstoken, courseid, userid and the URL of your moodle instance

          curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=4&userid=138&wsfunction=gradereport_user_get_grade_items&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool"

      7. Check that you receive the grades correctly, gradegraw will be null for empty grades
      8. As teacher, add some grades in the gradebook to the student
      9. Execute the WS again and check that you receive the grades correctly
      Show
      Create a new user Enrol it as student in an existing course with more than one activity gradabble Edit one of the activity grades items, and change it to make the grade hidden until a future date (using the Hidden until field) As admin, enable "Mobile services": Site administration ► Mobile app ► Mobile settings Create a Token in the mobile app service for the student user: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client with the user. You need to replace the wstoken, courseid, userid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'courseid=4&userid=138&wsfunction=gradereport_user_get_grade_items&wstoken=12a2a65aeea2a177055e233f9e303218' | python -m "json.tool" Check that you receive the grades correctly, gradegraw will be null for empty grades As teacher, add some grades in the gradebook to the student Execute the WS again and check that you receive the grades correctly
    • Affected Branches:
      MOODLE_32_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-57255-master

      Description

      The server returns {"exception":"invalid_response_exception","errorcode":"invalidresponse","message":"Invalid response value detected","debuginfo":"usergrades => Invalid response value detected: gradeitems => Invalid response value detected: graderaw => Invalid response value detected: Invalid external api response: the value is \"\", the server was expecting \"float\" type

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  9/Jan/17