qalam_lti_provider_engine 2.0.3 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/lti_provider/lti_controller.rb +29 -9
- data/app/models/lti_provider/launch.rb +76 -0
- data/lib/lti_provider/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c44302d262a552ee530b6f28ee83e7477d2246ed17ef96ab947dd05f9ab8feab
|
4
|
+
data.tar.gz: 44f56ac3fd92498e8d879d144c9cb46b427cf4f34da6b3af45a9d638669cd00d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11a370ea40641bedfe3b509266b60f8147179e0ef82105d80b44eab4d6f6af877e20e928052614f0b65bafae8a909bd51ed371f08238991eff89859982a32f3
|
7
|
+
data.tar.gz: 5d10c95c500fb6198b99415a82163311272e19ced22b9e63db612d0f9b80fa34bf65eb6363cff0326cecdd35573199683f3a5e04f05c4283a2579d9da7ab7250
|
@@ -4,11 +4,15 @@ require 'colorize'
|
|
4
4
|
module LtiProvider
|
5
5
|
class LtiController < LtiProvider::LtiApplicationController
|
6
6
|
skip_before_action :require_lti_launch
|
7
|
+
# skip_before_action :verify_authenticity_token, only: :launch
|
7
8
|
|
8
9
|
def launch
|
9
10
|
provider = IMS::LTI::ToolProvider.new(params['oauth_consumer_key'], LtiProvider::Config.secret, params)
|
10
11
|
launch = Launch.initialize_from_request(provider, request)
|
11
12
|
|
13
|
+
puts launch.inspect.red
|
14
|
+
puts request.origin.inspect.green
|
15
|
+
puts request.base_url.inspect.yellow
|
12
16
|
if !launch.valid_provider?
|
13
17
|
msg = "#{launch.lti_errormsg} Please be sure you are launching this tool from the link provided in Qalam."
|
14
18
|
return show_error msg
|
@@ -23,26 +27,34 @@ module LtiProvider
|
|
23
27
|
end
|
24
28
|
### END ###
|
25
29
|
else
|
26
|
-
|
30
|
+
if params[:launch_tool] && params[:launch_tool] == 'digital_library'
|
31
|
+
redirect_to main_app.root_path and return
|
32
|
+
else
|
33
|
+
return show_error "Unable to launch #{LtiProvider::XmlConfig.tool_title}. Please check your External Tools configuration and try again."
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
29
37
|
|
30
38
|
def cookie_test
|
39
|
+
@launch = Launch.where("created_at > ?", 5.minutes.ago).find_by_nonce(params[:nonce])
|
40
|
+
|
31
41
|
if session[:cookie_test]
|
32
42
|
# success!!! we've got a session!
|
33
43
|
consume_launch
|
34
44
|
else
|
35
|
-
|
45
|
+
if @launch.launch_tool && @launch.launch_tool == 'digital_library'
|
46
|
+
redirect_to main_app.root_path and return
|
47
|
+
else
|
48
|
+
render and return
|
49
|
+
end
|
36
50
|
end
|
37
51
|
end
|
38
52
|
|
39
53
|
def consume_launch
|
40
|
-
launch
|
41
|
-
|
42
|
-
if launch
|
54
|
+
if @launch
|
43
55
|
[:account_id, :course_name, :course_id, :canvas_url, :tool_consumer_instance_guid,
|
44
56
|
:user_id, :user_name, :user_roles, :user_avatar_url, :launch_tool].each do |attribute|
|
45
|
-
session[attribute] = launch.public_send(attribute)
|
57
|
+
session[attribute] = @launch.public_send(attribute)
|
46
58
|
end
|
47
59
|
|
48
60
|
### QALAM ###
|
@@ -52,11 +64,19 @@ module LtiProvider
|
|
52
64
|
end
|
53
65
|
### END ###
|
54
66
|
|
55
|
-
launch.destroy
|
67
|
+
@launch.destroy
|
56
68
|
|
57
|
-
|
69
|
+
if @launch.launch_tool && @launch.launch_tool == 'digital_library'
|
70
|
+
redirect_to main_app.root_path and return
|
71
|
+
else
|
72
|
+
redirect_to main_app.root_path and return
|
73
|
+
end
|
58
74
|
else
|
59
|
-
|
75
|
+
if @launch.launch_tool && @launch.launch_tool == 'digital_library'
|
76
|
+
redirect_to main_app.root_path and return
|
77
|
+
else
|
78
|
+
return show_error "The tool was not launched successfully. Please try again."
|
79
|
+
end
|
60
80
|
end
|
61
81
|
end
|
62
82
|
|
@@ -55,6 +55,82 @@ module LtiProvider
|
|
55
55
|
tc.canvas_user_navigation!(LtiProvider::XmlConfig.user_navigation.symbolize_keys)
|
56
56
|
end
|
57
57
|
|
58
|
+
### QALAM ###
|
59
|
+
|
60
|
+
if LtiProvider::XmlConfig.course_home_sub_navigation
|
61
|
+
tc.canvas_course_home_sub_navigation!(LtiProvider::XmlConfig.course_home_sub_navigation.symbolize_keys)
|
62
|
+
end
|
63
|
+
|
64
|
+
if LtiProvider::XmlConfig.course_settings_sub_navigation
|
65
|
+
tc.canvas_course_settings_sub_navigation!(LtiProvider::XmlConfig.course_settings_sub_navigation.symbolize_keys)
|
66
|
+
end
|
67
|
+
|
68
|
+
if LtiProvider::XmlConfig.global_navigation
|
69
|
+
tc.canvas_global_navigation!(LtiProvider::XmlConfig.global_navigation.symbolize_keys)
|
70
|
+
end
|
71
|
+
|
72
|
+
if LtiProvider::XmlConfig.module_menu
|
73
|
+
tc.canvas_module_menu!(LtiProvider::XmlConfig.module_menu.symbolize_keys)
|
74
|
+
end
|
75
|
+
|
76
|
+
if LtiProvider::XmlConfig.module_index_menu
|
77
|
+
tc.canvas_module_index_menu!(LtiProvider::XmlConfig.module_index_menu.symbolize_keys)
|
78
|
+
end
|
79
|
+
|
80
|
+
if LtiProvider::XmlConfig.module_group_menu
|
81
|
+
tc.canvas_module_group_menu!(LtiProvider::XmlConfig.module_group_menu.symbolize_keys)
|
82
|
+
end
|
83
|
+
|
84
|
+
if LtiProvider::XmlConfig.quiz_menu
|
85
|
+
tc.canvas_quiz_menu!(LtiProvider::XmlConfig.quiz_menu.symbolize_keys)
|
86
|
+
end
|
87
|
+
|
88
|
+
if LtiProvider::XmlConfig.quiz_index_menu
|
89
|
+
tc.canvas_quiz_index_menu!(LtiProvider::XmlConfig.quiz_index_menu.symbolize_keys)
|
90
|
+
end
|
91
|
+
|
92
|
+
if LtiProvider::XmlConfig.assignment_menu
|
93
|
+
tc.canvas_assignment_menu!(LtiProvider::XmlConfig.assignment_menu.symbolize_keys)
|
94
|
+
end
|
95
|
+
|
96
|
+
if LtiProvider::XmlConfig.assignment_index_menu
|
97
|
+
tc.canvas_assignment_index_menu!(LtiProvider::XmlConfig.assignment_index_menu.symbolize_keys)
|
98
|
+
end
|
99
|
+
|
100
|
+
if LtiProvider::XmlConfig.assignment_group_menu
|
101
|
+
tc.canvas_assignment_group_menu!(LtiProvider::XmlConfig.assignment_group_menu.symbolize_keys)
|
102
|
+
end
|
103
|
+
|
104
|
+
if LtiProvider::XmlConfig.discussion_topic_menu
|
105
|
+
tc.canvas_discussion_topic_menu!(LtiProvider::XmlConfig.discussion_topic_menu.symbolize_keys)
|
106
|
+
end
|
107
|
+
|
108
|
+
if LtiProvider::XmlConfig.discussion_topic_index_menu
|
109
|
+
tc.canvas_discussion_topic_index_menu!(LtiProvider::XmlConfig.discussion_topic_index_menu.symbolize_keys)
|
110
|
+
end
|
111
|
+
|
112
|
+
if LtiProvider::XmlConfig.wiki_page_menu
|
113
|
+
tc.canvas_wiki_page_menu!(LtiProvider::XmlConfig.wiki_page_menu.symbolize_keys)
|
114
|
+
end
|
115
|
+
|
116
|
+
if LtiProvider::XmlConfig.wiki_index_menu
|
117
|
+
tc.canvas_wiki_index_menu!(LtiProvider::XmlConfig.wiki_index_menu.symbolize_keys)
|
118
|
+
end
|
119
|
+
|
120
|
+
if LtiProvider::XmlConfig.file_menu
|
121
|
+
tc.canvas_file_menu!(LtiProvider::XmlConfig.file_menu.symbolize_keys)
|
122
|
+
end
|
123
|
+
|
124
|
+
if LtiProvider::XmlConfig.file_index_menu
|
125
|
+
tc.canvas_file_index_menu!(LtiProvider::XmlConfig.file_index_menu.symbolize_keys)
|
126
|
+
end
|
127
|
+
|
128
|
+
if LtiProvider::XmlConfig.editor_button
|
129
|
+
tc.canvas_editor_button!(LtiProvider::XmlConfig.editor_button.symbolize_keys)
|
130
|
+
end
|
131
|
+
|
132
|
+
### END ###
|
133
|
+
|
58
134
|
if LtiProvider::XmlConfig.environments
|
59
135
|
tc.set_ext_param(platform, :environments, LtiProvider::XmlConfig.environments.symbolize_keys)
|
60
136
|
end
|
data/lib/lti_provider/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qalam_lti_provider_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Donahue
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-08-08 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -22,7 +22,7 @@ dependencies:
|
|
22
22
|
version: '4.2'
|
23
23
|
- - "<"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '
|
25
|
+
version: '6.1'
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
28
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -32,21 +32,21 @@ dependencies:
|
|
32
32
|
version: '4.2'
|
33
33
|
- - "<"
|
34
34
|
- !ruby/object:Gem::Version
|
35
|
-
version: '
|
35
|
+
version: '6.1'
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
|
-
name:
|
37
|
+
name: qalam_ims_lti
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- - "
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '0'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
49
|
+
version: '0'
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: sqlite3
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
312
|
- !ruby/object:Gem::Version
|
313
313
|
version: '0'
|
314
314
|
requirements: []
|
315
|
-
rubygems_version: 3.2.
|
315
|
+
rubygems_version: 3.2.22
|
316
316
|
signing_key:
|
317
317
|
specification_version: 4
|
318
318
|
summary: LtiProvider is a mountable engine for handling the LTI launch and exposing
|