<% # 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 . %> <% cache([ 'submission_sidebar_render2', @current_user.id, @current_user_submission, Time.zone.utc_offset, @assigned_assessments.count, @assigned_assessments.count(&:incomplete?), @assignment.anonymous_peer_reviews ? 1 : 0 ].cache_key) do %>

<%= t 'titles.submission', "Submission" %>

<% if @current_user_submission.excused? %>
<%= t "Excused!" %>
<% elsif @assignment.expects_submission? %>
<% if @current_user_submission.has_submission? %> <%= t 'titles.submission_turned_in', "Submitted!" %> <% else %> <%= t 'titles.submission_not_turned_in', "Not Submitted!" %> <% end %>
<% end %>
"> <% if @current_user_submission.late? %> <%= t 'messages.submission_late_timestamp', "%{submitted_at} (late)", :submitted_at => datetime_string(@current_user_submission.submitted_at) %> <% else %> <%= datetime_string(@current_user_submission.submitted_at) %> <% end %>
<%= t 'links.submission.details', "Submission Details" %>
<% if @current_user_submission.submission_type == "online_url" %>
<%= t 'links.submission.view_original_page', "View the Original Page" %>
<% elsif @current_user_submission.submission_type == "online_upload" %> <% @current_user_submission.attachments.each do |attachment| %>
<%= t 'links.submission.download_attachment', "Download %{attachment_display_name}", { :attachment_display_name => attachment.display_name } %>
<% js_bundle :progress_pill %> <% end %> <% elsif @current_user_submission.submission_type == "online_quiz" %> <%= @assignment.quiz.survey? ? t('links.submission.view_survey', "View the Survey Submission") : t('links.submission.view_quiz', "View the Quiz Submission") %> <% end %>
<% if @current_user_submission.grade && !@current_user_submission.hide_grade_from_student? %> <% if @current_user_submission.excused? %> <%= t "This assignment has been excused." %> <% else %>
<%= t 'labels.grade', "Grade: %{grade} *(%{points_possible} pts possible)*", { :grade => i18n_grade(@current_user_submission.grade, @assignment.grading_type), :points_possible => n(round_if_whole(@assignment.points_possible)), :wrapper => '\1' } %>
<%= t 'labels.graded_anonymously', "Graded Anonymously: %{value}", { :value => @current_user_submission.graded_anonymously ? t('labels.yes', "yes") : t('labels.no', "no") } %>
<% end %> <% end %> <% if @current_user_submission.rubric_assessment %> <%= t 'links.view_rubric_evaluation', "View Rubric Evaluation" %> <% end %>
<% if @assignment.has_peer_reviews? && @current_user_submission.user == @current_user %>

<%= t 'titles.assigned_peer_reviews', "Assigned Peer Reviews" %>

  • <%= t 'labels.none_assigned', "None Assigned" %>
  • <% @assigned_assessments.each do |assessment| %>
  • <%= student_peer_review_link_for @context, @assignment, assessment %>
  • <% end %>
<% end %>
<% if @current_user_submission.hide_grade_from_student? %>

<%= t 'You may not see all comments right now because the assignment is currently being graded.' %>

<% else %>

<%= t 'titles.comments', "Comments:" %>

<% visible_comments = @current_user_submission.visible_submission_comments -%> <%= t('messages.no_comments', "No Comments") if visible_comments.empty? %> <% visible_comments.each do |comment| %>
<%= comment.comment %>
<% comment.attachments.each do |attachment| %> <% end %>
<%= t :comment_signature, "%{author}, %{created_at}", { :author => comment_author_name_for(comment), :created_at => datetime_string(comment.created_at) } %>
<% end %> <% end %>
<% end %>