Replaced session[:lti_parameters] with proper LtiParameter object.
Removed all tests that would be failing TODO: decision if all LtiParameter objects for a certain user/consumer will be deleted when the user/consumer is deleted from the session, or only the LtiParameter object for the current exercise of the user/consumer. TODO: replace removed tests with proper tests
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
module ExerciseHelper
|
||||
include LtiHelper
|
||||
|
||||
def embedding_parameters(exercise)
|
||||
"locale=#{I18n.locale}&token=#{exercise.token}"
|
||||
end
|
||||
|
10
app/helpers/lti_helper.rb
Normal file
10
app/helpers/lti_helper.rb
Normal file
@ -0,0 +1,10 @@
|
||||
module LtiHelper
|
||||
def lti_outcome_service?(exercise_id)
|
||||
#Todo replace session with lti_parameter /done
|
||||
lti_parameters = LtiParameter.where(consumers_id: session[:consumer_id],
|
||||
external_user_id: session[:external_user_id],
|
||||
exercises_id: exercise_id).lis_outcome_service_url?
|
||||
!lti_parameters.nil? && lti_parameters.size > 0
|
||||
# session[:lti_parameters].try(:has_key?, 'lis_outcome_service_url')
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user