moodle_rb 1.0.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/build.yml +36 -0
  3. data/.github/workflows/publish.yml +27 -0
  4. data/Dockerfile +10 -0
  5. data/README.md +73 -1
  6. data/docker-compose.yml +6 -0
  7. data/lib/moodle_rb/categories.rb +12 -11
  8. data/lib/moodle_rb/client.rb +10 -8
  9. data/lib/moodle_rb/courses.rb +59 -13
  10. data/lib/moodle_rb/enrolments.rb +34 -9
  11. data/lib/moodle_rb/grades.rb +9 -14
  12. data/lib/moodle_rb/users.rb +35 -19
  13. data/lib/moodle_rb/utility.rb +7 -0
  14. data/lib/moodle_rb/version.rb +1 -1
  15. data/lib/moodle_rb.rb +2 -2
  16. data/moodle_rb.gemspec +2 -3
  17. data/spec/cassettes/MoodleRb_Categories/_create/.yml +19 -19
  18. data/spec/cassettes/MoodleRb_Categories/_create/when_validation_fails/.yml +19 -19
  19. data/spec/cassettes/MoodleRb_Categories/_destroy/when_using_invalid_token/.yml +39 -0
  20. data/spec/cassettes/MoodleRb_Categories/_destroy/when_using_valid_token/.yml +76 -0
  21. data/spec/cassettes/MoodleRb_Categories/_index/.yml +19 -19
  22. data/spec/cassettes/MoodleRb_Categories/_index/when_using_invalid_token/.yml +39 -0
  23. data/spec/cassettes/MoodleRb_Categories/_show/when_using_invalid_token/.yml +39 -0
  24. data/spec/cassettes/MoodleRb_Client/_site_info/when_invalid_token/.yml +20 -20
  25. data/spec/cassettes/MoodleRb_Client/_site_info/when_valid_token/.yml +19 -19
  26. data/spec/cassettes/MoodleRb_Courses/_contents/when_using_invalid_token/.yml +52 -0
  27. data/spec/cassettes/MoodleRb_Courses/_contents/when_using_valid_token/.yml +52 -0
  28. data/spec/cassettes/MoodleRb_Courses/_create/.yml +19 -19
  29. data/spec/cassettes/MoodleRb_Courses/_create/when_validation_fails/.yml +36 -36
  30. data/spec/cassettes/MoodleRb_Courses/_destroy/when_using_invalid_token/.yml +39 -0
  31. data/spec/cassettes/MoodleRb_Courses/_destroy/when_using_valid_token/.yml +75 -0
  32. data/spec/cassettes/MoodleRb_Courses/_destroy/when_using_valid_token/when_using_invalid_course_id/.yml +39 -0
  33. data/spec/cassettes/MoodleRb_Courses/_enrolled_users/when_using_invalid_token/.yml +39 -0
  34. data/spec/cassettes/MoodleRb_Courses/_enrolled_users/when_using_valid_token/.yml +75 -0
  35. data/spec/cassettes/MoodleRb_Courses/_grade_items/when_using_invalid_token/.yml +52 -0
  36. data/spec/cassettes/MoodleRb_Courses/_grade_items/when_using_valid_token/.yml +56 -0
  37. data/spec/cassettes/MoodleRb_Courses/_index/.yml +19 -19
  38. data/spec/cassettes/MoodleRb_Courses/_index/when_using_invalid_token/.yml +39 -0
  39. data/spec/cassettes/MoodleRb_Courses/_module/when_using_invalid_token/.yml +52 -0
  40. data/spec/cassettes/MoodleRb_Courses/_module/when_using_valid_token/.yml +51 -0
  41. data/spec/cassettes/MoodleRb_Courses/_show/.yml +19 -19
  42. data/spec/cassettes/MoodleRb_Courses/_show/when_using_invalid_token/.yml +39 -0
  43. data/spec/cassettes/MoodleRb_Enrolments/_create/.yml +19 -19
  44. data/spec/cassettes/MoodleRb_Enrolments/_create/when_user_or_course_id_is_invalid/.yml +19 -19
  45. data/spec/cassettes/MoodleRb_Enrolments/_destroy/.yml +51 -0
  46. data/spec/cassettes/MoodleRb_Enrolments/_destroy/when_user_or_course_id_is_invalid/.yml +52 -0
  47. data/spec/cassettes/MoodleRb_Grades/_by_assignment/.yml +19 -19
  48. data/spec/cassettes/MoodleRb_Grades/_by_course/.yml +19 -19
  49. data/spec/cassettes/MoodleRb_Grades/_by_course/when_invalid_parameters/.yml +19 -19
  50. data/spec/cassettes/MoodleRb_Users/_create/.yml +19 -19
  51. data/spec/cassettes/MoodleRb_Users/_create/when_missing_required_parameters/.yml +19 -19
  52. data/spec/cassettes/MoodleRb_Users/_destroy/.yml +19 -19
  53. data/spec/cassettes/MoodleRb_Users/_destroy/when_id_does_not_exist/.yml +19 -19
  54. data/spec/cassettes/MoodleRb_Users/_destroy/when_using_invalid_token/.yml +39 -0
  55. data/spec/cassettes/MoodleRb_Users/_enrolled_courses/.yml +19 -19
  56. data/spec/cassettes/MoodleRb_Users/_enrolled_courses/when_using_invalid_token/.yml +39 -0
  57. data/spec/cassettes/MoodleRb_Users/_search/.yml +21 -21
  58. data/spec/cassettes/MoodleRb_Users/_search/when_using_invalid_token/.yml +39 -0
  59. data/spec/cassettes/MoodleRb_Users/_search_identity/.yml +51 -0
  60. data/spec/cassettes/MoodleRb_Users/_search_identity/when_using_invalid_token/.yml +52 -0
  61. data/spec/cassettes/MoodleRb_Users/_show/.yml +19 -19
  62. data/spec/cassettes/MoodleRb_Users/_show/when_using_invalid_token/.yml +39 -0
  63. data/spec/cassettes/MoodleRb_Users/_update/.yml +20 -20
  64. data/spec/cassettes/MoodleRb_Users/_update/when_using_invalid_token/.yml +39 -0
  65. data/spec/lib/moodle_rb/categories_spec.rb +42 -10
  66. data/spec/lib/moodle_rb/client_spec.rb +7 -5
  67. data/spec/lib/moodle_rb/courses_spec.rb +155 -20
  68. data/spec/lib/moodle_rb/enrolments_spec.rb +36 -3
  69. data/spec/lib/moodle_rb/grades_spec.rb +4 -4
  70. data/spec/lib/moodle_rb/users_spec.rb +93 -9
  71. data/spec/lib/moodle_rb_spec.rb +2 -2
  72. metadata +150 -142
  73. data/spec/cassettes/MoodleRb_Categories/_destroy/.yml +0 -75
  74. data/spec/cassettes/MoodleRb_Courses/_destroy/.yml +0 -75
  75. data/spec/cassettes/MoodleRb_Courses/_enrolled_users/.yml +0 -75
@@ -1,39 +1,39 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: post
5
5
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_create_courses&wstoken=60fc9c9415259404795094957e4ab32f
6
- body:
6
+ body:
7
7
  string: courses[0][categoryid]=1&courses[0][idnumber]=ExtRef&courses[0][fullname]=Test%20Course&courses[0][shortname]=TestC1
8
8
  headers: {}
9
9
 
10
- response:
11
- status:
10
+ response:
11
+ status:
12
12
  code: 200
13
13
  message: OK
14
- headers:
15
- Access-Control-Allow-Origin:
14
+ headers:
15
+ Access-Control-Allow-Origin:
16
16
  - "*"
17
- X-Powered-By:
17
+ X-Powered-By:
18
18
  - PHP/5.6.2
19
- Expires:
19
+ Expires:
20
20
  - Thu, 01 Jan 1970 00:00:00 GMT
21
- Server:
21
+ Server:
22
22
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
23
- Pragma:
23
+ Pragma:
24
24
  - no-cache
25
- Accept-Ranges:
25
+ Accept-Ranges:
26
26
  - none
27
- Content-Type:
27
+ Content-Type:
28
28
  - application/json
29
- Date:
29
+ Date:
30
30
  - Sun, 12 Apr 2015 00:51:46 GMT
31
- Content-Length:
31
+ Content-Length:
32
32
  - "31"
33
- Cache-Control:
33
+ Cache-Control:
34
34
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
35
- body:
35
+ body:
36
36
  string: "[{\"id\":7,\"shortname\":\"TestC1\"}]"
37
- http_version:
37
+ http_version:
38
38
  recorded_at: Sun, 12 Apr 2015 00:51:46 GMT
39
39
  recorded_with: VCR 2.9.3
@@ -1,75 +1,75 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: post
5
5
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_create_courses&wstoken=60fc9c9415259404795094957e4ab32f
6
- body:
6
+ body:
7
7
  string: courses[0][categoryid]=1&courses[0][idnumber]=ExtRef&courses[0][fullname]=Test%20Course&courses[0][shortname]=TestC1
8
8
  headers: {}
9
9
 
10
- response:
11
- status:
10
+ response:
11
+ status:
12
12
  code: 200
13
13
  message: OK
14
- headers:
15
- Cache-Control:
14
+ headers:
15
+ Cache-Control:
16
16
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
17
- Content-Length:
17
+ Content-Length:
18
18
  - "31"
19
- Expires:
19
+ Expires:
20
20
  - Thu, 01 Jan 1970 00:00:00 GMT
21
- Pragma:
21
+ Pragma:
22
22
  - no-cache
23
- Date:
23
+ Date:
24
24
  - Sun, 12 Apr 2015 00:54:55 GMT
25
- X-Powered-By:
25
+ X-Powered-By:
26
26
  - PHP/5.6.2
27
- Accept-Ranges:
27
+ Accept-Ranges:
28
28
  - none
29
- Server:
29
+ Server:
30
30
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
31
- Content-Type:
31
+ Content-Type:
32
32
  - application/json
33
- Access-Control-Allow-Origin:
33
+ Access-Control-Allow-Origin:
34
34
  - "*"
35
- body:
35
+ body:
36
36
  string: "[{\"id\":8,\"shortname\":\"TestC1\"}]"
37
- http_version:
37
+ http_version:
38
38
  recorded_at: Sun, 12 Apr 2015 00:54:55 GMT
39
- - request:
39
+ - request:
40
40
  method: post
41
41
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_create_courses&wstoken=60fc9c9415259404795094957e4ab32f
42
- body:
42
+ body:
43
43
  string: courses[0][categoryid]=1&courses[0][idnumber]=ExtRef&courses[0][fullname]=Test%20Course&courses[0][shortname]=TestC1
44
44
  headers: {}
45
45
 
46
- response:
47
- status:
46
+ response:
47
+ status:
48
48
  code: 200
49
49
  message: OK
50
- headers:
51
- Cache-Control:
50
+ headers:
51
+ Cache-Control:
52
52
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
53
- Content-Length:
53
+ Content-Length:
54
54
  - "128"
55
- Expires:
55
+ Expires:
56
56
  - Thu, 01 Jan 1970 00:00:00 GMT
57
- Pragma:
57
+ Pragma:
58
58
  - no-cache
59
- Date:
59
+ Date:
60
60
  - Sun, 12 Apr 2015 00:54:55 GMT
61
- X-Powered-By:
61
+ X-Powered-By:
62
62
  - PHP/5.6.2
63
- Accept-Ranges:
63
+ Accept-Ranges:
64
64
  - none
65
- Server:
65
+ Server:
66
66
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
67
- Content-Type:
67
+ Content-Type:
68
68
  - application/json
69
- Access-Control-Allow-Origin:
69
+ Access-Control-Allow-Origin:
70
70
  - "*"
71
- body:
71
+ body:
72
72
  string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"shortnametaken\",\"message\":\"Short name is already used for another course (TestC1)\"}"
73
- http_version:
73
+ http_version:
74
74
  recorded_at: Sun, 12 Apr 2015 00:54:55 GMT
75
75
  recorded_with: VCR 2.9.3
@@ -0,0 +1,39 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: post
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_delete_courses&wstoken=
7
+ body:
8
+ string: courseids[0]=2244291800
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Date:
17
+ - Mon, 20 Jun 2016 22:21:27 GMT
18
+ Server:
19
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
20
+ Accept-Ranges:
21
+ - none
22
+ Pragma:
23
+ - no-cache
24
+ Expires:
25
+ - Thu, 01 Jan 1970 00:00:00 GMT
26
+ Cache-Control:
27
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
28
+ Access-Control-Allow-Origin:
29
+ - "*"
30
+ Content-Length:
31
+ - "103"
32
+ X-Powered-By:
33
+ - PHP/5.6.2
34
+ Content-Type:
35
+ - application/json
36
+ body:
37
+ string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"invalidtoken\",\"message\":\"Invalid token - token not found\"}"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:21:27 GMT
@@ -0,0 +1,75 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: post
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_create_courses&wstoken=60fc9c9415259404795094957e4ab32f
7
+ body:
8
+ string: courses[0][fullname]=Test%20Course&courses[0][idnumber]=ExtRef&courses[0][shortname]=TestC1&courses[0][categoryid]=1
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Date:
17
+ - Mon, 20 Jun 2016 22:21:27 GMT
18
+ Server:
19
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
20
+ Accept-Ranges:
21
+ - none
22
+ Pragma:
23
+ - no-cache
24
+ Expires:
25
+ - Thu, 01 Jan 1970 00:00:00 GMT
26
+ Cache-Control:
27
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
28
+ Access-Control-Allow-Origin:
29
+ - "*"
30
+ Content-Length:
31
+ - "32"
32
+ X-Powered-By:
33
+ - PHP/5.6.2
34
+ Content-Type:
35
+ - application/json
36
+ body:
37
+ string: "[{\"id\":15,\"shortname\":\"TestC1\"}]"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:21:27 GMT
40
+ - request:
41
+ method: post
42
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_delete_courses&wstoken=60fc9c9415259404795094957e4ab32f
43
+ body:
44
+ string: courseids[0]=15
45
+ headers: {}
46
+
47
+ response:
48
+ status:
49
+ code: 200
50
+ message: OK
51
+ headers:
52
+ Date:
53
+ - Mon, 20 Jun 2016 22:21:27 GMT
54
+ Server:
55
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
56
+ Accept-Ranges:
57
+ - none
58
+ Pragma:
59
+ - no-cache
60
+ Expires:
61
+ - Thu, 01 Jan 1970 00:00:00 GMT
62
+ Cache-Control:
63
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
64
+ Access-Control-Allow-Origin:
65
+ - "*"
66
+ Content-Length:
67
+ - "15"
68
+ X-Powered-By:
69
+ - PHP/5.6.2
70
+ Content-Type:
71
+ - application/json
72
+ body:
73
+ string: "{\"warnings\":[]}"
74
+ http_version:
75
+ recorded_at: Mon, 20 Jun 2016 22:21:27 GMT
@@ -0,0 +1,39 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: post
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_delete_courses&wstoken=60fc9c9415259404795094957e4ab32f
7
+ body:
8
+ string: courseids[0]=-1
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Date:
17
+ - Mon, 20 Jun 2016 22:21:27 GMT
18
+ Server:
19
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
20
+ Accept-Ranges:
21
+ - none
22
+ Pragma:
23
+ - no-cache
24
+ Expires:
25
+ - Thu, 01 Jan 1970 00:00:00 GMT
26
+ Cache-Control:
27
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
28
+ Access-Control-Allow-Origin:
29
+ - "*"
30
+ Content-Length:
31
+ - "115"
32
+ X-Powered-By:
33
+ - PHP/5.6.2
34
+ Content-Type:
35
+ - application/json
36
+ body:
37
+ string: "{\"warnings\":[{\"item\":\"course\",\"itemid\":-1,\"warningcode\":\"unknowncourseidnumber\",\"message\":\"Unknown course ID -1\"}]}"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:21:27 GMT
@@ -0,0 +1,39 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: post
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_enrol_get_enrolled_users&wstoken=
7
+ body:
8
+ string: courseid=8
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Pragma:
17
+ - no-cache
18
+ Cache-Control:
19
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
20
+ Server:
21
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
22
+ Content-Type:
23
+ - application/json
24
+ Date:
25
+ - Mon, 20 Jun 2016 22:26:04 GMT
26
+ Accept-Ranges:
27
+ - none
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Content-Length:
31
+ - "103"
32
+ Access-Control-Allow-Origin:
33
+ - "*"
34
+ X-Powered-By:
35
+ - PHP/5.6.2
36
+ body:
37
+ string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"invalidtoken\",\"message\":\"Invalid token - token not found\"}"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:26:04 GMT
@@ -0,0 +1,75 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: post
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=enrol_manual_enrol_users&wstoken=60fc9c9415259404795094957e4ab32f
7
+ body:
8
+ string: enrolments[0][userid]=3&enrolments[0][courseid]=8&enrolments[0][roleid]=5
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Content-Type:
17
+ - application/json
18
+ X-Powered-By:
19
+ - PHP/5.6.2
20
+ Pragma:
21
+ - no-cache
22
+ Server:
23
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
24
+ Accept-Ranges:
25
+ - none
26
+ Content-Length:
27
+ - "4"
28
+ Access-Control-Allow-Origin:
29
+ - "*"
30
+ Expires:
31
+ - Thu, 01 Jan 1970 00:00:00 GMT
32
+ Date:
33
+ - Mon, 20 Jun 2016 22:25:42 GMT
34
+ Cache-Control:
35
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
36
+ body:
37
+ string: "null"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:25:42 GMT
40
+ - request:
41
+ method: post
42
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_enrol_get_enrolled_users&wstoken=60fc9c9415259404795094957e4ab32f
43
+ body:
44
+ string: courseid=8
45
+ headers: {}
46
+
47
+ response:
48
+ status:
49
+ code: 200
50
+ message: OK
51
+ headers:
52
+ Content-Type:
53
+ - application/json
54
+ X-Powered-By:
55
+ - PHP/5.6.2
56
+ Pragma:
57
+ - no-cache
58
+ Server:
59
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
60
+ Accept-Ranges:
61
+ - none
62
+ Content-Length:
63
+ - "4162"
64
+ Access-Control-Allow-Origin:
65
+ - "*"
66
+ Expires:
67
+ - Thu, 01 Jan 1970 00:00:00 GMT
68
+ Date:
69
+ - Mon, 20 Jun 2016 22:25:42 GMT
70
+ Cache-Control:
71
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
72
+ body:
73
+ string: "[{\"id\":3,\"firstname\":\"- Test\",\"lastname\":\"-\",\"fullname\":\"- Test -\",\"email\":\"test@localhost\",\"firstaccess\":1405378463,\"lastaccess\":1405379119,\"description\":\"\",\"descriptionformat\":1,\"city\":\"Somewhere\",\"country\":\"AU\",\"profileimageurlsmall\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/15\\/user\\/icon\\/f2\",\"profileimageurl\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/15\\/user\\/icon\\/f1\",\"groups\":[],\"roles\":[{\"roleid\":5,\"name\":\"\",\"shortname\":\"student\",\"sortorder\":0}],\"enrolledcourses\":[{\"id\":8,\"fullname\":\"Manage operational plan (BSBMGT515A)\",\"shortname\":\"BSBMGT515A\"}]},{\"id\":14,\"firstname\":\"Test17\",\"lastname\":\"Moodle\",\"fullname\":\"Test17 Moodle\",\"email\":\"samg17@jobready.com.au\",\"firstaccess\":0,\"lastaccess\":0,\"profileimageurlsmall\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/90\\/user\\/icon\\/f2\",\"profileimageurl\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/90\\/user\\/icon\\/f1\",\"groups\":[],\"roles\":[{\"roleid\":5,\"name\":\"\",\"shortname\":\"student\",\"sortorder\":0}],\"enrolledcourses\":[{\"id\":11,\"fullname\":\"Undertake project work (BSBPMG522A)\",\"shortname\":\"BSBPMG522A\"},{\"id\":10,\"fullname\":\"Ensure team effectiveness (BSBWOR502B)\",\"shortname\":\"BSBWOR502B\"},{\"id\":9,\"fullname\":\"Manage risk (BSBRSK501B)\",\"shortname\":\"BSBRSK501B\"},{\"id\":8,\"fullname\":\"Manage operational plan (BSBMGT515A)\",\"shortname\":\"BSBMGT515A\"},{\"id\":7,\"fullname\":\"Manage people performance (BSBMGT502B)\",\"shortname\":\"BSBMGT502B\"},{\"id\":6,\"fullname\":\"Manage budgets and financial plans (BSBFIM501A)\",\"shortname\":\"BSBFIM501A\"},{\"id\":5,\"fullname\":\"Facilitate continuous improvement (BSBMGT516C)\",\"shortname\":\"BSBMGT516C\"},{\"id\":4,\"fullname\":\"Manage personal work priorities and professional development (BSBWOR501B)\",\"shortname\":\"BSBWOR501B\"}]},{\"id\":15,\"firstname\":\"Test18\",\"lastname\":\"Moodle\",\"fullname\":\"Test18 Moodle\",\"email\":\"samg18@jobready.com.au\",\"firstaccess\":0,\"lastaccess\":0,\"profileimageurlsmall\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/91\\/user\\/icon\\/f2\",\"profileimageurl\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/91\\/user\\/icon\\/f1\",\"groups\":[],\"roles\":[{\"roleid\":5,\"name\":\"\",\"shortname\":\"student\",\"sortorder\":0}],\"enrolledcourses\":[{\"id\":12,\"fullname\":\"CHC43015-Sydney\",\"shortname\":\"CHC43015\"},{\"id\":11,\"fullname\":\"Undertake project work (BSBPMG522A)\",\"shortname\":\"BSBPMG522A\"},{\"id\":10,\"fullname\":\"Ensure team effectiveness (BSBWOR502B)\",\"shortname\":\"BSBWOR502B\"},{\"id\":9,\"fullname\":\"Manage risk (BSBRSK501B)\",\"shortname\":\"BSBRSK501B\"},{\"id\":8,\"fullname\":\"Manage operational plan (BSBMGT515A)\",\"shortname\":\"BSBMGT515A\"},{\"id\":7,\"fullname\":\"Manage people performance (BSBMGT502B)\",\"shortname\":\"BSBMGT502B\"},{\"id\":6,\"fullname\":\"Manage budgets and financial plans (BSBFIM501A)\",\"shortname\":\"BSBFIM501A\"},{\"id\":5,\"fullname\":\"Facilitate continuous improvement (BSBMGT516C)\",\"shortname\":\"BSBMGT516C\"},{\"id\":4,\"fullname\":\"Manage personal work priorities and professional development (BSBWOR501B)\",\"shortname\":\"BSBWOR501B\"}]},{\"id\":16,\"firstname\":\"Test19\",\"lastname\":\"Moodle\",\"fullname\":\"Test19 Moodle\",\"email\":\"samg19@jobready.com.au\",\"firstaccess\":0,\"lastaccess\":0,\"profileimageurlsmall\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/92\\/user\\/icon\\/f2\",\"profileimageurl\":\"http:\\/\\/localhost:8888\\/moodle28\\/pluginfile.php\\/92\\/user\\/icon\\/f1\",\"groups\":[],\"roles\":[{\"roleid\":5,\"name\":\"\",\"shortname\":\"student\",\"sortorder\":0}],\"enrolledcourses\":[{\"id\":12,\"fullname\":\"CHC43015-Sydney\",\"shortname\":\"CHC43015\"},{\"id\":11,\"fullname\":\"Undertake project work (BSBPMG522A)\",\"shortname\":\"BSBPMG522A\"},{\"id\":10,\"fullname\":\"Ensure team effectiveness (BSBWOR502B)\",\"shortname\":\"BSBWOR502B\"},{\"id\":9,\"fullname\":\"Manage risk (BSBRSK501B)\",\"shortname\":\"BSBRSK501B\"},{\"id\":8,\"fullname\":\"Manage operational plan (BSBMGT515A)\",\"shortname\":\"BSBMGT515A\"},{\"id\":7,\"fullname\":\"Manage people performance (BSBMGT502B)\",\"shortname\":\"BSBMGT502B\"},{\"id\":6,\"fullname\":\"Manage budgets and financial plans (BSBFIM501A)\",\"shortname\":\"BSBFIM501A\"},{\"id\":5,\"fullname\":\"Facilitate continuous improvement (BSBMGT516C)\",\"shortname\":\"BSBMGT516C\"},{\"id\":4,\"fullname\":\"Manage personal work priorities and professional development (BSBWOR501B)\",\"shortname\":\"BSBWOR501B\"}]}]"
74
+ http_version:
75
+ recorded_at: Mon, 20 Jun 2016 22:25:42 GMT
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=gradereport_user_get_grade_items&wstoken=
6
+ body:
7
+ encoding: UTF-8
8
+ string: courseid=5&userid=0&groupid=0
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Accept-Ranges:
16
+ - bytes
17
+ - none
18
+ Access-Control-Allow-Origin:
19
+ - "*"
20
+ Age:
21
+ - '0'
22
+ Cache-Control:
23
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
24
+ Content-Type:
25
+ - application/json
26
+ Date:
27
+ - Wed, 12 Jan 2022 00:08:37 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Server:
33
+ - Moodle
34
+ X-Cache:
35
+ - MISS
36
+ X-Clacks-Overhead:
37
+ - GNU Terry Pratchett
38
+ X-Ec2-Instance-Id:
39
+ - i-0afd4744d7a60c5d7
40
+ X-Powered-By:
41
+ - Moodle Ninjas
42
+ Content-Length:
43
+ - '103'
44
+ Connection:
45
+ - keep-alive
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"exception":"moodle_exception","errorcode":"invalidtoken","message":"Invalid
49
+ token - token not found"}'
50
+ http_version:
51
+ recorded_at: Wed, 12 Jan 2022 00:08:03 GMT
52
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,56 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=gradereport_user_get_grade_items&wstoken=60fc9c9415259404795094957e4ab32f
6
+ body:
7
+ encoding: UTF-8
8
+ string: courseid=5&userid=0&groupid=0
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message: OK
14
+ headers:
15
+ Accept-Ranges:
16
+ - bytes
17
+ - none
18
+ Access-Control-Allow-Origin:
19
+ - "*"
20
+ Age:
21
+ - '0'
22
+ Cache-Control:
23
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
24
+ Content-Type:
25
+ - application/json
26
+ Date:
27
+ - Wed, 12 Jan 2022 00:08:37 GMT
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Pragma:
31
+ - no-cache
32
+ Server:
33
+ - Moodle
34
+ X-Cache:
35
+ - MISS
36
+ X-Clacks-Overhead:
37
+ - GNU Terry Pratchett
38
+ X-Ec2-Instance-Id:
39
+ - i-08adafc8cf93e6451
40
+ X-Powered-By:
41
+ - Moodle Ninjas
42
+ Content-Length:
43
+ - '1245'
44
+ Connection:
45
+ - keep-alive
46
+ body:
47
+ encoding: UTF-8
48
+ string: '{"usergrades":[{"courseid":5,"courseidnumber":"1234","userid":4,"userfullname":"API
49
+ User","useridnumber":"","maxdepth":2,"gradeitems":[{"id":7,"itemname":"An
50
+ assignment","itemtype":"mod","itemmodule":"assign","iteminstance":1,"itemnumber":0,"idnumber":"","categoryid":5,"outcomeid":null,"scaleid":null,"locked":false,"cmid":21,"weightraw":1,"weightformatted":"100.00
51
+ %","graderaw":50,"gradedatesubmitted":null,"gradedategraded":1633307813,"gradehiddenbydate":false,"gradeneedsupdate":false,"gradeishidden":false,"gradeislocked":false,"gradeisoverridden":true,"gradeformatted":"50.00","grademin":0,"grademax":100,"rangeformatted":"0–100","percentageformatted":"50.00
52
+ %","feedback":"","feedbackformat":0},{"id":6,"itemname":null,"itemtype":"course","itemmodule":null,"iteminstance":5,"itemnumber":null,"idnumber":null,"categoryid":null,"outcomeid":null,"scaleid":null,"locked":false,"graderaw":60,"gradedatesubmitted":null,"gradedategraded":1633307813,"gradehiddenbydate":false,"gradeneedsupdate":false,"gradeishidden":false,"gradeislocked":false,"gradeisoverridden":true,"gradeformatted":"60.00","grademin":0,"grademax":100,"rangeformatted":"0–100","percentageformatted":"60.00
53
+ %","feedback":null,"feedbackformat":0}]}],"warnings":[]}'
54
+ http_version:
55
+ recorded_at: Wed, 12 Jan 2022 00:08:03 GMT
56
+ recorded_with: VCR 2.9.3
@@ -1,39 +1,39 @@
1
- ---
2
- http_interactions:
3
- - request:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
4
  method: get
5
5
  uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_get_courses&wstoken=60fc9c9415259404795094957e4ab32f
6
- body:
6
+ body:
7
7
  string: ""
8
8
  headers: {}
9
9
 
10
- response:
11
- status:
10
+ response:
11
+ status:
12
12
  code: 200
13
13
  message: OK
14
- headers:
15
- Access-Control-Allow-Origin:
14
+ headers:
15
+ Access-Control-Allow-Origin:
16
16
  - "*"
17
- X-Powered-By:
17
+ X-Powered-By:
18
18
  - PHP/5.6.2
19
- Expires:
19
+ Expires:
20
20
  - Thu, 01 Jan 1970 00:00:00 GMT
21
- Server:
21
+ Server:
22
22
  - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zd DAV/2 mod_perl/2.0.8 Perl/v5.20.0
23
- Pragma:
23
+ Pragma:
24
24
  - no-cache
25
- Accept-Ranges:
25
+ Accept-Ranges:
26
26
  - none
27
- Content-Type:
27
+ Content-Type:
28
28
  - application/json
29
- Date:
29
+ Date:
30
30
  - Sun, 12 Apr 2015 00:51:46 GMT
31
- Content-Length:
31
+ Content-Length:
32
32
  - "1905"
33
- Cache-Control:
33
+ Cache-Control:
34
34
  - private, must-revalidate, pre-check=0, post-check=0, max-age=0
35
- body:
35
+ body:
36
36
  string: "[{\"id\":1,\"shortname\":\"Moodle 2.8\",\"categoryid\":0,\"categorysortorder\":1,\"fullname\":\"Moodle 2.8\",\"idnumber\":\"\",\"summary\":\"<h2 style=\\\"font-size: large;\\\">Moodle<span style=\\\"font-size: 1.8em; color: red;\\\">4<\\/span>Mac<\\/h2>\\r\\n<p>This package for OS&nbsp;X comes with Moodle&nbsp;2.8.5+ and MAMP 3.0.7.3.&nbsp;We hope you will like it!<\\/p>\",\"summaryformat\":1,\"format\":\"site\",\"showgrades\":1,\"newsitems\":3,\"startdate\":0,\"numsections\":1,\"maxbytes\":0,\"showreports\":0,\"visible\":1,\"groupmode\":0,\"groupmodeforce\":0,\"defaultgroupingid\":0,\"timecreated\":1405375287,\"timemodified\":1426316351,\"enablecompletion\":0,\"completionnotify\":0,\"lang\":\"\",\"forcetheme\":\"\",\"courseformatoptions\":[{\"name\":\"numsections\",\"value\":1}]},{\"id\":2,\"shortname\":\"About\",\"categoryid\":1,\"categorysortorder\":10001,\"fullname\":\"About Moodle4Mac\",\"idnumber\":\"\",\"summary\":\"\",\"summaryformat\":1,\"format\":\"topics\",\"showgrades\":1,\"newsitems\":0,\"startdate\":1404165600,\"numsections\":2,\"maxbytes\":10485760,\"showreports\":0,\"visible\":1,\"hiddensections\":1,\"groupmode\":0,\"groupmodeforce\":0,\"defaultgroupingid\":0,\"timecreated\":1251442415,\"timemodified\":1405380585,\"enablecompletion\":0,\"completionnotify\":0,\"lang\":\"\",\"forcetheme\":\"\",\"courseformatoptions\":[{\"name\":\"numsections\",\"value\":2},{\"name\":\"hiddensections\",\"value\":1},{\"name\":\"coursedisplay\",\"value\":0}]},{\"id\":3,\"shortname\":\"Update\",\"categoryid\":1,\"categorysortorder\":10002,\"fullname\":\"How to update\",\"idnumber\":\"\",\"summary\":\"\",\"summaryformat\":1,\"format\":\"topics\",\"showgrades\":1,\"newsitems\":0,\"startdate\":1404165600,\"numsections\":3,\"maxbytes\":10485760,\"showreports\":0,\"visible\":1,\"hiddensections\":0,\"groupmode\":0,\"groupmodeforce\":0,\"defaultgroupingid\":0,\"timecreated\":1251443413,\"timemodified\":1405380563,\"enablecompletion\":0,\"completionnotify\":0,\"lang\":\"\",\"forcetheme\":\"\",\"courseformatoptions\":[{\"name\":\"numsections\",\"value\":3},{\"name\":\"hiddensections\",\"value\":0},{\"name\":\"coursedisplay\",\"value\":0}]}]"
37
- http_version:
37
+ http_version:
38
38
  recorded_at: Sun, 12 Apr 2015 00:51:46 GMT
39
39
  recorded_with: VCR 2.9.3
@@ -0,0 +1,39 @@
1
+ ---
2
+ recorded_with: VCR 2.9.3
3
+ http_interactions:
4
+ - request:
5
+ method: get
6
+ uri: http://localhost:8888/moodle28/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=core_course_get_courses&wstoken=
7
+ body:
8
+ string: ""
9
+ headers: {}
10
+
11
+ response:
12
+ status:
13
+ code: 200
14
+ message: OK
15
+ headers:
16
+ Date:
17
+ - Mon, 20 Jun 2016 22:01:55 GMT
18
+ Content-Length:
19
+ - "103"
20
+ Accept-Ranges:
21
+ - none
22
+ Server:
23
+ - Apache/2.2.29 (Unix) mod_fastcgi/2.4.6 mod_wsgi/3.4 Python/2.7.8 PHP/5.6.2 mod_ssl/2.2.29 OpenSSL/0.9.8zg DAV/2 mod_perl/2.0.8 Perl/v5.20.0
24
+ Pragma:
25
+ - no-cache
26
+ X-Powered-By:
27
+ - PHP/5.6.2
28
+ Cache-Control:
29
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
30
+ Content-Type:
31
+ - application/json
32
+ Access-Control-Allow-Origin:
33
+ - "*"
34
+ Expires:
35
+ - Thu, 01 Jan 1970 00:00:00 GMT
36
+ body:
37
+ string: "{\"exception\":\"moodle_exception\",\"errorcode\":\"invalidtoken\",\"message\":\"Invalid token - token not found\"}"
38
+ http_version:
39
+ recorded_at: Mon, 20 Jun 2016 22:01:55 GMT