XMLWordPrintable

Details

    • MOODLE_23_STABLE
    • MOODLE_24_STABLE
    • Hide

      Take the PHP-REST demo client: https://github.com/moodlehq/sample-ws-clients/tree/master/PHP-REST (or another one)

      For each test, you will need to change the code between /// PARAMETERs as specified

      Test 1) - With no parameters the Web service returns all assignments for the courses in which the caller is enrolled
      Call the web service without specifying any parameters and with a web service user who is enrolled in one or more courses.
      /// PARAMETERS
      $params = array();
      /// PARAMETERS
      The web services shoudld return all the assignments for all the courses in which the user is enrolled

      Test 2) - Assignments for specified courses are returned
      /// PARAMETERS
      $courseids[] = .....add 1 or more course id integers into the array
      $params = array('courseids'=>$courseids);
      /// PARAMETERS
      The web services shoudld return all the assignments for all the courses in which the user is enrolled AND have been specified

      Test 3) - The user is warned if the parameters contain courses which do not exist or in which the user is not enrolled
      /// PARAMETERS
      $courseids[] = .....add 1 or more course id integers into the array
      $params = array('courseids'=>$courseids);
      /// PARAMETERS
      The web service returns a warning message

      Test 4) - Capabilities are specified to filter the returned courses.
      /// PARAMETERS
      $capabilities[] = ... add 1 or more capabilities, e.g 'moodle/grade:edit'
      $params = array('capabilities'=>$capabilities);
      /// PARAMETERS
      The web service returns assignments in which the user is enrolled AND for which they have the specified capability

      Test 5) - Courses and capabilities are specified
      /// PARAMETERS
      $courseids[] = ... add one or more course id integers
      $capabilities[] = ... add 1 or more capabilities, e.g 'moodle/grade:edit'
      $params = array('capabilities'=>$capabilities, 'courseids'=>$courseids);
      /// PARAMETERS
      The web service returns the courses specified filtered by the specified capabilities

      Show
      Take the PHP-REST demo client: https://github.com/moodlehq/sample-ws-clients/tree/master/PHP-REST (or another one) For each test, you will need to change the code between /// PARAMETERs as specified Test 1) - With no parameters the Web service returns all assignments for the courses in which the caller is enrolled Call the web service without specifying any parameters and with a web service user who is enrolled in one or more courses. /// PARAMETERS $params = array(); /// PARAMETERS The web services shoudld return all the assignments for all the courses in which the user is enrolled Test 2) - Assignments for specified courses are returned /// PARAMETERS $courseids[] = .....add 1 or more course id integers into the array $params = array('courseids'=>$courseids); /// PARAMETERS The web services shoudld return all the assignments for all the courses in which the user is enrolled AND have been specified Test 3) - The user is warned if the parameters contain courses which do not exist or in which the user is not enrolled /// PARAMETERS $courseids[] = .....add 1 or more course id integers into the array $params = array('courseids'=>$courseids); /// PARAMETERS The web service returns a warning message Test 4) - Capabilities are specified to filter the returned courses. /// PARAMETERS $capabilities[] = ... add 1 or more capabilities, e.g 'moodle/grade:edit' $params = array('capabilities'=>$capabilities); /// PARAMETERS The web service returns assignments in which the user is enrolled AND for which they have the specified capability Test 5) - Courses and capabilities are specified /// PARAMETERS $courseids[] = ... add one or more course id integers $capabilities[] = ... add 1 or more capabilities, e.g 'moodle/grade:edit' $params = array('capabilities'=>$capabilities, 'courseids'=>$courseids); /// PARAMETERS The web service returns the courses specified filtered by the specified capabilities

    Description

      Create web service mod_assign_get_course_assignments

      Parameter: Capability
      Returned value: list of courses and assignments that this user has a particular capability in.

      Attachments

        Issue Links

          Activity

            People

              pcharsle Paul Charsley
              pcharsle Paul Charsley
              Damyon Wiese Damyon Wiese
              Sam Hemelryk Sam Hemelryk
              Sam Hemelryk Sam Hemelryk
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie, Juan Leyva, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3/Dec/12