<% # Copyright (C) 2013 - 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 . %> <% module_item_next ||= nil module_item ||= module_item_next item_data ||= { published_status: 'unpublished' } completion_criteria ||= nil can_direct_share = can_do(@context, @current_user, :direct_share) criterion = completion_criteria && completion_criteria.find{|c| c[:id] == module_item.id} show_checkpoints = @context.root_account.feature_enabled?(:discussion_checkpoints) && module_item && module_item.content_type == 'DiscussionTopic' && module_item.content.checkpoints? item_restrictions ||= nil @module_item_image_tags ||= { 'indent' => "".html_safe, 'outdent' => "".html_safe, 'edit' => "".html_safe, 'quiz' => "".html_safe, 'delete' => "".html_safe, 'duplicate' => "".html_safe, 'copy_to' => "".html_safe, 'send_to' => "".html_safe, 'speed_grader' => "".html_safe, 'assign_to' => "".html_safe, 'move_to' => "".html_safe } menu_type_to_class = { :assignment_menu => Assignment, :discussion_topic_menu => DiscussionTopic, :file_menu => Attachment, :quiz_menu => Quizzes::Quiz, :wiki_page_menu => WikiPage } %>
  • " style="<%= hidden unless module_item %>" class=" context_module_item <%= 'student-view' if @is_student %> <% if module_item&.content&.respond_to?("can_duplicate?") %> <%= 'cannot-duplicate' if !module_item&.content&.can_duplicate?%> <% end %> <% if module_item&.content&.is_a?(Assignment) %> <% if !module_item.content.quiz_lti? || Account.site_admin.feature_enabled?(:commons_new_quizzes) %> <%= 'show_assignment_menu' %> <% end %> <% end %> <%= module_item.content_type_class(@is_student) if module_item %> <%= 'also_assignment' if module_item && module_item.graded? %> indent_<%= module_item.try_rescue(:indent) || '0' %> <%= 'progression_requirement' if criterion %> <%= criterion[:type] if criterion %>_requirement <%= module_item.item_class if module_item %> <%= 'dupeable' if module_item&.duplicate_able? %> " >
    <% if @can_edit || module_item.nil? %> <% end %> <%= module_item_translated_content_type(module_item, @is_student) %>
    <% if module_item && module_item.content_type == 'ContextModuleSubHeader' %>

    <% else %>
    <% end %> <% title = module_item&.title %> <% if module_item && module_item.content_type == 'ExternalUrl' && module_item.new_tab %> <% # FYI, this link gets opened via context_modules_helper.externalUrlLinkClick %> <%= title %> <% elsif !(module_item && module_item.content_type == 'ContextModuleSubHeader') %> " <% if item_data[:mastery_paths] && item_data[:mastery_paths][:locked] %> aria-describedby="module-item-locked-<%= module_item && module_item.id %>" <% end %> > <%= title %> <% if title && item_restrictions %> 🔒 <% end %> <% end %> <%= title %>
    <% if !@is_student && show_checkpoints %>
    <%end%>
    <% if module_item&.graded? && (!module_item.try_rescue(:assignment).restrict_quantitative_data?(@current_user, check_extra_permissions: true))%>
    <%end%>
    <% score_display = content_tag(:span, criterion && criterion[:min_score] || nbsp, class: 'min_score') %> <%= t 'min_score.unfulfilled', 'Score at least %{score}', :score => score_display %> <%= t 'Must score at least %{score} to complete this module item', :score => score_display %> <%= t 'min_score.fulfilled', 'Scored at least %{score}', :score => score_display %> <%= t 'Module item has been completed by scoring at least %{score}', :score => score_display %> <%= t('View') %> <%= t('Must view in order to complete this module item') %> <%= t('Viewed') %> <%= t('Module item has been viewed and is complete') %> <%= t 'Mark done' %> <%= t 'Must mark this module item done in order to complete' %> <%= t 'Marked done' %> <%= t 'Module item marked as done and is complete' %> <%= t('must_contribute.unfulfilled', 'Contribute') %> <%= t('Must contribute to this module item to complete it') %> <%= t('must_contribute.fulfilled', "Contributed") %> <%= t('Contributed to this module item and is complete') %> <%= t('must_submit.unfulfilled', 'Submit') %> <%= t('Must submit this module item to complete it') %> <%= t('must_submit.fulfilled', 'Submitted') %> <%= t('Module item submitted and is complete') %>
    <% if module_item && module_item.content_type == 'ContextModuleSubHeader' %>

    <% else %>
    <% end %> <% if !@can_view %>
    <%# going to set this in JS-land, not here %> <% end %> <% if @can_view || module_item.nil? || can_direct_share && module_item.direct_shareable? %>
    <% if @can_view || module_item.nil? %> <% end %>
    <%= t('Manage %{item_name}', {item_name: module_item && module_item.title ? module_item.title : 'item'}) %> <% if Account.site_admin.feature_enabled?(:additional_speedgrader_links) %> <% else %> <% end %>
    <% end %>
    <% if @is_student && @context.root_account.feature_enabled?(:discussion_checkpoints) && module_item && module_item.content_type == 'DiscussionTopic' && module_item.content.checkpoints? %>
    <% checkpoints = [module_item.content.reply_to_topic_checkpoint, module_item.content.reply_to_entry_checkpoint] %> <% checkpoints.each do |checkpoint| %>
    <% left_padding = case module_item.try_rescue(:indent) when 1 then "60px" when 2 then "80px" when 3 then "100px" when 4 then "120px" when 5 then "140px" else "40px" end %>
    <%= checkpoint.sub_assignment_tag == CheckpointLabels::REPLY_TO_TOPIC ? t("Reply to Topic") : t("Required Replies (%{number})", number: module_item.content.reply_to_entry_required_count) %>
    <% if checkpoint.overridden_for(@current_user).due_at %>
    <%= datetime_string(checkpoint.overridden_for(@current_user).due_at) %>
    <% end %>
    <% end %>
    <% end %>
  • <% if @is_student && @context.feature_enabled?(:peer_reviews_for_a2) && module_item && module_item.content_type == 'Assignment' %>
    <% end %>