ims-lti 1.2.6 → 2.0.0.beta.1
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.
- checksums.yaml +5 -5
- data/Changelog.txt +0 -0
- data/LICENSE.txt +22 -0
- data/README.md +15 -103
- data/lib/ims/lti/converters/time_json_converter.rb +13 -0
- data/lib/ims/lti/converters.rb +5 -0
- data/lib/ims/lti/models/base_url_choice.rb +15 -0
- data/lib/ims/lti/models/base_url_selector.rb +5 -0
- data/lib/ims/lti/models/contact.rb +5 -0
- data/lib/ims/lti/models/icon_endpoint.rb +5 -0
- data/lib/ims/lti/models/icon_info.rb +6 -0
- data/lib/ims/lti/models/localized_name.rb +11 -0
- data/lib/ims/lti/models/localized_text.rb +11 -0
- data/lib/ims/lti/models/lti_model.rb +169 -0
- data/lib/ims/lti/models/message_handler.rb +6 -0
- data/lib/ims/lti/models/messages/basic_lti_launch_request.rb +8 -0
- data/lib/ims/lti/models/messages/message.rb +43 -0
- data/lib/ims/lti/models/messages/registration_request.rb +17 -0
- data/lib/ims/lti/models/messages.rb +6 -0
- data/lib/ims/lti/models/parameter.rb +5 -0
- data/lib/ims/lti/models/product_family.rb +8 -0
- data/lib/ims/lti/models/product_info.rb +19 -0
- data/lib/ims/lti/models/product_instance.rb +10 -0
- data/lib/ims/lti/models/resource_handler.rb +18 -0
- data/lib/ims/lti/models/resource_type.rb +6 -0
- data/lib/ims/lti/models/rest_service.rb +14 -0
- data/lib/ims/lti/models/rest_service_profile.rb +7 -0
- data/lib/ims/lti/models/security_contract.rb +9 -0
- data/lib/ims/lti/models/service_owner.rb +8 -0
- data/lib/ims/lti/models/service_provider.rb +11 -0
- data/lib/ims/lti/models/tool_consumer_profile.rb +20 -0
- data/lib/ims/lti/models/tool_profile.rb +22 -0
- data/lib/ims/lti/models/tool_proxy.rb +11 -0
- data/lib/ims/lti/models/vendor.rb +28 -0
- data/lib/ims/lti/models.rb +29 -0
- data/lib/ims/lti/services/message_service.rb +40 -0
- data/lib/ims/lti/services.rb +5 -0
- data/lib/ims/lti/version.rb +5 -0
- data/lib/ims/lti.rb +6 -64
- data/lib/ims.rb +3 -1
- metadata +68 -52
- data/Changelog +0 -54
- data/LICENSE +0 -18
- data/lib/ims/lti/deprecated_role_checks.rb +0 -52
- data/lib/ims/lti/extensions/canvas.rb +0 -122
- data/lib/ims/lti/extensions/content.rb +0 -209
- data/lib/ims/lti/extensions/outcome_data.rb +0 -240
- data/lib/ims/lti/extensions.rb +0 -45
- data/lib/ims/lti/launch_params.rb +0 -166
- data/lib/ims/lti/outcome_request.rb +0 -225
- data/lib/ims/lti/outcome_response.rb +0 -166
- data/lib/ims/lti/request_validator.rb +0 -56
- data/lib/ims/lti/role_checks.rb +0 -101
- data/lib/ims/lti/tool_base.rb +0 -29
- data/lib/ims/lti/tool_config.rb +0 -231
- data/lib/ims/lti/tool_consumer.rb +0 -86
- data/lib/ims/lti/tool_provider.rb +0 -143
@@ -0,0 +1,20 @@
|
|
1
|
+
module IMS::LTI::Models
|
2
|
+
class ToolConsumerProfile < LTIModel
|
3
|
+
|
4
|
+
CONTEXT = "http://purl.imsglobal.org/ctx/lti/v2/ToolConsumerProfile"
|
5
|
+
TYPE = "ToolConsumerProfile"
|
6
|
+
|
7
|
+
add_attributes :lti_version, :guid, :capability_offered
|
8
|
+
add_attribute :id, json_key:'@id'
|
9
|
+
add_attribute :type, json_key:'@type'
|
10
|
+
add_attribute :context, json_key:'@context'
|
11
|
+
add_attribute :product_instance, relation:'IMS::LTI::Models::ProductInstance'
|
12
|
+
add_attribute :service_offered, relation: 'IMS::LTI::Models::RestService'
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
@context = [CONTEXT]
|
16
|
+
@type = TYPE
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module IMS::LTI::Models
|
2
|
+
class ToolProfile < LTIModel
|
3
|
+
add_attributes :lti_version
|
4
|
+
add_attribute :id, json_key: '@id'
|
5
|
+
add_attribute :product_instance, relation:'IMS::LTI::Models::ProductInstance'
|
6
|
+
add_attribute :base_url_choice, relation: 'IMS::LTI::Models::BaseUrlChoice'
|
7
|
+
add_attribute :resource_handler, relation:'IMS::LTI::Models::ResourceHandler'
|
8
|
+
add_attribute :message, relation:'IMS::LTI::Models::MessageHandler'
|
9
|
+
add_attribute :service_offered, relation:'IMS::LTI::Models::RestService'
|
10
|
+
|
11
|
+
|
12
|
+
def base_message_url
|
13
|
+
if base_url_choice
|
14
|
+
choice = base_url_choice.find { |choice| choice.default_message_url != '' }
|
15
|
+
choice.default_message_url
|
16
|
+
else
|
17
|
+
''
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module IMS::LTI::Models
|
2
|
+
class ToolProxy < LTIModel
|
3
|
+
add_attributes :lti_version, :tool_proxy_guid, :custom, :custom_url, :enabled_capability
|
4
|
+
add_attribute :context, json_key:'@context'
|
5
|
+
add_attribute :type, json_key:'@type'
|
6
|
+
add_attribute :id, json_key:'@id'
|
7
|
+
add_attribute :tool_consumer_profile
|
8
|
+
add_attribute :tool_profile, relation:'IMS::LTI::Models::ToolProfile'
|
9
|
+
add_attribute :security_contract, relation:'IMS::LTI::Models::SecurityContract'
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module IMS::LTI::Models
|
2
|
+
class Vendor < LTIModel
|
3
|
+
|
4
|
+
add_attributes :code, :website
|
5
|
+
add_attribute :id, json_key:'@id'
|
6
|
+
add_attribute :contact, relation:'IMS::LTI::Models::Contact'
|
7
|
+
add_attribute :vendor_name, relation:'IMS::LTI::Models::LocalizedName'
|
8
|
+
add_attribute :description, relation:'IMS::LTI::Models::LocalizedText'
|
9
|
+
add_attribute :timestamp, json_converter: 'IMS::LTI::Converters::TimeJSONConverter'
|
10
|
+
|
11
|
+
def create_vendor_name(name, key = 'vendor.name')
|
12
|
+
@vendor_name = LocalizedName.new(name, key)
|
13
|
+
end
|
14
|
+
|
15
|
+
def create_description(name, key = 'vendor.description')
|
16
|
+
@description = LocalizedText.new(name, key)
|
17
|
+
end
|
18
|
+
|
19
|
+
def default_name
|
20
|
+
vendor_name && vendor_name.default_value
|
21
|
+
end
|
22
|
+
|
23
|
+
def default_description
|
24
|
+
description && description.default_value
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module IMS::LTI
|
2
|
+
module Models
|
3
|
+
require_relative 'models/lti_model'
|
4
|
+
require_relative 'models/contact'
|
5
|
+
require_relative 'models/localized_name'
|
6
|
+
require_relative 'models/localized_text'
|
7
|
+
require_relative 'models/product_family'
|
8
|
+
require_relative 'models/product_info'
|
9
|
+
require_relative 'models/product_instance'
|
10
|
+
require_relative 'models/rest_service'
|
11
|
+
require_relative 'models/service_owner'
|
12
|
+
require_relative 'models/service_provider'
|
13
|
+
require_relative 'models/tool_consumer_profile'
|
14
|
+
require_relative 'models/vendor'
|
15
|
+
require_relative 'models/messages'
|
16
|
+
require_relative 'models/tool_proxy'
|
17
|
+
require_relative 'models/tool_profile'
|
18
|
+
require_relative 'models/resource_handler'
|
19
|
+
require_relative 'models/resource_type'
|
20
|
+
require_relative 'models/message_handler'
|
21
|
+
require_relative 'models/parameter'
|
22
|
+
require_relative 'models/icon_info'
|
23
|
+
require_relative 'models/icon_endpoint'
|
24
|
+
require_relative 'models/security_contract'
|
25
|
+
require_relative 'models/rest_service_profile'
|
26
|
+
require_relative 'models/base_url_choice'
|
27
|
+
require_relative 'models/base_url_selector'
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module IMS::LTI::Services
|
2
|
+
class MessageService
|
3
|
+
|
4
|
+
def initialize(key, secret)
|
5
|
+
@key = key
|
6
|
+
@secret = secret
|
7
|
+
end
|
8
|
+
|
9
|
+
def signed_request(url, message)
|
10
|
+
uri = URI.parse(url)
|
11
|
+
oauth_consumer = OAuth::Consumer.new(@key, @secret, {
|
12
|
+
:site => "#{uri.scheme}://#{uri.host}",
|
13
|
+
:scheme => :body
|
14
|
+
})
|
15
|
+
request = oauth_consumer.create_signed_request(:post, uri.request_uri, nil, {}, message.post_params)
|
16
|
+
|
17
|
+
request
|
18
|
+
end
|
19
|
+
|
20
|
+
def signed_params(url, message)
|
21
|
+
signed_request = signed_request(url, message)
|
22
|
+
|
23
|
+
params = {}
|
24
|
+
CGI.parse(signed_request.body).each do |key, value|
|
25
|
+
params[key] = value.first
|
26
|
+
end
|
27
|
+
params
|
28
|
+
end
|
29
|
+
|
30
|
+
def valid_signature?(url, params)
|
31
|
+
request = {
|
32
|
+
'method' => 'POST',
|
33
|
+
'uri' => url,
|
34
|
+
'parameters' => params
|
35
|
+
}
|
36
|
+
|
37
|
+
OAuth::Signature.build(request, :consumer_secret => @secret).verify()
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/ims/lti.rb
CHANGED
@@ -1,69 +1,11 @@
|
|
1
|
-
require '
|
2
|
-
require 'builder'
|
3
|
-
require "rexml/document"
|
4
|
-
require 'cgi'
|
1
|
+
require 'json'
|
5
2
|
require 'securerandom'
|
3
|
+
require 'oauth'
|
6
4
|
|
7
|
-
module IMS
|
8
|
-
|
9
|
-
# :main:IMS::LTI
|
10
|
-
# LTI is a standard defined by IMS for creating eduction Tool Consumers/Providers.
|
11
|
-
# LTI documentation: http://www.imsglobal.org/lti/index.html
|
12
|
-
#
|
13
|
-
# When creating these tools you will work primarily with the ToolProvider and
|
14
|
-
# ToolConsumer classes.
|
15
|
-
#
|
16
|
-
# For validating OAuth request be sure to require the necessary proxy request
|
17
|
-
# object. See IMS::LTI::RequestValidator#valid_request? for more documentation.
|
18
|
-
#
|
19
|
-
# == Installation
|
20
|
-
# This is packaged as the `ims-lti` rubygem, so you can just add the dependency to
|
21
|
-
# your Gemfile or install the gem on your system:
|
22
|
-
#
|
23
|
-
# gem install ims-lti
|
24
|
-
#
|
25
|
-
# To require the library in your project:
|
26
|
-
#
|
27
|
-
# require 'ims/lti'
|
5
|
+
module IMS
|
28
6
|
module LTI
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
class InvalidLTIConfigError < StandardError
|
34
|
-
end
|
35
|
-
|
36
|
-
class XMLParseError < StandardError
|
37
|
-
end
|
38
|
-
|
39
|
-
# POST a signed oauth request with the given key/secret/data
|
40
|
-
def self.post_service_request(key, secret, url, content_type, body)
|
41
|
-
raise IMS::LTI::InvalidLTIConfigError, "" unless key && secret
|
42
|
-
|
43
|
-
consumer = OAuth::Consumer.new(key, secret)
|
44
|
-
token = OAuth::AccessToken.new(consumer)
|
45
|
-
token.post(
|
46
|
-
url,
|
47
|
-
body,
|
48
|
-
'Content-Type' => content_type
|
49
|
-
)
|
50
|
-
end
|
51
|
-
|
52
|
-
# Generates a unique identifier
|
53
|
-
def self.generate_identifier
|
54
|
-
SecureRandom.uuid
|
55
|
-
end
|
7
|
+
require_relative 'lti/models'
|
8
|
+
require_relative 'lti/converters'
|
9
|
+
require_relative 'lti/services'
|
56
10
|
end
|
57
11
|
end
|
58
|
-
|
59
|
-
require 'ims/lti/extensions'
|
60
|
-
require 'ims/lti/launch_params'
|
61
|
-
require 'ims/lti/request_validator'
|
62
|
-
require 'ims/lti/tool_base'
|
63
|
-
require 'ims/lti/deprecated_role_checks'
|
64
|
-
require 'ims/lti/role_checks'
|
65
|
-
require 'ims/lti/tool_provider'
|
66
|
-
require 'ims/lti/tool_consumer'
|
67
|
-
require 'ims/lti/outcome_request'
|
68
|
-
require 'ims/lti/outcome_response'
|
69
|
-
require 'ims/lti/tool_config'
|
data/lib/ims.rb
CHANGED
metadata
CHANGED
@@ -1,101 +1,116 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ims-lti
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: json-ld
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
19
|
+
version: 1.1.4
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.0'
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
26
|
+
version: 1.1.4
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: oauth
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 0.4.5
|
40
|
-
- - "<"
|
31
|
+
- - "~>"
|
41
32
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
33
|
+
version: 0.4.7
|
43
34
|
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.4.7
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
46
44
|
requirements:
|
47
45
|
- - ">="
|
48
46
|
- !ruby/object:Gem::Version
|
49
|
-
version: 0
|
50
|
-
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
51
53
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0
|
54
|
+
version: '0'
|
53
55
|
- !ruby/object:Gem::Dependency
|
54
56
|
name: rspec
|
55
57
|
requirement: !ruby/object:Gem::Requirement
|
56
58
|
requirements:
|
57
|
-
- - "
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version: '3.0'
|
60
|
-
- - ">"
|
59
|
+
- - ">="
|
61
60
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
61
|
+
version: '0'
|
63
62
|
type: :development
|
64
63
|
prerelease: false
|
65
64
|
version_requirements: !ruby/object:Gem::Requirement
|
66
65
|
requirements:
|
67
|
-
- - "
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '3.0'
|
70
|
-
- - ">"
|
66
|
+
- - ">="
|
71
67
|
- !ruby/object:Gem::Version
|
72
|
-
version: '
|
68
|
+
version: '0'
|
73
69
|
description:
|
74
70
|
email:
|
75
71
|
executables: []
|
76
72
|
extensions: []
|
77
|
-
extra_rdoc_files:
|
78
|
-
- LICENSE
|
73
|
+
extra_rdoc_files: []
|
79
74
|
files:
|
80
|
-
- Changelog
|
81
|
-
- LICENSE
|
75
|
+
- Changelog.txt
|
76
|
+
- LICENSE.txt
|
82
77
|
- README.md
|
83
78
|
- lib/ims.rb
|
84
79
|
- lib/ims/lti.rb
|
85
|
-
- lib/ims/lti/
|
86
|
-
- lib/ims/lti/
|
87
|
-
- lib/ims/lti/
|
88
|
-
- lib/ims/lti/
|
89
|
-
- lib/ims/lti/
|
90
|
-
- lib/ims/lti/
|
91
|
-
- lib/ims/lti/
|
92
|
-
- lib/ims/lti/
|
93
|
-
- lib/ims/lti/
|
94
|
-
- lib/ims/lti/
|
95
|
-
- lib/ims/lti/
|
96
|
-
- lib/ims/lti/
|
97
|
-
- lib/ims/lti/
|
98
|
-
- lib/ims/lti/
|
80
|
+
- lib/ims/lti/converters.rb
|
81
|
+
- lib/ims/lti/converters/time_json_converter.rb
|
82
|
+
- lib/ims/lti/models.rb
|
83
|
+
- lib/ims/lti/models/base_url_choice.rb
|
84
|
+
- lib/ims/lti/models/base_url_selector.rb
|
85
|
+
- lib/ims/lti/models/contact.rb
|
86
|
+
- lib/ims/lti/models/icon_endpoint.rb
|
87
|
+
- lib/ims/lti/models/icon_info.rb
|
88
|
+
- lib/ims/lti/models/localized_name.rb
|
89
|
+
- lib/ims/lti/models/localized_text.rb
|
90
|
+
- lib/ims/lti/models/lti_model.rb
|
91
|
+
- lib/ims/lti/models/message_handler.rb
|
92
|
+
- lib/ims/lti/models/messages.rb
|
93
|
+
- lib/ims/lti/models/messages/basic_lti_launch_request.rb
|
94
|
+
- lib/ims/lti/models/messages/message.rb
|
95
|
+
- lib/ims/lti/models/messages/registration_request.rb
|
96
|
+
- lib/ims/lti/models/parameter.rb
|
97
|
+
- lib/ims/lti/models/product_family.rb
|
98
|
+
- lib/ims/lti/models/product_info.rb
|
99
|
+
- lib/ims/lti/models/product_instance.rb
|
100
|
+
- lib/ims/lti/models/resource_handler.rb
|
101
|
+
- lib/ims/lti/models/resource_type.rb
|
102
|
+
- lib/ims/lti/models/rest_service.rb
|
103
|
+
- lib/ims/lti/models/rest_service_profile.rb
|
104
|
+
- lib/ims/lti/models/security_contract.rb
|
105
|
+
- lib/ims/lti/models/service_owner.rb
|
106
|
+
- lib/ims/lti/models/service_provider.rb
|
107
|
+
- lib/ims/lti/models/tool_consumer_profile.rb
|
108
|
+
- lib/ims/lti/models/tool_profile.rb
|
109
|
+
- lib/ims/lti/models/tool_proxy.rb
|
110
|
+
- lib/ims/lti/models/vendor.rb
|
111
|
+
- lib/ims/lti/services.rb
|
112
|
+
- lib/ims/lti/services/message_service.rb
|
113
|
+
- lib/ims/lti/version.rb
|
99
114
|
homepage: http://github.com/instructure/ims-lti
|
100
115
|
licenses:
|
101
116
|
- MIT
|
@@ -111,11 +126,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
111
126
|
version: '0'
|
112
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
128
|
requirements:
|
114
|
-
- - "
|
129
|
+
- - ">"
|
115
130
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
131
|
+
version: 1.3.1
|
117
132
|
requirements: []
|
118
|
-
|
133
|
+
rubyforge_project:
|
134
|
+
rubygems_version: 2.2.2
|
119
135
|
signing_key:
|
120
136
|
specification_version: 4
|
121
137
|
summary: Ruby library for creating IMS LTI tool providers and consumers
|
data/Changelog
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
2020-02-03 Version 1.2.4
|
2
|
-
* Add support for submittedAt date
|
3
|
-
|
4
|
-
2017-03-08 Version 1.2.0
|
5
|
-
* Don't downcase roles
|
6
|
-
|
7
|
-
2016-10-05 Version 1.1.13
|
8
|
-
* Fix Oauth::Unauthorized initialization bug
|
9
|
-
* Relax oauth dependency
|
10
|
-
|
11
|
-
2016-06-16 Version 1.1.12
|
12
|
-
* Add support for detecting observer role
|
13
|
-
|
14
|
-
2015-02-20 Version 1.1.8
|
15
|
-
* Replace usage of the 'uuid' gem with SecureRandom
|
16
|
-
* Update the outcome extension doc example
|
17
|
-
|
18
|
-
2015-01-09 Version 1.1.7
|
19
|
-
* Add support for new outcome extension resultTotalScore
|
20
|
-
|
21
|
-
2013-04-24 Version 1.1.3
|
22
|
-
|
23
|
-
* Corrected lti_version launch parameter
|
24
|
-
|
25
|
-
2012-09-05 Version 1.1.2
|
26
|
-
|
27
|
-
* Added better role checking and convenience methods
|
28
|
-
|
29
|
-
2012-09-04 Version 1.1.1
|
30
|
-
|
31
|
-
* Added cdata value for outcome data extension
|
32
|
-
|
33
|
-
2012-08-14 Version 1.1.0
|
34
|
-
|
35
|
-
* Added framework for LTI extensions
|
36
|
-
* Added LTI outcome data extension
|
37
|
-
* Fix tests reliant on random ordering
|
38
|
-
* Add rails 3 note to readme install docs
|
39
|
-
* Create Changelog
|
40
|
-
|
41
|
-
|
42
|
-
2012-03-14 Version 1.0.2
|
43
|
-
|
44
|
-
* Refactor OAuth validation into its own module
|
45
|
-
|
46
|
-
|
47
|
-
2012-03-13 Version 1.0.1
|
48
|
-
|
49
|
-
* Add gem dependencies to gemspec
|
50
|
-
|
51
|
-
|
52
|
-
2012-03-11 Version 1.0.0
|
53
|
-
|
54
|
-
* Publish fully functional and operational IMS LTI library
|
data/LICENSE
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
Copyright (c) 2012 Instructure
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
-
this software and associated documentation files (the "Software"), to deal in
|
5
|
-
the Software without restriction, including without limitation the rights to use,
|
6
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
|
7
|
-
Software, and to permit persons to whom the Software is furnished to do so,
|
8
|
-
subject to the following conditions:
|
9
|
-
|
10
|
-
The above copyright notice and this permission notice shall be included in all
|
11
|
-
copies or substantial portions of the Software.
|
12
|
-
|
13
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
17
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# These are here for backwards-compatibility
|
2
|
-
# But they are deprecated and the new ones in
|
3
|
-
# role_checks.rb should be used
|
4
|
-
module IMS::LTI
|
5
|
-
module DeprecatedRoleChecks
|
6
|
-
# Check whether the Launch Parameters have a role
|
7
|
-
def has_role?(role)
|
8
|
-
role = role.downcase
|
9
|
-
@roles && @roles.any?{|r| r.downcase.index(role)}
|
10
|
-
end
|
11
|
-
|
12
|
-
# Convenience method for checking if the user has 'learner' or 'student' role
|
13
|
-
def student?
|
14
|
-
has_role?('learner') || has_role?('student')
|
15
|
-
end
|
16
|
-
|
17
|
-
# Convenience method for checking if the user has 'instructor' or 'faculty' or 'staff' role
|
18
|
-
def instructor?
|
19
|
-
has_role?('instructor') || has_role?('faculty') || has_role?('staff')
|
20
|
-
end
|
21
|
-
|
22
|
-
# Convenience method for checking if the user has 'contentdeveloper' role
|
23
|
-
def content_developer?
|
24
|
-
has_role?('ContentDeveloper')
|
25
|
-
end
|
26
|
-
|
27
|
-
# Convenience method for checking if the user has 'Member' role
|
28
|
-
def member?
|
29
|
-
has_role?('Member')
|
30
|
-
end
|
31
|
-
|
32
|
-
# Convenience method for checking if the user has 'Manager' role
|
33
|
-
def manager?
|
34
|
-
has_role?('Manager')
|
35
|
-
end
|
36
|
-
|
37
|
-
# Convenience method for checking if the user has 'Mentor' role
|
38
|
-
def mentor?
|
39
|
-
has_role?('Mentor')
|
40
|
-
end
|
41
|
-
|
42
|
-
# Convenience method for checking if the user has 'administrator' role
|
43
|
-
def admin?
|
44
|
-
has_role?('administrator')
|
45
|
-
end
|
46
|
-
|
47
|
-
# Convenience method for checking if the user has 'TeachingAssistant' role
|
48
|
-
def ta?
|
49
|
-
has_role?('TeachingAssistant')
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
@@ -1,122 +0,0 @@
|
|
1
|
-
module IMS::LTI
|
2
|
-
module Extensions
|
3
|
-
# Module that adds Canvas specific LTI extensions
|
4
|
-
#
|
5
|
-
# It adds convenience methods for generating common canvas use case LTI configurations
|
6
|
-
#
|
7
|
-
# == Usage
|
8
|
-
# To generate an XML configuration:
|
9
|
-
#
|
10
|
-
# # Create a config object and set some options
|
11
|
-
# tc = IMS::LTI::ToolConfig.new(:title => "Example Sinatra Tool Provider", :launch_url => url)
|
12
|
-
# tc.description = "This example LTI Tool Provider supports LIS Outcome pass-back."
|
13
|
-
#
|
14
|
-
# # Extend the Canvas Tool config and add canvas related extensions
|
15
|
-
# tc.extend IMS::LTI::Extensions::Canvas::ToolConfig
|
16
|
-
# tc.homework_submission! 'http://someplace.com/homework', 'Find Homework'
|
17
|
-
#
|
18
|
-
# # generate the XML
|
19
|
-
# tc.to_xml
|
20
|
-
#
|
21
|
-
# Or to create a config object from an XML String:
|
22
|
-
#
|
23
|
-
# tc = IMS::LTI::ToolConfig.create_from_xml(xml)
|
24
|
-
|
25
|
-
module Canvas
|
26
|
-
module ToolConfig
|
27
|
-
PLATFORM = 'canvas.instructure.com'
|
28
|
-
|
29
|
-
# Canvas extension defaults
|
30
|
-
# These properties will cascade down to any options that are configured
|
31
|
-
def set_canvas_ext_param(key, value)
|
32
|
-
set_ext_param(PLATFORM, key, value)
|
33
|
-
end
|
34
|
-
|
35
|
-
def get_canvas_param(param_key)
|
36
|
-
get_ext_param PLATFORM, param_key
|
37
|
-
end
|
38
|
-
|
39
|
-
def canvas_privacy_public!()
|
40
|
-
set_canvas_ext_param(:privacy_level, 'public')
|
41
|
-
end
|
42
|
-
|
43
|
-
def canvas_privacy_name_only!()
|
44
|
-
set_canvas_ext_param(:privacy_level, 'name_only')
|
45
|
-
end
|
46
|
-
|
47
|
-
def canvas_privacy_anonymous!()
|
48
|
-
set_canvas_ext_param(:privacy_level, 'anonymous')
|
49
|
-
end
|
50
|
-
|
51
|
-
def canvas_domain!(domain)
|
52
|
-
set_canvas_ext_param(:domain, domain)
|
53
|
-
end
|
54
|
-
|
55
|
-
def canvas_text!(text)
|
56
|
-
set_canvas_ext_param(:text, text)
|
57
|
-
end
|
58
|
-
|
59
|
-
def canvas_icon_url!(icon_url)
|
60
|
-
set_canvas_ext_param(:icon_url, icon_url)
|
61
|
-
end
|
62
|
-
|
63
|
-
def canvas_tool_id!(tool_id)
|
64
|
-
set_canvas_ext_param(:tool_id, tool_id)
|
65
|
-
end
|
66
|
-
|
67
|
-
def canvas_selector_dimensions!(width, height)
|
68
|
-
set_canvas_ext_param(:selection_width, width)
|
69
|
-
set_canvas_ext_param(:selection_height, height)
|
70
|
-
end
|
71
|
-
|
72
|
-
# Canvas options
|
73
|
-
# These configure canvas to expose the tool in various locations. Any properties that are set
|
74
|
-
# at this level will override the defaults for this launch of the tool
|
75
|
-
|
76
|
-
# Enables homework submissions via the tool
|
77
|
-
# Valid properties are url, text, selection_width, selection_height, enabled
|
78
|
-
def canvas_homework_submission!(params = {})
|
79
|
-
set_canvas_ext_param(:homework_submission, params)
|
80
|
-
end
|
81
|
-
|
82
|
-
# Adds the tool to canvas' rich text editor
|
83
|
-
# Valid properties are url, icon_url, text, selection_width, selection_height, enabled
|
84
|
-
def canvas_editor_button!(params = {})
|
85
|
-
set_canvas_ext_param(:editor_button, params)
|
86
|
-
end
|
87
|
-
|
88
|
-
# Adds the tool to canvas' resource selector
|
89
|
-
# Valid properties are url, text, selection_width, selection_height, enabled
|
90
|
-
def canvas_resource_selection!(params = {})
|
91
|
-
set_canvas_ext_param(:resource_selection, params)
|
92
|
-
end
|
93
|
-
|
94
|
-
# Adds the tool to account level navigation in canvas
|
95
|
-
# Valid properties are url, text, enabled
|
96
|
-
def canvas_account_navigation!(params = {})
|
97
|
-
set_canvas_ext_param(:account_navigation, params)
|
98
|
-
end
|
99
|
-
|
100
|
-
# Adds the tool to course level navigation in canvas
|
101
|
-
# Valid properties are url, text, visibility, default, enabled
|
102
|
-
# Visibility describes who will see the navigation element. Possible values are "admins", "members", and nil
|
103
|
-
# Default determines if it is on or off by default. Possible values are "admins", "members", and nil
|
104
|
-
def canvas_course_navigation!(params = {})
|
105
|
-
set_canvas_ext_param(:course_navigation, params)
|
106
|
-
end
|
107
|
-
|
108
|
-
# Adds the tool to user level navigation in canvas
|
109
|
-
# Valid properties are url, text, enabled
|
110
|
-
def canvas_user_navigation!(params = {})
|
111
|
-
set_canvas_ext_param(:user_navigation, params)
|
112
|
-
end
|
113
|
-
|
114
|
-
# Adds canvas environment configurations options
|
115
|
-
# Valid properties are launch_url, domain, test_launch_url, test_domain, beta_launch_url, beta_domain
|
116
|
-
def canvas_environments!(params = {})
|
117
|
-
set_canvas_ext_param(:environments, params)
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|