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 +4 -4
- data/Changelog +4 -0
- data/README.md +4 -0
- data/lib/ims/lti.rb +1 -2
- data/lib/ims/lti/extensions/outcome_data.rb +3 -9
- data/lib/ims/lti/services/service_definition.rb +10 -0
- data/lib/ims/lti/services/service_lookup.rb +30 -0
- metadata +3 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34b3da04f7e5e1c7941d6893214771331318d9a3
|
4
|
+
data.tar.gz: ce52c75bb0fe4b2fb50d4ddedb21cbe6e94e12d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f8b44578db4a9c163145e3079be90dc653bd66f3da21cce0ecc2d095ec2e29f60ee6af4875879a9ce72119a9e88ae19e1580f9279964f635412e25c5e1d8ceb
|
7
|
+
data.tar.gz: 33a78df08798018b999b0093ccea8dfa39e517db8a25da45256fe016f9197d6dc0d0eaffdc74ebb7e6326cf45e5d00e4e34f9e157d4f79d8302addac65b2e5a6
|
data/Changelog
CHANGED
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)
|
data/lib/ims/lti.rb
CHANGED
@@ -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
|
-
|
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.
|
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
|
-
|
87
|
-
|
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,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.
|
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
|