%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see .
%>
<% js_bundle :select_content_dialog %>
<% css_bundle :select_content_dialog %>
<% css_bundle :react_files %>
<% only ||= nil # only is an optimization, so that tabs that aren't going to be used won't have their data loaded %>
<% lti_app_placements ||= [] %>
<%
new_quizzes_enabled = NewQuizzesFeaturesHelper.new_quizzes_enabled?(@context)
new_quizzes_by_default = new_quizzes_enabled && @context.feature_enabled?(:new_quizzes_by_default)
newquizzes_engine_selected = @context.settings.dig(:engine_selected, :user_id, :newquizzes_engine_selected)
newquizzes_engine_selected = ['true', 'false'].include?(newquizzes_engine_selected) ? newquizzes_engine_selected : nil
add_assignment_permission = @context.root_account.feature_enabled?(:granular_permissions_manage_assignments) ? :manage_assignments_add : :manage_assignments
module_links_default_new_tab = @current_user&.get_preference(:module_links_default_new_tab)
%>
<% js_env :NEW_QUIZZES_BY_DEFAULT => new_quizzes_by_default %>
<% cache([@context, 'select_context_content_dialog_1', only].cache_key) do %>
<%= t :sub_header_notice, "Type the text you'd like to add as a *module* sub-header", :wrapper => '\1' %>
<% end %>
<% if !only || only.include?(:external_urls) %>
<%= t :external_url_notice, "Enter a URL and page name to add a link to any website URL to this *module*.", :wrapper => '\1' %>
/>
<% end %>
<% if !only || only.include?(:external_tools) %>
<%= t :external_tool_notice, "Select a tool from the list below, or enter a URL for an external tool you already know is configured with Basic LTI to add a link to it to this *module*.", :wrapper => '\1' %>
<%= t :loading, "Loading..." %>
<%= t :domain_match_notice, "to use this tool the domain must match %{domain}", :domain => ''.html_safe %>
/>
<% end %>
<% if !only || only.include?(:wiki_pages) %>
<%= t 'Select the page you want to associate with this *module*, or add a new page by selecting "Create Page".', :wrapper => '\1' %>
<% page_label = t 'Select the page you want to associate, or add a new page by selecting "Create Page".' %>
<% end %>
<% if !only || only.include?(:quizzes) %>
<%= t :create_quiz_notice, 'Select the quiz you want to associate with this *module*, or add a new one by selecting "Create Quiz".', :wrapper => '\1' %>
<% quiz_label = t :quiz_select_label_create, 'Select the quiz you want to associate, or add a new one by selecting "Create Quiz".' %>
<% if new_quizzes_enabled && !new_quizzes_by_default %>
<%= before_label :quiz_engine, "Quiz Engine" %>
<% if newquizzes_engine_selected == 'false' %>
<% else %>
<% end %>
<%= t("Improved interface with ongoing updates") %>
<%= t("The original quizzes interface") %>
<% end %>
<%= before_label :quiz_name, "Quiz Name" %>
"/>
<%= before_label :quiz_group, "Group" %>
<% end %>
<% if !only || only.include?(:assignments) %>
<%= t :create_assignment_notice, 'Select the assignment you want to associate with this *module*, or add an assignment by selecting "Create Assignment".', :wrapper => '\1' %>
<% assignment_label = t 'assignment_item_select_label_create', 'Select the assignment you want to associate, or add an assignment by selecting "Create Assignment".' %>
<% end %>
<% if !only || only.include?(:discussion_topics) %>
<%= t :create_topic_notice, 'Select the topic you want to associate with this *module*, or add a topic by selecting "Create Topic".', :wrapper => '\1' %>
<% topic_label = t 'discussion_topic_select_label_create', 'Select the topic you want to associate, or add a topic by selecting "Create Topic".' %>