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

Invalid check of grades visibility for missing grades

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Testing:

      Enable Web Services in Advanced features
      Enable Web services for mobile devices in Plugins / WebServices / Services

      Use this client: https://gist.github.com/jleyva/3ccf5a8540b0e2609d29
      The curl.php file is here: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/curl.php

      You need a token related to a service, for get a token you need to create a new service, add a shortname to that service, and add the core_grade_get_grades function to that service

      Create Token:

      1. Click on Site administration ► Plugins ► Web services ► Manage tokens
      2. Click add, select user and service (You should get two tokens, one for student and one for teacher account)

      1 Create a new course, enrol the student and user used before
      2 As teacher, create a new assign (require a only text submission) as a the same student you used for getting the token, submit a text.
      3 Edit the client.php for adding your custom tokens and Moodle URL, also the parameters required (courseid, userids with the student user id, and cmid for the assign module)
      4 Open the client script in a browser
      5 The script returns a JSON object displaying the grade information but the user final grade for the activity is null or "-"
      6 Grade the submission as the teacher
      7 Run the client script in a browser again The script returns a JSON object displaying the grade information including the grade you entered before as teacher

      Show
      Testing: Enable Web Services in Advanced features Enable Web services for mobile devices in Plugins / WebServices / Services Use this client: https://gist.github.com/jleyva/3ccf5a8540b0e2609d29 The curl.php file is here: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/curl.php You need a token related to a service, for get a token you need to create a new service, add a shortname to that service, and add the core_grade_get_grades function to that service Create Token: Click on Site administration ► Plugins ► Web services ► Manage tokens Click add, select user and service (You should get two tokens, one for student and one for teacher account) 1 Create a new course, enrol the student and user used before 2 As teacher, create a new assign (require a only text submission) as a the same student you used for getting the token, submit a text. 3 Edit the client.php for adding your custom tokens and Moodle URL, also the parameters required (courseid, userids with the student user id, and cmid for the assign module) 4 Open the client script in a browser 5 The script returns a JSON object displaying the grade information but the user final grade for the activity is null or "-" 6 Grade the submission as the teacher 7 Run the client script in a browser again The script returns a JSON object displaying the grade information including the grade you entered before as teacher
    • Affected Branches:
      MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      The core_grades_get_grades external function check visibility of missing user grades, this causes errors since it assumes the grade item exists

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jleyva Juan Leyva
                Reporter:
                jleyva Juan Leyva
                Peer reviewer:
                Dan Poltawski
                Integrator:
                Sam Hemelryk
                Tester:
                Jetha Chan
                Participants:
                Component watchers:
                Jake Dallimore, Jun Pataleta, Juan Leyva, Jake Dallimore, Jun Pataleta
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Sep/14