• MOODLE_22_STABLE, MOODLE_26_STABLE
    • MOODLE_27_STABLE
    • MDL-30085_grade_ws
    • Hide

      run phpunit core_grades_external_testcase lib/tests/grades_externallib_test.php

      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/9687810
      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 Grade the submission as the teacher
      4 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)
      5 Open the script in a browser
      6 The script gets the current grade, then update the grade (using the update_grade) function to a random (0, 100) them, retrieve again the grade to check if it were successfully updated
      7 You can change the userid to a different id that the current user to test if you got permission errors, you should change alto the activityid to an existing activity, you should get errors also

      Show
      run phpunit core_grades_external_testcase lib/tests/grades_externallib_test.php 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/9687810 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 Grade the submission as the teacher 4 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) 5 Open the script in a browser 6 The script gets the current grade, then update the grade (using the update_grade) function to a random (0, 100) them, retrieve again the grade to check if it were successfully updated 7 You can change the userid to a different id that the current user to test if you got permission errors, you should change alto the activityid to an existing activity, you should get errors also

          jleyva Juan Leyva
          jerome Jérôme Mouneyrac
          Jérôme Mouneyrac Jérôme Mouneyrac
          Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
          Jason Fowler Jason Fowler
          Votes:
          7 Vote for this issue
          Watchers:
          16 Start watching this issue

            Created:
            Updated:
            Resolved:

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