Revert "Remove New Quizzes Embedded Module Progression"
This reverts commit a7f0ea277a
.
Reason for revert: the removal broke launching NQ on mobile
Change-Id: I1f719ce9317cfb1f4477098fe25fd7eb558b0d09
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/273543
Reviewed-by: Jeff Largent <jeff.largent@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
QA-Review: Mark McDermott <mmcdermott@instructure.com>
Product-Review: Jackson Howe <jackson.howe@instructure.com>
This commit is contained in:
parent
a7ee6c6876
commit
602fc440cd
|
@ -1843,6 +1843,7 @@ class ApplicationController < ActionController::Base
|
||||||
link_code: @opaque_id,
|
link_code: @opaque_id,
|
||||||
overrides: {'resource_link_title' => @resource_title},
|
overrides: {'resource_link_title' => @resource_title},
|
||||||
domain: HostUrl.context_host(@domain_root_account, request.host),
|
domain: HostUrl.context_host(@domain_root_account, request.host),
|
||||||
|
include_module_context: Account.site_admin.feature_enabled?(:new_quizzes_in_module_progression)
|
||||||
}
|
}
|
||||||
variable_expander = Lti::VariableExpander.new(@domain_root_account, @context, self,{
|
variable_expander = Lti::VariableExpander.new(@domain_root_account, @context, self,{
|
||||||
current_user: @current_user,
|
current_user: @current_user,
|
||||||
|
@ -1950,7 +1951,7 @@ class ApplicationController < ActionController::Base
|
||||||
def external_tool_redirect_display_type
|
def external_tool_redirect_display_type
|
||||||
if params['display'].present?
|
if params['display'].present?
|
||||||
params['display']
|
params['display']
|
||||||
elsif @assignment&.quiz_lti? && @module_tag
|
elsif Account.site_admin.feature_enabled?(:new_quizzes_in_module_progression) && @assignment&.quiz_lti? && @module_tag
|
||||||
'in_nav_context'
|
'in_nav_context'
|
||||||
else
|
else
|
||||||
@tool&.extension_setting(:assignment_selection)&.dig('display_type')
|
@tool&.extension_setting(:assignment_selection)&.dig('display_type')
|
||||||
|
|
|
@ -53,6 +53,7 @@ module Lti
|
||||||
link_code = opts[:link_code] || default_link_code
|
link_code = opts[:link_code] || default_link_code
|
||||||
@overrides = opts[:overrides] || {}
|
@overrides = opts[:overrides] || {}
|
||||||
link_params = opts[:link_params] || {}
|
link_params = opts[:link_params] || {}
|
||||||
|
include_module_context = opts[:include_module_context] || false
|
||||||
|
|
||||||
lti_context = Lti::LtiContextCreator.new(@context, @tool).convert
|
lti_context = Lti::LtiContextCreator.new(@context, @tool).convert
|
||||||
lti_user = Lti::LtiUserCreator.new(@user, @root_account, @tool, @context).convert if @user
|
lti_user = Lti::LtiUserCreator.new(@user, @root_account, @tool, @context).convert if @user
|
||||||
|
@ -72,7 +73,8 @@ module Lti
|
||||||
tool: lti_tool,
|
tool: lti_tool,
|
||||||
account: lti_account,
|
account: lti_account,
|
||||||
variable_expander: variable_expander,
|
variable_expander: variable_expander,
|
||||||
link_params: link_params
|
link_params: link_params,
|
||||||
|
include_module_context: include_module_context
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
self
|
self
|
||||||
|
|
|
@ -48,6 +48,11 @@ new_quizzes_account_course_level_item_banks:
|
||||||
state: hidden
|
state: hidden
|
||||||
new_quizzes_skip_to_build_module_button:
|
new_quizzes_skip_to_build_module_button:
|
||||||
display_name: New Quizzes Build Button In Module Items
|
display_name: New Quizzes Build Button In Module Items
|
||||||
description: Provides a button which navigates straight to the Build screen in the kebab menu for New Quizzes items on the Modules page.
|
description: Provides a button which navigates straight to the Build screen in the kebab menu for New Quizzes items on the Modules page.
|
||||||
|
applies_to: SiteAdmin
|
||||||
|
state: hidden
|
||||||
|
new_quizzes_in_module_progression:
|
||||||
|
display_name: New Quizzes Embedded Module Progression
|
||||||
|
description: Improved support for taking New Quizzes from within Modules
|
||||||
applies_to: SiteAdmin
|
applies_to: SiteAdmin
|
||||||
state: hidden
|
state: hidden
|
||||||
|
|
|
@ -40,6 +40,7 @@ module LtiOutbound
|
||||||
@selected_html = options[:selected_html]
|
@selected_html = options[:selected_html]
|
||||||
@link_params = options[:link_params] || {}
|
@link_params = options[:link_params] || {}
|
||||||
@consumer_instance = context.consumer_instance || raise('Consumer instance required for generating LTI content')
|
@consumer_instance = context.consumer_instance || raise('Consumer instance required for generating LTI content')
|
||||||
|
@include_module_context = options[:include_module_context] || false
|
||||||
|
|
||||||
@variable_expander = options[:variable_expander] || raise('VariableExpander is required for generating LTI content')
|
@variable_expander = options[:variable_expander] || raise('VariableExpander is required for generating LTI content')
|
||||||
@hash = {}
|
@hash = {}
|
||||||
|
@ -143,8 +144,10 @@ module LtiOutbound
|
||||||
def add_assignment_substitutions!(assignment)
|
def add_assignment_substitutions!(assignment)
|
||||||
if tool.public?
|
if tool.public?
|
||||||
hash['custom_canvas_assignment_id'] = '$Canvas.assignment.id'
|
hash['custom_canvas_assignment_id'] = '$Canvas.assignment.id'
|
||||||
hash['custom_canvas_module_id'] = '$Canvas.module.id'
|
if @include_module_context
|
||||||
hash['custom_canvas_module_item_id'] = '$Canvas.moduleItem.id'
|
hash['custom_canvas_module_id'] = '$Canvas.module.id'
|
||||||
|
hash['custom_canvas_module_item_id'] = '$Canvas.moduleItem.id'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
hash['custom_canvas_assignment_title'] = '$Canvas.assignment.title'
|
hash['custom_canvas_assignment_title'] = '$Canvas.assignment.title'
|
||||||
|
|
|
@ -113,7 +113,8 @@ describe LtiOutbound::ToolLaunch do
|
||||||
:link_code => '123456',
|
:link_code => '123456',
|
||||||
:return_url => 'http://www.google.com',
|
:return_url => 'http://www.google.com',
|
||||||
:outgoing_email_address => 'outgoing_email_address',
|
:outgoing_email_address => 'outgoing_email_address',
|
||||||
:variable_expander => variable_expander)
|
:variable_expander => variable_expander,
|
||||||
|
:include_module_context => true)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#generate' do
|
describe '#generate' do
|
||||||
|
@ -418,7 +419,7 @@ describe LtiOutbound::ToolLaunch do
|
||||||
expect(hash['custom_canvas_assignment_points_possible']).to eq '$Canvas.assignment.pointsPossible'
|
expect(hash['custom_canvas_assignment_points_possible']).to eq '$Canvas.assignment.pointsPossible'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'includes module context info' do
|
it 'includes module context info when associated option is true' do
|
||||||
tool_launch.for_assignment!(assignment, '/my/test/url', '/my/other/test/url', '/a/test/url')
|
tool_launch.for_assignment!(assignment, '/my/test/url', '/my/other/test/url', '/a/test/url')
|
||||||
|
|
||||||
hash = tool_launch.generate
|
hash = tool_launch.generate
|
||||||
|
|
|
@ -953,7 +953,8 @@ RSpec.describe ApplicationController do
|
||||||
controller.send(:content_tag_redirect, course, content_tag, nil)
|
controller.send(:content_tag_redirect, course, content_tag, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'overrides the configured display_type for the quiz_lti in module context' do
|
it 'overrides the configured display_type for the quiz_lti in module context when feature flag is on' do
|
||||||
|
Account.site_admin.enable_feature!(:new_quizzes_in_module_progression)
|
||||||
allow(content_tag.context).to receive(:quiz_lti?).and_return(true)
|
allow(content_tag.context).to receive(:quiz_lti?).and_return(true)
|
||||||
module1 = course.context_modules.create!(name: 'Module 1')
|
module1 = course.context_modules.create!(name: 'Module 1')
|
||||||
content_tag.context.context_module_tags.create!(context_module: module1, context: course, tag_type: 'context_module')
|
content_tag.context.context_module_tags.create!(context_module: module1, context: course, tag_type: 'context_module')
|
||||||
|
|
Loading…
Reference in New Issue