Moodle
  1. Moodle
  2. MDL-40547

Update mod_assign_get_assignments with marking allocation and workflow fields

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.6
    • Fix Version/s: 2.6
    • Component/s: Assignment, Web Services
    • Labels:
    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:

      Description

      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.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Michael de Raadt added a comment -

            Thanks for adding this issue.

            Feel free to work on it.

            Show
            Michael de Raadt added a comment - Thanks for adding this issue. Feel free to work on it.
            Hide
            Paul Charsley added a comment -

            Submitted for peer review.

            Show
            Paul Charsley added a comment - Submitted for peer review.
            Hide
            Paul Charsley added a comment -

            Rebased with the latest weekly release. Ready for peer review.

            Show
            Paul Charsley added a comment - Rebased with the latest weekly release. Ready for peer review.
            Hide
            Damyon Wiese added a comment -

            Looks good Paul, sending for integration.

            Thanks!

            Show
            Damyon Wiese added a comment - Looks good Paul, sending for integration. Thanks!
            Hide
            Paul Charsley added a comment -

            Rebased with the latest weekly release.

            Show
            Paul Charsley added a comment - Rebased with the latest weekly release.
            Hide
            Dan Poltawski added a comment -

            Hi Guys,

            This looks OK, just wondering if there are more specific testing instructions we could use to ensure that the marker allocation info is returned correctly (I mean the unit tests were passing before and there are no new tests added, so it doesn't necessarily verify this fix).

            thanks

            Show
            Dan Poltawski added a comment - Hi Guys, This looks OK, just wondering if there are more specific testing instructions we could use to ensure that the marker allocation info is returned correctly (I mean the unit tests were passing before and there are no new tests added, so it doesn't necessarily verify this fix). thanks
            Hide
            Dan Poltawski added a comment -

            I've integrated this to master in confidence that more detailed testing instrucitons will be provided

            Show
            Dan Poltawski added a comment - I've integrated this to master in confidence that more detailed testing instrucitons will be provided
            Hide
            Paul Charsley added a comment -

            Hi Dan, I've updated the unit tests with additional assertions and also added some manual test instructions.

            Show
            Paul Charsley added a comment - Hi Dan, I've updated the unit tests with additional assertions and also added some manual test instructions.
            Hide
            Dan Poltawski added a comment -

            Thanks

            Show
            Dan Poltawski added a comment - Thanks
            Hide
            Dan Poltawski added a comment -

            Oh sorry. To integrate the unit test improvements, i'll need that as a seperate commit, as i've already integrated 912cbaf16d18809b95eed6acfdea3b3e868cd421

            Show
            Dan Poltawski added a comment - Oh sorry. To integrate the unit test improvements, i'll need that as a seperate commit, as i've already integrated 912cbaf16d18809b95eed6acfdea3b3e868cd421
            Hide
            Paul Charsley added a comment -

            Hi Dan, I'm not sure how to do that since the change was merged and forced into the one commit? Any ideas?
            Paul

            Show
            Paul Charsley added a comment - Hi Dan, I'm not sure how to do that since the change was merged and forced into the one commit? Any ideas? Paul
            Hide
            Dan Poltawski added a comment -

            Hi Paul,

            There are a few different ways to do it. In principle you'll need to reset your commit and then you can add a commit on top. e.g. git reset --mixed HEAD^. You could probably also get your previous commit from the git reflog.

            I will probably be able to have a bit of time to extract it later.

            Show
            Dan Poltawski added a comment - Hi Paul, There are a few different ways to do it. In principle you'll need to reset your commit and then you can add a commit on top. e.g. git reset --mixed HEAD^. You could probably also get your previous commit from the git reflog. I will probably be able to have a bit of time to extract it later.
            Hide
            Dan Poltawski added a comment -

            Hi Paul,

            I've done this now: https://github.com/danpoltawski/moodle/commit/b4683a27a324c4902cbdaa1f02470fa546843981

            I'm just running the tests and will get Damyon to give it a once over once i've done it.

            FYI, this is how I got your changes:

            git checkout MDL-40547
            git fetch integration
            git diff 912cbaf16d18809b95eed6acfdea3b3e868cd421 > /tmp/MDL-40547-tests.patch
            git apply < /tmp/MDL-40547-tests.patch
            git commit -a --author="Paul Charsley <p.charsley@massey.ac.nz>"
            

            Show
            Dan Poltawski added a comment - Hi Paul, I've done this now: https://github.com/danpoltawski/moodle/commit/b4683a27a324c4902cbdaa1f02470fa546843981 I'm just running the tests and will get Damyon to give it a once over once i've done it. FYI, this is how I got your changes: git checkout MDL-40547 git fetch integration git diff 912cbaf16d18809b95eed6acfdea3b3e868cd421 > /tmp/MDL-40547-tests.patch git apply < /tmp/MDL-40547-tests.patch git commit -a --author="Paul Charsley <p.charsley@massey.ac.nz>"
            Hide
            Dan Poltawski added a comment -

            And i've integrated that now. Thanks!

            Show
            Dan Poltawski added a comment - And i've integrated that now. Thanks!
            Hide
            Ankit Agarwal added a comment -

            Works as described.
            Thanks

            Show
            Ankit Agarwal added a comment - Works as described. Thanks
            Hide
            Sam Hemelryk added a comment -

            Against all probability we've achieved normality. You changes didn't break the tests I pretended to run and are now immortalised upstream. Good for you!

            "It was a programming technique that had been reverse-engineered from the sort of psychotic mental blocks that otherwise perfectly normal people had been observed invariably to develop when elected to high political office."
            Adams, D (1992) Mostly Harmless. London: William Heinemann.

            Show
            Sam Hemelryk added a comment - Against all probability we've achieved normality. You changes didn't break the tests I pretended to run and are now immortalised upstream. Good for you! "It was a programming technique that had been reverse-engineered from the sort of psychotic mental blocks that otherwise perfectly normal people had been observed invariably to develop when elected to high political office." Adams, D (1992) Mostly Harmless. London: William Heinemann.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: