Details

    • Testing Instructions:
      Hide

      Run the unit tests at grade/tests/externallib_test.php.

      A manual test can also be run if preferrred:

      1. Create a new assignment in a course.
      2. Enrol a teacher and students into the course
      3. Login as the teacher
        1. Define a marking guide with two criteria in Assignment administration -> Advanced grading and make it ready for use
        2. Select view/grade all submissions
        3. Select a student and grade them by giving them scores for the two criteria defined in the marking guide
      4. Find the marking guide record in the GRADING_DEFINITIONS database table and note the id

      Following the instructions within Moodle, create a REST web service and add the function core_grading_get_gradingform_instances.
      Give the teacher the capabilities as described in the Web Services Overview -> Users as clients with token.

      Login as the teacher and create/obtain their security key

      Use the Moodle local Web service template plugin to call the web service function. The client.php file should be as shown below:

      client.php
      $token = 'f4458487f63c0558484f4505d61f1245'; // the teachers security key
      $domainname = 'http://localhost/moodledev'; // the Moodle server
      $functionname = 'core_grading_get_gradingform_instances'; // the web service function we are testing
      $params = array('definitionid'=>3); // the parameters (assuming a definition id of 3)
      // The REST web service call  
      header('Content-Type: text/plain');
      $serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token. '&wsfunction='.$functionname;
      require_once('./curl.php');
      $curl = new curl;
      $resp = $curl->post($serverurl, $params);
      print_r($resp);
      

      Verify the results by checking that both criteria are returned with the correct scores.

      Show
      Run the unit tests at grade/tests/externallib_test.php. A manual test can also be run if preferrred: Create a new assignment in a course. Enrol a teacher and students into the course Login as the teacher Define a marking guide with two criteria in Assignment administration -> Advanced grading and make it ready for use Select view/grade all submissions Select a student and grade them by giving them scores for the two criteria defined in the marking guide Find the marking guide record in the GRADING_DEFINITIONS database table and note the id Following the instructions within Moodle, create a REST web service and add the function core_grading_get_gradingform_instances. Give the teacher the capabilities as described in the Web Services Overview -> Users as clients with token. Login as the teacher and create/obtain their security key Use the Moodle local Web service template plugin to call the web service function. The client.php file should be as shown below: client.php $token = 'f4458487f63c0558484f4505d61f1245'; // the teachers security key $domainname = 'http: //localhost/moodledev'; // the Moodle server $functionname = 'core_grading_get_gradingform_instances'; // the web service function we are testing $params = array('definitionid'=>3); // the parameters (assuming a definition id of 3) // The REST web service call header('Content-Type: text/plain'); $serverurl = $domainname . '/webservice/ rest /server.php'. '?wstoken=' . $token. '&wsfunction='.$functionname; require_once('./curl.php'); $curl = new curl; $resp = $curl->post($serverurl, $params); print_r($resp); Verify the results by checking that both criteria are returned with the correct scores.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
    • Rank:
      38536

      Description

      Returns grading form instances data from the grading_instances and gradingform_XXX_fillings tables.

      Parameters:
      definition id
      array of itemids (optional)
      modified_since (optional)
      Returns:
      array of grading form instance data

        Issue Links

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: