<% # 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 . %> <% course_home ||= false js_env({ :COLLAPSED_MODULES => @collapsed_modules, :IS_STUDENT => can_do(@context, @current_user, :participate_as_student), :COURSE_ID => @context.id, :PUBLISH_MENU_PROGRESS_ID => @progress&.id, :NO_MODULE_PROGRESSIONS => @context.large_roster, }) %> <% js_bundle :module_student_view_peer_reviews %> <% js_bundle :module_dnd %> <% css_bundle :react_files %> <% if @can_edit %>
<%= t('modules_keyboard_hint_updated', 'Warning: For improved accessibility in reordering Modules (or Module items), please use the Move To Dialog option found in the menu.') %>
<% end %> <% if Account.site_admin.feature_enabled?(:instui_header) %> <% context_modules_header_props = { title: t("Modules"), viewProgress: { label: t('links.student_progress', 'View Progress'), url: progressions_course_context_modules_path(@context), visible: @can_view_grades, }, publishMenu: { courseId: @context.id, runningProgressId: @progress&.id, disabled: @modules.empty?, visible: @context.grants_any_right?(@current_user, session, :manage_content, :manage_course_content_edit), }, expandCollapseAll: { label: t('Collapse All'), dataUrl: context_url(@context, :context_url) + '/collapse_all_modules', dataExpand: false, ariaExpanded: false, ariaLabel: t('Collapse All Modules'), }, addModule: { label: t('Add Module'), visible: @can_add, }, moreMenu: { label: t("Modules Settings"), menuTools: { items: external_tools_menu_items_raw_with_modules(@menu_tools, %i[module_index_menu module_index_menu_modal]), visible: @allow_menu_tools, }, exportCourseContent: { label: t("Export Course Content"), url: context_url(@context, :context_start_offline_web_export_url), visible: @allow_web_export_download, }, }, lastExport: { label: t("Last Export: "), url: context_url(@context, :context_offline_web_exports_url), date: @last_web_export.nil? ? nil : datetime_string(force_zone(@last_web_export.created_at)), visible: !@last_web_export.nil? }, } %>
<% else %> <% js_bundle :context_modules_publish_menu %> <% if course_home %>
<%= @context.name %>

<%= t('headings.course_modules', %{Course Modules}) %>

<% else %>

<%= t('headings.course_modules', %{Course Modules}) %>

<% end %>
<% if @can_view_grades %> <%= t('links.student_progress', 'View Progress') %> <% end %> <% if @allow_web_export_download %> <%= form_tag(context_url(@context, :context_start_offline_web_export_url)) do %> <% end %> <% end %> <% if @context.grants_any_right?(@current_user, session, :manage_content, :manage_course_content_edit) %>
<% end %> <% if @can_add %> <% end %> <% if @context.grants_any_right?(@current_user, session, :manage_content, :manage_course_content_add) && (@menu_tools[:module_index_menu].present? || @menu_tools[:module_index_menu_modal].present?) %>
<%= t("Modules Settings") %>
<% end %>
<% if @last_web_export %> <%= t("Last Export: ") %> <%= datetime_string(force_zone(@last_web_export.created_at)) %> <% end %>
<% end %>
<% unless @is_student %> <% if @feature_teacher_module_selection %>
<% selected_module = @context.show_teacher_only_module_id&.to_i %> <%= t("Selected module will be visible to teachers") %>
<% end %> <% if @feature_student_module_selection && @modules.any?(&:published?) %>
<% selected_module = @context.show_student_only_module_id&.to_i %> <%= t("Selected module will be visible to students") %>
<% end %> <% end %>
<% cache(@modules_cache_key) do %> <% modules_to_show = @module_show_setting ? @modules.select { |m| m.id == @module_show_setting } : @modules %> <% preload_modules_content(modules_to_show) %> <% modules_to_show.each do |m| %> <%= render :partial => 'context_modules/context_module_next', :object => m, :as => :context_module %> <% end %> <% end %>
<%= render :partial => 'context_modules/context_module_next', :object => nil, :as => :context_module %> <%= render :partial => 'context_modules/module_item_next', :object => nil, :as => :module_item %> <% if @can_add || @can_edit %> <%= render :partial => "context_modules/add_context_module_form" %> <%= render :partial => "shared/select_content_dialog", :locals => {:for_modules => true, lti_app_placements: [Lti::ResourcePlacement::LINK_SELECTION, Lti::ResourcePlacement::RESOURCE_SELECTION] } %> <% end %>
 
<% ot 'criterion_for_assignment', '%{assignment} %{select_criterion}', :assignment => capture { %> <% }, :select_criterion => capture { %> <% } %>
<%= image_tag "flagged_question_dim.png", :id => "criterion_image_min_score", :class => "image not_blank", :alt => t('images.alt.min_score', "minimum score"), :title => t('images.title.min_score', "Students must get at least a %{min_score} on this item before the module is considered complete", :min_score => "{{ min_score }}") %> <%= image_tag "preview_dim.png", :id => "criterion_image_must_view", :class => "image not_blank", :alt => t('images.alt.must_view', "must view"), :title => t('images.title.must_view', "Students must view this item before the module is considered complete") %> <%= image_tag "text_entry_dim.png", :id => "criterion_image_must_submit", :class => "image not_blank", :alt => t('images.alt.must_submit', "must submit"), :title => t('images.title.must_submit', "Students must submit this assignment before the module is considered complete") %> <%= image_tag "text_entry_dim.png", :id => "criterion_image_must_contribute", :class => "image not_blank", :alt => t('images.alt.must_contribute', "must contribute"), :title => t('images.title.must_contribute', "Students must contribute to this item before the module is considered complete") %> <%= image_tag "blank.png", :id => "criterion_image_blank", :class => "image", :alt => "" %>
<% unless @current_user.try(:prefers_no_keyboard_shortcuts?) %> <%= render :partial => "context_modules/keyboard_navigation" %> <% end %>