Class: PandaPal::LtiV1P0Controller
- Inherits:
-
PandaPalController
- Object
- ActionController::Base
- PandaPalController
- PandaPal::LtiV1P0Controller
- Defined in:
- app/controllers/panda_pal/lti_v1_p0_controller.rb
Instance Method Summary collapse
-
#launch ⇒ Object
LTI v1 Auto-Launch Action.
- #tool_config ⇒ Object
Methods inherited from PandaPalController
Instance Method Details
#launch ⇒ Object
LTI v1 Auto-Launch Action
13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/panda_pal/lti_v1_p0_controller.rb', line 13 def launch current_session.data.merge!({ lti_version: 'v1p0', lti_launch_placement: params[:launch_type], launch_url_params: request.query_parameters.to_h, launch_params: request.request_parameters.to_h, }) redirect_with_session_to(:"#{LaunchUrlHelpers.launch_route(params[:launch_type])}_url", route_context: main_app) end |
#tool_config ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/panda_pal/lti_v1_p0_controller.rb', line 24 def tool_config if PandaPal.lti_environments.empty? render plain: 'Domains must be set in lti_environments' return end platform = PandaPal..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 |