ims-lti 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 30c0efa0ce7f96bcb4ef189cfd60206dada68fa6
4
- data.tar.gz: 1a788b9cef77da96a66b68426fb8ca3c5bbc29f8
3
+ metadata.gz: 34b3da04f7e5e1c7941d6893214771331318d9a3
4
+ data.tar.gz: ce52c75bb0fe4b2fb50d4ddedb21cbe6e94e12d7
5
5
  SHA512:
6
- metadata.gz: fe08421395b4c2de12200c3e981ea0e62a5dac27d6c505360605693b2da7fb7e1a64f48b665136edb1aaec0e1ee31f14c0ce35ac42ad9c3b71d1ed3f88782c6f
7
- data.tar.gz: b795c096542903e7306631f97c4d441316db70e13edbec0413c9f3b3d2d8334db8e0bbb6d13488525aae62be65550ed41276e3ba5019fe24e2a3f01d4ac44e0c
6
+ metadata.gz: 9f8b44578db4a9c163145e3079be90dc653bd66f3da21cce0ecc2d095ec2e29f60ee6af4875879a9ce72119a9e88ae19e1580f9279964f635412e25c5e1d8ceb
7
+ data.tar.gz: 33a78df08798018b999b0093ccea8dfa39e517db8a25da45256fe016f9197d6dc0d0eaffdc74ebb7e6326cf45e5d00e4e34f9e157d4f79d8302addac65b2e5a6
data/Changelog CHANGED
@@ -1,3 +1,7 @@
1
+ 2015-02-20 Version 1.1.8
2
+ * Replace usage of the 'uuid' gem with SecureRandom
3
+ * Update the outcome extension doc example
4
+
1
5
  2015-01-09 Version 1.1.7
2
6
  * Add support for new outcome extension resultTotalScore
3
7
 
data/README.md CHANGED
@@ -26,6 +26,10 @@ proxy for your application. For example:
26
26
 
27
27
  For further information see the [oauth-ruby](https://github.com/oauth-xx/oauth-ruby) project.
28
28
 
29
+ As a quick debugging note, if you forget that step, you'll get an error like:
30
+
31
+ OAuth::RequestProxy::UnknownRequestType
32
+
29
33
  ## Usage
30
34
  This readme won't cover the LTI standard, just how to use the library. It will be
31
35
  very helpful to read the [LTI documentation](http://www.imsglobal.org/lti/index.html)
@@ -1,7 +1,6 @@
1
1
  require 'oauth'
2
2
  require 'builder'
3
3
  require "rexml/document"
4
- require 'uuid'
5
4
  require 'cgi'
6
5
 
7
6
  module IMS # :nodoc:
@@ -48,7 +47,7 @@ module IMS # :nodoc:
48
47
 
49
48
  # Generates a unique identifier
50
49
  def self.generate_identifier
51
- UUID.new
50
+ SecureRandom.uuid
52
51
  end
53
52
  end
54
53
  end
@@ -17,7 +17,7 @@ module IMS::LTI
17
17
  # # post the score to the TC, score should be a float >= 0.0 and <= 1.0
18
18
  # # this returns an OutcomeResponse object
19
19
  # if provider.accepts_outcome_text?
20
- # response = provider.post_replace_result_with_data!(score, "text" => "submission text")
20
+ # response = provider.post_extended_replace_result!(score: score, text: "submission text")
21
21
  # else
22
22
  # response = provider.post_replace_result!(score)
23
23
  # end
@@ -83,14 +83,8 @@ module IMS::LTI
83
83
  # @return [OutcomeResponse] the response from the Tool Consumer
84
84
  # @deprecated Use #post_extended_replace_result! instead
85
85
  def post_replace_result_with_data!(score = nil, data={})
86
- req = new_request
87
- if data["cdata_text"]
88
- req.outcome_cdata_text = data["cdata_text"]
89
- elsif data["text"]
90
- req.outcome_text = data["text"]
91
- end
92
- req.outcome_url = data["url"] if data["url"]
93
- req.post_replace_result!(score)
86
+ data[:score] = score if score
87
+ post_extended_replace_result!(data)
94
88
  end
95
89
 
96
90
  # POSTs the given score to the Tool Consumer with a replaceResult and
@@ -0,0 +1,10 @@
1
+ class ServiceDefinition
2
+ attr_reader :name, :formats, :paramater_variables
3
+
4
+ def initialize(name, formats, parameter_variables = [])
5
+ @name = name
6
+ @formats = formats
7
+ @parameter_variables = parameter_variables
8
+ end
9
+
10
+ end
@@ -0,0 +1,30 @@
1
+ class ServiceLookup
2
+
3
+ TOOL_SETTING_SERVICE = ServiceDefinition.new(
4
+ 'ToolSettingsContainer Service',
5
+ %w(application/vnd.ims.lti.v2.toolsettings+json application/vnd.ims.lti.v2.toolsettings.simple+json),
6
+ %w(LtiLink.custom.url ToolProxyBinding.custom.url ToolProxy.custom.url)
7
+ )
8
+
9
+ TOOL_CONSUMER_PROFILE_SERVICE = ServiceDefinition.new(
10
+ 'ToolConsumerProfile Service',
11
+ %w(application/vnd.ims.lti.v2.toolconsumerprofile+json),
12
+ []
13
+ )
14
+
15
+ TOOL_PROXY_SERVICE = ServiceDefinition.new(
16
+ 'ToolProxy Service',
17
+ %w(application/vnd.ims.lti.v2.toolproxy+json),
18
+ []
19
+ )
20
+
21
+ def self.services
22
+ [TOOL_SETTING_SERVICE, TOOL_CONSUMER_PROFILE_SERVICE, TOOL_PROXY_SERVICE]
23
+ end
24
+
25
+ def self.lookup(format)
26
+ services.select { |service| service.formats.include? format }
27
+ end
28
+
29
+
30
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ims-lti
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.4.5
41
- - !ruby/object:Gem::Dependency
42
- name: uuid
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: rspec
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,6 +86,8 @@ files:
100
86
  - lib/ims/lti/outcome_request.rb
101
87
  - lib/ims/lti/outcome_response.rb
102
88
  - lib/ims/lti/request_validator.rb
89
+ - lib/ims/lti/services/service_definition.rb
90
+ - lib/ims/lti/services/service_lookup.rb
103
91
  - lib/ims/lti/tool_base.rb
104
92
  - lib/ims/lti/tool_config.rb
105
93
  - lib/ims/lti/tool_consumer.rb