Merge branch 'master' into add_roles_via_LTI

# Conflicts:
#	app/views/application/_breadcrumbs.html.slim
#	app/views/application/welcome.html.slim
#	app/views/exercise_collections/show.html.slim
#	app/views/external_users/index.html.slim
#	app/views/layouts/application.html.slim
#	app/views/proxy_exercises/index.html.slim
#	app/views/user_exercise_feedbacks/index.html.slim
#	app/views/user_mailer/send_thank_you_note.slim
This commit is contained in:
Sebastian Serth
2018-12-14 00:53:06 +01:00
47 changed files with 256 additions and 120 deletions

View File

@ -22,6 +22,7 @@ module Lti
if (exercise_id.nil?)
session.delete(:consumer_id)
session.delete(:external_user_id)
session.delete(:embed_options)
else
LtiParameter.where(consumers_id: consumer_id,
external_users_id: user_id,
@ -148,6 +149,26 @@ module Lti
end
private :set_current_user
def set_embedding_options
@embed_options = {}
[:hide_navbar,
:hide_exercise_description,
:disable_run,
:disable_score,
:disable_rfc,
:disable_interventions,
:hide_sidebar,
:read_only,
:hide_test_results,
:disable_hints].each do |option|
value = params["custom_embed_options_#{option}".to_sym] == 'true'
# Optimize storage and save only those that are true, the session cookie is limited to 4KB
@embed_options[option] = value if value.present?
end
session[:embed_options] = @embed_options
end
private :set_embedding_options
def store_lti_session_data(options = {})
lti_parameters = LtiParameter.find_or_create_by(consumers_id: options[:consumer].id,
external_users_id: @current_user.id,