panda_pal 3.2.1 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/panda_pal/lti_controller.rb +7 -12
- data/app/lib/lti_xml/base_platform.rb +93 -0
- data/app/lib/lti_xml/bridge_platform.rb +9 -0
- data/app/lib/lti_xml/canvas_platform.rb +4 -0
- data/db/618eef7c0380ba654ad16f867a919e72.sqlite3 +0 -0
- data/db/9ff93d4f7e0e9dc80a43f68997caf4a1.sqlite3 +0 -0
- data/db/a3fda4044a7215bc2c9eb01a4b9e517a.sqlite3 +0 -0
- data/db/daa0e6378a5ec76fcce83b7070dad219.sqlite3 +0 -0
- data/lib/panda_pal/version.rb +1 -1
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +15058 -0
- data/spec/dummy/log/test.log +0 -0
- metadata +18 -6
- data/lib/lti_xml/base_platform.rb +0 -92
- data/lib/lti_xml/bridge_platform.rb +0 -8
- data/lib/lti_xml/canvas_platform.rb +0 -3
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panda_pal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure ProServe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -144,6 +144,9 @@ files:
|
|
144
144
|
- app/controllers/panda_pal/application_controller.rb
|
145
145
|
- app/controllers/panda_pal/lti_controller.rb
|
146
146
|
- app/helpers/panda_pal/application_helper.rb
|
147
|
+
- app/lib/lti_xml/base_platform.rb
|
148
|
+
- app/lib/lti_xml/bridge_platform.rb
|
149
|
+
- app/lib/lti_xml/canvas_platform.rb
|
147
150
|
- app/models/panda_pal/organization.rb
|
148
151
|
- app/models/panda_pal/session.rb
|
149
152
|
- app/views/layouts/panda_pal/application.html.erb
|
@@ -151,15 +154,16 @@ files:
|
|
151
154
|
- app/views/panda_pal/lti/launch.html.erb
|
152
155
|
- config/initializers/apartment.rb
|
153
156
|
- config/routes.rb
|
157
|
+
- db/618eef7c0380ba654ad16f867a919e72.sqlite3
|
158
|
+
- db/9ff93d4f7e0e9dc80a43f68997caf4a1.sqlite3
|
159
|
+
- db/a3fda4044a7215bc2c9eb01a4b9e517a.sqlite3
|
160
|
+
- db/daa0e6378a5ec76fcce83b7070dad219.sqlite3
|
154
161
|
- db/migrate/20160412205931_create_panda_pal_organizations.rb
|
155
162
|
- db/migrate/20160413135653_create_panda_pal_sessions.rb
|
156
163
|
- db/migrate/20160425130344_add_panda_pal_organization_to_session.rb
|
157
164
|
- db/migrate/20170106165533_add_salesforce_id_to_organizations.rb
|
158
165
|
- db/migrate/20171205183457_encrypt_organization_settings.rb
|
159
166
|
- db/migrate/20171205194657_remove_old_organization_settings.rb
|
160
|
-
- lib/lti_xml/base_platform.rb
|
161
|
-
- lib/lti_xml/bridge_platform.rb
|
162
|
-
- lib/lti_xml/canvas_platform.rb
|
163
167
|
- lib/panda_pal.rb
|
164
168
|
- lib/panda_pal/engine.rb
|
165
169
|
- lib/panda_pal/helpers.rb
|
@@ -199,7 +203,11 @@ files:
|
|
199
203
|
- spec/dummy/config/locales/en.yml
|
200
204
|
- spec/dummy/config/routes.rb
|
201
205
|
- spec/dummy/config/secrets.yml
|
206
|
+
- spec/dummy/db/development.sqlite3
|
202
207
|
- spec/dummy/db/schema.rb
|
208
|
+
- spec/dummy/db/test.sqlite3
|
209
|
+
- spec/dummy/log/development.log
|
210
|
+
- spec/dummy/log/test.log
|
203
211
|
- spec/dummy/public/404.html
|
204
212
|
- spec/dummy/public/422.html
|
205
213
|
- spec/dummy/public/500.html
|
@@ -230,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
238
|
version: '0'
|
231
239
|
requirements: []
|
232
240
|
rubyforge_project:
|
233
|
-
rubygems_version: 2.
|
241
|
+
rubygems_version: 2.6.12
|
234
242
|
signing_key:
|
235
243
|
specification_version: 4
|
236
244
|
summary: LTI mountable engine
|
@@ -263,7 +271,11 @@ test_files:
|
|
263
271
|
- spec/dummy/config/routes.rb
|
264
272
|
- spec/dummy/config/secrets.yml
|
265
273
|
- spec/dummy/config.ru
|
274
|
+
- spec/dummy/db/development.sqlite3
|
266
275
|
- spec/dummy/db/schema.rb
|
276
|
+
- spec/dummy/db/test.sqlite3
|
277
|
+
- spec/dummy/log/development.log
|
278
|
+
- spec/dummy/log/test.log
|
267
279
|
- spec/dummy/public/404.html
|
268
280
|
- spec/dummy/public/422.html
|
269
281
|
- spec/dummy/public/500.html
|
@@ -1,92 +0,0 @@
|
|
1
|
-
class LtiXml::BasePlatform
|
2
|
-
|
3
|
-
attr_accessor :parsed_request_url, :platform, :main_app
|
4
|
-
|
5
|
-
def initialize(platform, full_request_url, main_app)
|
6
|
-
@platform = platform
|
7
|
-
@parsed_request_url = URI.parse(full_request_url)
|
8
|
-
@main_app = main_app
|
9
|
-
end
|
10
|
-
|
11
|
-
# Override one of the following formatter methods in your individual platform class, or if you must, you can override
|
12
|
-
# the whole xml method and do it all custom.
|
13
|
-
def xml
|
14
|
-
ims_tool_config
|
15
|
-
add_domain
|
16
|
-
add_privacy_level
|
17
|
-
add_lti_properties
|
18
|
-
add_lti_custom_params
|
19
|
-
add_lti_options
|
20
|
-
add_lti_nav
|
21
|
-
add_environments
|
22
|
-
|
23
|
-
#strip the launch url
|
24
|
-
xml = @tc.to_xml
|
25
|
-
xml = xml.sub(/<blti:launch_url>.*<\/blti:launch_url>/, '') if PandaPal.lti_options[:launch_url] === false
|
26
|
-
|
27
|
-
return xml
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def ims_tool_config
|
33
|
-
ims_lti_config = {title: PandaPal.lti_options[:title]}
|
34
|
-
if PandaPal.lti_options[:secure_launch_url].present? # Assumes full URL is provided
|
35
|
-
ims_lti_config[:secure_launch_url] = PandaPal.lti_options[:secure_launch_url]
|
36
|
-
elsif PandaPal.lti_options[:secure_launch_path].present? # Assumes path is provided
|
37
|
-
ims_lti_config[:secure_launch_url] = "#{parsed_request_url.host}#{PandaPal.lti_options[:secure_launch_path]}"
|
38
|
-
elsif PandaPal.lti_options[:launch_url].present? # Assumes full URL is provided
|
39
|
-
ims_lti_config[:launch_url] = PandaPal.lti_options[:launch_url]
|
40
|
-
elsif PandaPal.lti_options[:launch_path].present? # Assumes path is provided
|
41
|
-
ims_lti_config[:launch_url] = "#{parsed_request_url.host}#{PandaPal.lti_options[:launch_path]}"
|
42
|
-
else
|
43
|
-
ims_lti_config[:launch_url] = parsed_request_url.host
|
44
|
-
end
|
45
|
-
@tc = IMS::LTI::Services::ToolConfig.new(ims_lti_config)
|
46
|
-
end
|
47
|
-
|
48
|
-
def add_domain
|
49
|
-
@tc.set_ext_param(platform, :domain, parsed_request_url.host) unless PandaPal.lti_properties.has_key?(:domain)
|
50
|
-
end
|
51
|
-
|
52
|
-
def add_privacy_level
|
53
|
-
@tc.set_ext_param(platform, :privacy_level, 'public') unless PandaPal.lti_properties.has_key?(:public)
|
54
|
-
end
|
55
|
-
|
56
|
-
def add_lti_properties
|
57
|
-
PandaPal.lti_properties.each do |k, v|
|
58
|
-
@tc.set_ext_param(platform, k, v)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def add_lti_custom_params
|
63
|
-
PandaPal.lti_custom_params.each do |k, v|
|
64
|
-
@tc.set_custom_param k, v
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def add_lti_options
|
69
|
-
if PandaPal.lti_options.has_key?(:custom_fields)
|
70
|
-
@tc.set_ext_param(platform, :custom_fields, PandaPal.lti_options[:custom_fields])
|
71
|
-
PandaPal.lti_options[:custom_fields].each do |k, v|
|
72
|
-
@tc.set_ext_param(platform, k, v)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def add_lti_nav
|
78
|
-
PandaPal.lti_paths.each do |k, v|
|
79
|
-
@tc.set_ext_param(platform, k.to_sym, ext_params(v))
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def add_environments
|
84
|
-
@tc.set_ext_param(platform, :environments, PandaPal.lti_environments)
|
85
|
-
end
|
86
|
-
|
87
|
-
def ext_params(options)
|
88
|
-
url = options.delete(:url)
|
89
|
-
options[:url] = [parsed_request_url.to_s, main_app.send([url, '_url'].join, only_path: true)].join
|
90
|
-
options
|
91
|
-
end
|
92
|
-
end
|