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

Update mod_assign_get_assignments with marking allocation and workflow fields

XMLWordPrintable

    • MOODLE_26_STABLE
    • MOODLE_26_STABLE
    • Hide

      Run assignment unit tests.

      A manual test can also be run if preferrred:

      1. Create a new assignment in a course. Note the id of the course and the assignment.
      2. Enrol a teacher and students into the course
      3. In the assignment "grade" settings, set "Use marking workflow" and "Use marking allocation" to Yes

      Following the instructions within Moodle, create a REST web service and add the function mod_assign_get_assignments. 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 = 'mod_assign_get_assignments'; // the web service function we are testing
      $courseids[] = 2; // the course id
      $params = array('courseids'=>$courseids); // the parameters
      // 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 searching for the assignment id and course id. The values of "markingallocation" and "markingworkflow" must both be 1.

      Show
      Run assignment unit tests. A manual test can also be run if preferrred: Create a new assignment in a course. Note the id of the course and the assignment. Enrol a teacher and students into the course In the assignment "grade" settings, set "Use marking workflow" and "Use marking allocation" to Yes Following the instructions within Moodle, create a REST web service and add the function mod_assign_get_assignments. 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 = 'mod_assign_get_assignments'; // the web service function we are testing $courseids[] = 2; // the course id $params = array('courseids'=>$courseids); // the parameters // 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 searching for the assignment id and course id. The values of "markingallocation" and "markingworkflow" must both be 1.

      Since mod_assign_get_assignments was created, marking allocation and workflow functionality has been introduced. This web service now needs to be updated to include these features.

            pcharsle Paul Charsley
            pcharsle Paul Charsley
            Damyon Wiese Damyon Wiese
            Dan Poltawski Dan Poltawski
            Ankit Agarwal Ankit Agarwal
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.