Files
codeocean/app/helpers/lti_helper.rb
Sebastian Serth 6bd1dac756 Performance Optimizations:
1. Add index on testrun.submissionId
2. replace lti_parameters.size with lti_parameters.present? to prevent COUNT query

Signed-off-by: Sebastian Serth <Sebastian.Serth@student.hpi.de>
2018-08-23 17:29:14 +02:00

11 lines
449 B
Ruby

module LtiHelper
def lti_outcome_service?(exercise_id, external_user_id, consumer_id)
return false if external_user_id == '' || consumer_id == ''
lti_parameters = LtiParameter.where(consumers_id: consumer_id,
external_users_id: external_user_id,
exercises_id: exercise_id).lis_outcome_service_url?
!lti_parameters.nil? && lti_parameters.present?
end
end