panda_pal 5.4.0.beta5 → 5.4.0.beta10

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
  SHA256:
3
- metadata.gz: 269670787a0bf5a9e2e9c758ee6e3e4689915e08fabb4a6eb80901658f1e9108
4
- data.tar.gz: 2d4ed3aa0c345551e20e4cd9d12c6bf14ec373d10067417d74516040d3244f66
3
+ metadata.gz: 4e8e58d3536fde62fef266458e96d98db54f45d91f067050717e17fdc00dcdf2
4
+ data.tar.gz: 73b390447618698dfaaf87ea6c2372bfb0f8a9cc4f9594b436cf4f29d379407f
5
5
  SHA512:
6
- metadata.gz: 53601808a0539cc03f98d859ade70ccd47e11914e958f23b8a544f5062a10b540714d29f047dd80981ac66184e89cd891929f435d0589db37a21f0d1d1c75b0c
7
- data.tar.gz: 1cbac9f8d3c006d16c6fba0c0616facdcdf2bd2125b8563fb320d7606a49f47e0d47f76ec2bbf6fc24c9ccd531b76f75c0c4976bcb6157fb555e9717dd359a25
6
+ metadata.gz: 427b3efbb5bc569a2d4c775aac76ce7701a014c03def9ba6066f58cd31f03f6e3099d554cbcfa1a198ed6cf436ab743d5eab2b91109bb5fafa61a751c1115eb0
7
+ data.tar.gz: 2a11146be413ba7036e9c092fae83b94f7e8dc8a0b9333cdf918995219169a681c5a5dcf9cfa3fd19b19b8e7873ab2b80f9aa106d1d3dded51a9e4de5817a52d
@@ -4,10 +4,10 @@ module PandaPal::Jobs
4
4
  class GradePassbackFailure < StandardError; end
5
5
 
6
6
  class GradePassbackJob < ActiveJob::Base
7
- sidekiq_options retry: 5
8
-
9
7
  attr_accessor :organization, :opts
10
8
 
9
+ sidekiq_options(retry: 5) if respond_to?(:sidekiq_options)
10
+
11
11
  # Required values for opts: passback_guid, passback_url, score AND/OR total_score.
12
12
  # Possible values for opts: cdata_text, text, url, submitted_at, lti_launch_url.
13
13
  # passback_guid is sent in launch params as 'lis_result_sourcedid'.
@@ -49,6 +49,10 @@ module PandaPal
49
49
  end
50
50
  end
51
51
 
52
+ PandaPal.resolved_extensions_for(self).each do |ext|
53
+ include ext
54
+ end
55
+
52
56
  private
53
57
 
54
58
  def create_schema
data/lib/panda_pal.rb CHANGED
@@ -13,6 +13,7 @@ module PandaPal
13
13
  @@lti_properties = {}
14
14
  @@lti_environments = {}
15
15
  @@lti_custom_params = {}
16
+ @@extensions = {}
16
17
  @@lti_private_key = nil
17
18
 
18
19
  def self.lti_options= lti_options
@@ -70,8 +71,30 @@ module PandaPal
70
71
  @@lti_private_key = k
71
72
  end
72
73
 
74
+ def self.register_extension(type, modul)
75
+ type = normalize_ext_type(type)
76
+ @@extensions[type] ||= []
77
+ @@extensions[type] << modul.to_s
78
+ end
79
+
80
+ def self.extensions_for(type)
81
+ (@@extensions[normalize_ext_type(type)] || []).uniq
82
+ end
83
+
84
+ def self.resolved_extensions_for(type)
85
+ extensions_for(type).map do |ext|
86
+ ext.safe_constantize
87
+ end.compact
88
+ end
89
+
73
90
  private
74
91
 
92
+ def self.normalize_ext_type(type)
93
+ type = type.to_s
94
+ type = "#{self.to_s}::#{type}" unless type.starts_with?('::') || type.starts_with?(self.to_s)
95
+ type
96
+ end
97
+
75
98
  def self.validate_pandapal_config!
76
99
  errors = []
77
100
  validate_lti_navigation(errors)
@@ -89,3 +112,5 @@ module PandaPal
89
112
  errors
90
113
  end
91
114
  end
115
+
116
+ PandaPal.register_extension 'Organization', '::OrganizationExtension'
@@ -43,6 +43,10 @@ module PandaPal
43
43
  ActiveSupport.on_load(:active_record) do
44
44
  if defined?(Sidekiq) && Sidekiq.server? && PandaPal::Organization.respond_to?(:sync_schedules)
45
45
  PandaPal::Organization.sync_schedules
46
+
47
+ ActiveSupport::Reloader.to_prepare do
48
+ PandaPal::Organization.sync_schedules
49
+ end
46
50
  end
47
51
  end
48
52
  end
@@ -2,4 +2,5 @@ module PandaPal::Helpers
2
2
  require_relative 'helpers/controller_helper'
3
3
  require_relative 'helpers/route_helper'
4
4
  require_relative 'helpers/secure_headers'
5
+ require_relative 'helpers/ability_mixin'
5
6
  end
@@ -13,9 +13,13 @@ module PandaPal::Helpers
13
13
  end
14
14
 
15
15
  class_methods do
16
- def link_nonce_type(value = :not_given)
16
+ def link_nonce_type(value = :not_given, use_non_app: false)
17
17
  if value == :not_given
18
- @link_nonce_type || superclass.try(:link_nonce_type) || :nonce
18
+ if use_non_app || !defined?(::ApplicationController) || self <= ::ApplicationController
19
+ @link_nonce_type || superclass.try(:link_nonce_type, use_non_app: true) || :nonce
20
+ else
21
+ ::ApplicationController.link_nonce_type(value, use_non_app: true)
22
+ end
19
23
  else
20
24
  @link_nonce_type = value
21
25
  end
@@ -1,3 +1,3 @@
1
1
  module PandaPal
2
- VERSION = "5.4.0.beta5"
2
+ VERSION = "5.4.0.beta10"
3
3
  end
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: 5.4.0.beta5
4
+ version: 5.4.0.beta10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure ProServe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-12 00:00:00.000000000 Z
11
+ date: 2021-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -218,6 +218,7 @@ files:
218
218
  - app/controllers/panda_pal/lti_v1_p0_controller.rb
219
219
  - app/controllers/panda_pal/lti_v1_p3_controller.rb
220
220
  - app/helpers/panda_pal/application_helper.rb
221
+ - app/jobs/panda_pal/jobs/grade_passback_job.rb
221
222
  - app/lib/lti_xml/base_platform.rb
222
223
  - app/lib/lti_xml/bridge_platform.rb
223
224
  - app/lib/lti_xml/canvas_platform.rb
@@ -244,14 +245,13 @@ files:
244
245
  - db/migrate/20171205183457_encrypt_organization_settings.rb
245
246
  - db/migrate/20171205194657_remove_old_organization_settings.rb
246
247
  - lib/panda_pal.rb
247
- - lib/panda_pal/ability_mixin.rb
248
248
  - lib/panda_pal/engine.rb
249
249
  - lib/panda_pal/helpers.rb
250
+ - lib/panda_pal/helpers/ability_mixin.rb
250
251
  - lib/panda_pal/helpers/controller_helper.rb
251
252
  - lib/panda_pal/helpers/route_helper.rb
252
253
  - lib/panda_pal/helpers/secure_headers.rb
253
254
  - lib/panda_pal/helpers/session_replacement.rb
254
- - lib/panda_pal/jobs/grade_passback_job.rb
255
255
  - lib/panda_pal/plugins.rb
256
256
  - lib/panda_pal/version.rb
257
257
  - lib/tasks/panda_pal_tasks.rake