Sha256: a4db766a0312273ad1841bc4861babd79181dec976ba0fc829cee41f28d2d7ca
Contents?: true
Size: 1.27 KB
Versions: 40
Compression:
Stored size: 1.27 KB
Contents
require_dependency "panda_pal/application_controller" module PandaPal class LtiV1P0Controller < ApplicationController if Rails.version < '5.0' skip_before_action :verify_authenticity_token else skip_before_action :verify_authenticity_token, raise: false end def launch current_session_data.merge!({ lti_version: 'v1p0', lti_launch_placement: params[:launch_type], launch_params: params.to_unsafe_h, }) redirect_with_session_to(:"#{LaunchUrlHelpers.launch_route(params[:launch_type])}_url", route_context: main_app) end def tool_config if PandaPal.lti_environments.empty? render plain: 'Domains must be set in lti_environments' return end platform = PandaPal.lti_options.delete(:platform) || 'canvas.instructure.com' request_url = "#{request.scheme}://#{request.host_with_port}" case platform when 'canvas.instructure.com' xml_config = LtiXml::CanvasPlatform.new(platform, request_url, main_app) when 'bridgeapp.com' xml_config = LtiXml::BridgePlatform.new(platform, request_url, main_app) else render plain: 'platform must be set under lti_options' return end render xml: xml_config.xml end end end
Version data entries
40 entries across 40 versions & 1 rubygems