moodle-api 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile +4 -0
  6. data/Guardfile +70 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +128 -0
  9. data/Rakefile +5 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +7 -0
  12. data/fixtures/vcr_cassettes/external_service/invalid_service.yml +48 -0
  13. data/fixtures/vcr_cassettes/external_service/token_service.yml +39 -0
  14. data/fixtures/vcr_cassettes/external_service/valid_service.yml +61 -0
  15. data/fixtures/vcr_cassettes/external_service/valid_service_empty_array_response.yml +46 -0
  16. data/fixtures/vcr_cassettes/external_service/valid_service_not_external.yml +59 -0
  17. data/fixtures/vcr_cassettes/external_service/valid_service_with_invalid_token.yml +47 -0
  18. data/fixtures/vcr_cassettes/token_service/error_invalid_service_token_service.yml +39 -0
  19. data/fixtures/vcr_cassettes/token_service/invalid_password_token_service.yml +49 -0
  20. data/fixtures/vcr_cassettes/token_service/invalid_permissions_token_service.yml +49 -0
  21. data/fixtures/vcr_cassettes/token_service/invalid_service_token_service.yml +48 -0
  22. data/fixtures/vcr_cassettes/token_service/invalid_user_token_service.yml +49 -0
  23. data/fixtures/vcr_cassettes/token_service/invalid_username_token_service.yml +49 -0
  24. data/fixtures/vcr_cassettes/token_service/token_service.yml +47 -0
  25. data/lib/moodle.rb +1 -0
  26. data/lib/moodle/api.rb +34 -0
  27. data/lib/moodle/api/client.rb +40 -0
  28. data/lib/moodle/api/configuration.rb +55 -0
  29. data/lib/moodle/api/errors.rb +5 -0
  30. data/lib/moodle/api/request.rb +45 -0
  31. data/lib/moodle/api/token_generator.rb +37 -0
  32. data/lib/moodle/api/version.rb +5 -0
  33. data/moodle-api.gemspec +38 -0
  34. metadata +175 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4f9519237bf033eda8ececd7cee8e59607d175aa
4
+ data.tar.gz: 093320e00f1d0d13ba9942c250965cba429d98a7
5
+ SHA512:
6
+ metadata.gz: 5ee05012161283282b2ab7c726cd17985f5697fc4bcb16933e4dcc73bc47f7f9d72e2308283a1dfd8daa0df5937c62e5e5b013f8ce413b3c12daa81985177e92
7
+ data.tar.gz: 1a57bc71e6ad4d64940d158e7a7197b8f3824d6b8d9ff6a6daf6c781e63340d34f1c3283b28379f10ccd663e3a2fac8dc9f92c9b338e139154790b0b084fd2bb
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1 @@
1
+ 2.2.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in moodle.gemspec
4
+ gemspec
@@ -0,0 +1,70 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.("routing/#{m[1]}_routing"),
51
+ rspec.spec.("controllers/#{m[1]}_controller"),
52
+ rspec.spec.("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Ryan-Neal Mes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,128 @@
1
+ # Moodle
2
+
3
+ A ruby wrapper for the Moodle REST API.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'moodle'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle install
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install moodle
20
+
21
+ ## Usage
22
+
23
+ ### Configuration
24
+
25
+ Different ways to configure gem.
26
+
27
+ ```ruby
28
+ # Pass block to configure
29
+ Moodle::Api.configure do|c|
30
+ c.host = 'http://dev.vle.getsmarter.co.za'
31
+ c.token = '072556801bf07076fff6bff2a463b7c5'
32
+ end
33
+
34
+ # Set configuration values individually
35
+ Moodle::Api.configuration.host = 'http://dev.vle.getsmarter.co.za'
36
+ Moodle::Api.configuration.token = '072556801bf07076fff6bff2a463b7c5'
37
+
38
+ # Pass options hash to configure
39
+ Moodle::Api.configure({host: 'http://dev.vle.getsmarter.co.za',
40
+ token: '072556801bf07076fff6bff2a463b7c5'})
41
+
42
+ ```
43
+ The client can also be instantiated and used.
44
+
45
+ ```ruby
46
+ client = Moodle:Client.new({host: 'http://dev.vle.getsmarter.co.za',
47
+ token: '072556801bf07076fff6bff2a463b7c5'})
48
+ client.make_request(:function_name_here, my_params)
49
+ ```
50
+
51
+ Moodle requires users to expose [web service functions](https://docs.moodle.org/dev/Web_service_API_functions) in order for them to be used. A MoodleError exception will be raised if a function with the incorrect name is called
52
+
53
+ ### Calling a service
54
+
55
+ All web services are available by calling
56
+
57
+ ```ruby
58
+ Moodle::Api.function_name_here(my_parameters)
59
+ ```
60
+
61
+ New functions created in Moodle will automatically be available in the gem.
62
+
63
+ ### Example
64
+
65
+ ```ruby
66
+ Moodle::Api.configure({host: 'http://dev.vle.getsmarter.co.za',
67
+ token: '072556801bf07076fff6bff2a463b7c5'})
68
+
69
+ params = { 'criteria[0][key]' => 'firstname', 'criteria[0][value]' => 'Jon' }
70
+ Moodle::Api.core_user_get_users(params)
71
+ ```
72
+
73
+ ### Authentication
74
+ Moodle uses token authentication, but sometimes you might not have a token. Users are able to generate tokens automatically when calling services using basic authentication.
75
+ ```ruby
76
+ Moodle::Api.configure({host: 'http://dev.vle.getsmarter.co.za',
77
+ service: 'my_external_service', # ensure you include the shortname of the external service
78
+ username: 'jonsnow',
79
+ password: 'defendthewall'})
80
+ params = { 'criteria[0][key]' => 'firstname', 'criteria[0][value]' => 'Jon' }
81
+ Moodle::Api.core_user_get_users(params)
82
+ ```
83
+ The gem will handle generating the token automatically and making the call to `core_user_get_users` with the token. If you want you can also just generate a token using
84
+ ```ruby
85
+ configuration = Moodle::Api::Configuration.new
86
+ configuration.host = 'http://example.com'
87
+ configuration.username = 'jonsnow'
88
+ configuration.password = 'batman'
89
+ configuration.service = 'service'
90
+ configuration
91
+
92
+ # Note you could pass in a struct with these attributes and it should work the same
93
+ Moodle::Api::TokenGenerator.new(configuration).call
94
+ ```
95
+
96
+ ## Documentation
97
+ - Local documentation - http://[my_moodle_instance].com/admin/webservice/documentation.php
98
+ - [Service creation guide](https://docs.moodle.org/20/en/Using_web_services#Creating_a_service)
99
+ - [Token creation](https://docs.moodle.org/24/en/Using_web_services#Create_a_token)
100
+ - [Web Service API function reference](https://docs.moodle.org/dev/Web_service_API_functions)
101
+ - [Testing harness](https://testing.vle.getsmarter.co.za/admin/webservice/testclient.php)
102
+
103
+ ## Development
104
+ A bundle install should get you going. Rspec, guard and vcr are leveraged for testing.
105
+
106
+ Note: regenerating vcr cassettes, some data will change which will break the tests. They are pretty easy to compare and correct with a simple diff. The fields that change are timing fields such as last login date, etc. which are specific to the users system. A todo has been added to make the cassettes easily rerunnable.
107
+
108
+ ## Contributing
109
+
110
+ 1. Fork it ( https://github.com/[my-github-username]/moodle/fork )
111
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
112
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
113
+ 4. Push to the branch (`git push origin my-new-feature`)
114
+ 5. Create a new Pull Request
115
+
116
+ I am always keen to learn so please feel free to create an issue with code reviews, suggestions and possible refactorings.
117
+
118
+ ## TODOS
119
+
120
+ - Add additional protocals
121
+ - Make cassettes easily rerunnable - will require a parser for the response to remove dynamic data or a funky regex in the specs.
122
+ - Setup travis
123
+ - Setup codeclimate
124
+ - Setup codecoverage
125
+
126
+ ## Warning
127
+
128
+ This gem is still under heavy development.
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ task :console do
4
+ exec "pry -r moodle -I ./lib"
5
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "moodle"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://dev.vle.getsmarter.co.za/webservice/rest/server.php?criteria%5B0%5D%5Bkey%5D=firstname&criteria%5B0%5D%5Bvalue%5D=Jon&moodlewsrestformat=json&wsfunction=core_user_get_users_invalid&wstoken=072556801bf07076fff6bff2a463b7c5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Accept:
13
+ - json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Wed, 01 Jul 2015 12:33:57 GMT
21
+ Server:
22
+ - Apache/2.4.9 (Unix) PHP/5.5.14
23
+ X-Powered-By:
24
+ - PHP/5.5.14
25
+ Cache-Control:
26
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
27
+ Expires:
28
+ - Thu, 01 Jan 1970 00:00:00 GMT
29
+ Pragma:
30
+ - no-cache
31
+ Accept-Ranges:
32
+ - none
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Content-Length:
36
+ - '264'
37
+ Content-Type:
38
+ - application/json
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"exception":"dml_missing_record_exception","errorcode":"invalidrecord","message":"Can
42
+ not find data record in database table external_functions.","debuginfo":"SELECT
43
+ * FROM {external_functions} WHERE name = ?\n[array (\n 0 => ''core_user_get_users_invalid'',\n)]"}'
44
+ http_version: '1.1'
45
+ adapter_metadata:
46
+ effective_url: http://dev.vle.getsmarter.co.za/webservice/rest/server.php?criteria%5B0%5D%5Bkey%5D=firstname&criteria%5B0%5D%5Bvalue%5D=Jon&moodlewsrestformat=json&wsfunction=core_user_get_users_invalid&wstoken=072556801bf07076fff6bff2a463b7c5
47
+ recorded_at: Wed, 01 Jul 2015 12:33:57 GMT
48
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,39 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://dev.vle.getsmarter.co.za/login/token.php?username=ryan.mes%40email.co.za&password=mypassword&service=phoenix_integration
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Accept:
13
+ - json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Tue, 07 Jul 2015 08:26:38 GMT
21
+ Server:
22
+ - Apache/2.4.9 (Unix) PHP/5.5.14
23
+ X-Powered-By:
24
+ - PHP/5.5.14
25
+ Content-Length:
26
+ - '332'
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ body:
30
+ encoding: UTF-8
31
+ string: '{"error":"<p>Error: Database connection failed<\/p>\n<p>It is possible
32
+ that the database is overloaded or otherwise not running properly.<\/p>\n<p>The
33
+ site administrator should also check that the database details have been correctly
34
+ specified in config.php<\/p>","stacktrace":null,"debuginfo":null,"errorcode":"dbconnectionfailed"}'
35
+ http_version: '1.1'
36
+ adapter_metadata:
37
+ effective_url: http://dev.vle.getsmarter.co.za/login/token.php?username=ryan.mes%40email.co.za&password=mypassword&service=phoenix_integration
38
+ recorded_at: Tue, 07 Jul 2015 08:26:38 GMT
39
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,61 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://dev.vle.getsmarter.co.za/webservice/rest/server.php?criteria%5B0%5D%5Bkey%5D=firstname&criteria%5B0%5D%5Bvalue%5D=Jon&moodlewsrestformat=json&wsfunction=core_user_get_users&wstoken=072556801bf07076fff6bff2a463b7c5
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Accept:
13
+ - json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Wed, 01 Jul 2015 12:32:32 GMT
21
+ Server:
22
+ - Apache/2.4.9 (Unix) PHP/5.5.14
23
+ X-Powered-By:
24
+ - PHP/5.5.14
25
+ Cache-Control:
26
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
27
+ Expires:
28
+ - Thu, 01 Jan 1970 00:00:00 GMT
29
+ Pragma:
30
+ - no-cache
31
+ Accept-Ranges:
32
+ - none
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Content-Length:
36
+ - '5654'
37
+ Content-Type:
38
+ - application/json
39
+ body:
40
+ encoding: UTF-8
41
+ string: '{"users":[{"id":5329,"username":"ryan.mes@email.co.za","firstname":"Jon","lastname":"Snow","fullname":"Jon
42
+ Snow","email":"ryan.mes@email.co.za","department":"","firstaccess":1385623936,"lastaccess":1435753716,"description":"","descriptionformat":1,"city":"Cape
43
+ Town","profileimageurlsmall":"http:\/\/dev.vle.getsmarter.co.za\/pluginfile.php\/46751\/user\/icon\/f2","profileimageurl":"http:\/\/dev.vle.getsmarter.co.za\/pluginfile.php\/46751\/user\/icon\/f1","customfields":[{"type":"text","value":"GetSmarter","name":"Company","shortname":"company"},{"type":"text","value":"www.getsmarter.co.za","name":"Company
44
+ Website","shortname":"companywebsite"},{"type":"text","value":"Lead Developer","name":"Position","shortname":"position"},{"type":"textarea","value":"<p>I
45
+ am an avid adventure racer!<\/p>","name":"More about me","shortname":"moreaboutme"},{"type":"menu","value":"Short
46
+ Course","name":"Enrolled in ","shortname":"programme"},{"type":"datetime","value":"0","name":"Date
47
+ of birth","shortname":"dateofbirth"},{"type":"text","value":"Jon","name":"Certificate
48
+ First Name","shortname":"certificatefirstname"},{"type":"text","value":"Snow","name":"Certificate
49
+ Last Name","shortname":"certificatelastname"},{"type":"text","value":"8402025278086","name":"Identification
50
+ Number","shortname":"id"},{"type":"text","value":"Kingsbury Court","name":"Address
51
+ Line 1","shortname":"addressline1"},{"type":"text","value":"13 Rouwkoop Rd","name":"Address
52
+ Line 2","shortname":"addressline2"},{"type":"text","value":"Rondebosch","name":"Suburb","shortname":"suburb"},{"type":"text","value":"Cape
53
+ Town","name":"City","shortname":"city"},{"type":"text","value":"7700","name":"Postal
54
+ Code","shortname":"postalcode"},{"type":"text","value":"Western Cape","name":"Province","shortname":"province"},{"type":"text","value":"South
55
+ Africa","name":"Country","shortname":"country"},{"type":"menu","value":"No","name":"Certificate
56
+ names checked","shortname":"certificatenameschecked"}],"preferences":[{"name":"auth_manual_passwordupdatetime","value":"1434626773"},{"name":"block7hidden","value":"0"},{"name":"block9hidden","value":"0"},{"name":"docked_block_instance_7","value":"0"},{"name":"docked_block_instance_9","value":"0"},{"name":"email_bounce_count","value":"0"},{"name":"email_send_count","value":"41"},{"name":"filepicker_recentlicense","value":"allrightsreserved"},{"name":"filepicker_recentrepository","value":"7"},{"name":"htmleditor","value":""},{"name":"login_failed_count_since_success","value":"7"},{"name":"message_beepnewmessage","value":"0"},{"name":"message_blocknoncontacts","value":"0"},{"name":"message_provider_enrol_manual_expiry_notification_loggedin","value":"email"},{"name":"message_provider_enrol_manual_expiry_notification_loggedoff","value":"email"},{"name":"message_provider_enrol_self_expiry_notification_loggedin","value":"email"},{"name":"message_provider_enrol_self_expiry_notification_loggedoff","value":"email"},{"name":"message_provider_mod_assign_assign_notification_loggedin","value":"email"},{"name":"message_provider_mod_assign_assign_notification_loggedoff","value":"email"},{"name":"message_provider_mod_forum_posts_loggedin","value":"email"},{"name":"message_provider_mod_forum_posts_loggedoff","value":"email"},{"name":"message_provider_mod_lesson_graded_essay_loggedin","value":"email"},{"name":"message_provider_mod_lesson_graded_essay_loggedoff","value":"email"},{"name":"message_provider_mod_quiz_attempt_overdue_loggedin","value":"email"},{"name":"message_provider_mod_quiz_attempt_overdue_loggedoff","value":"email"},{"name":"message_provider_mod_quiz_confirmation_loggedin","value":"email"},{"name":"message_provider_mod_quiz_confirmation_loggedoff","value":"email"},{"name":"message_provider_mod_quiz_submission_loggedin","value":"email"},{"name":"message_provider_mod_quiz_submission_loggedoff","value":"email"},{"name":"message_provider_moodle_availableupdate_loggedin","value":"email"},{"name":"message_provider_moodle_availableupdate_loggedoff","value":"email"},{"name":"message_provider_moodle_backup_loggedin","value":"email"},{"name":"message_provider_moodle_backup_loggedoff","value":"email"},{"name":"message_provider_moodle_badgecreatornotice_loggedin","value":"none"},{"name":"message_provider_moodle_badgecreatornotice_loggedoff","value":"email"},{"name":"message_provider_moodle_badgerecipientnotice_loggedin","value":"popup"},{"name":"message_provider_moodle_badgerecipientnotice_loggedoff","value":"popup,email"},{"name":"message_provider_moodle_courserequestapproved_loggedin","value":"email"},{"name":"message_provider_moodle_courserequestapproved_loggedoff","value":"email"},{"name":"message_provider_moodle_courserequested_loggedin","value":"email"},{"name":"message_provider_moodle_courserequested_loggedoff","value":"email"},{"name":"message_provider_moodle_courserequestrejected_loggedin","value":"email"},{"name":"message_provider_moodle_courserequestrejected_loggedoff","value":"email"},{"name":"message_provider_moodle_errors_loggedin","value":"email"},{"name":"message_provider_moodle_errors_loggedoff","value":"email"},{"name":"message_provider_moodle_instantmessage_loggedin","value":"popup"},{"name":"message_provider_moodle_instantmessage_loggedoff","value":"popup,email"},{"name":"message_provider_moodle_notices_loggedin","value":"email"},{"name":"message_provider_moodle_notices_loggedoff","value":"email"},{"name":"userselector_autoselectunique","value":"0"},{"name":"userselector_optionscollapsed","value":"0"},{"name":"userselector_preserveselected","value":"1"},{"name":"userselector_searchanywhere","value":"0"},{"name":"_lastloaded","value":1435753952}]}],"warnings":[]}'
57
+ http_version: '1.1'
58
+ adapter_metadata:
59
+ effective_url: http://dev.vle.getsmarter.co.za/webservice/rest/server.php?criteria%5B0%5D%5Bkey%5D=firstname&criteria%5B0%5D%5Bvalue%5D=Jon&moodlewsrestformat=json&wsfunction=core_user_get_users&wstoken=072556801bf07076fff6bff2a463b7c5
60
+ recorded_at: Wed, 01 Jul 2015 12:32:32 GMT
61
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,46 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://dev.vle.getsmarter.co.za/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=local_getsmarter_get_quiz_grades&wstoken=072556801bf07076fff6bff2a463b7c5&courseid=92
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Typhoeus - https://github.com/typhoeus/typhoeus
12
+ Accept:
13
+ - json
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Thu, 02 Jul 2015 07:10:48 GMT
21
+ Server:
22
+ - Apache/2.4.9 (Unix) PHP/5.5.14
23
+ X-Powered-By:
24
+ - PHP/5.5.14
25
+ Cache-Control:
26
+ - private, must-revalidate, pre-check=0, post-check=0, max-age=0
27
+ Expires:
28
+ - Thu, 01 Jan 1970 00:00:00 GMT
29
+ Pragma:
30
+ - no-cache
31
+ Accept-Ranges:
32
+ - none
33
+ Access-Control-Allow-Origin:
34
+ - "*"
35
+ Content-Length:
36
+ - '2'
37
+ Content-Type:
38
+ - application/json
39
+ body:
40
+ encoding: UTF-8
41
+ string: "[]"
42
+ http_version: '1.1'
43
+ adapter_metadata:
44
+ effective_url: http://dev.vle.getsmarter.co.za/webservice/rest/server.php?moodlewsrestformat=json&wsfunction=local_getsmarter_get_quiz_grades&wstoken=072556801bf07076fff6bff2a463b7c5&courseid=92
45
+ recorded_at: Thu, 02 Jul 2015 07:10:48 GMT
46
+ recorded_with: VCR 2.9.3