%
# 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 .
%>
<% css_bundle :submission %>
<% user_name = params[:hide_student_name] ? t(:anonymous_username, "This Student") : submission_author_name_for(@assessment_request) %>
<% show_updated_plagiarism_icons = @context.root_account.feature_enabled?(:new_gradebook_plagiarism_indicator) %>
<% provide :page_title do %><%= join_title @assignment.title, t("Submission Preview") %><% end %>
<% if @assignment.submission_types == 'discussion_topic' && @assignment.discussion_topic %>
<% if assignment_visible_to_user = @assignment.visible_to_user?(@current_user)%>
<% if @assignment.discussion_topic.for_group_discussion? && (group = @assignment.discussion_topic.group_category.group_for(@user)) %>
<%= t('group_discussion_submission_description',
"The submissions for this assignment are posts in the assignment's discussion for this group. Below are the discussion posts for %{user}, or you can *view the full group discussion*.",
:user => user_name,
:wrapper => " @assignment.discussion_topic.id, :hide_student_names => params[:hide_student_name], :student_id => @submission.user.id, :headless => 1)}\">\\1") %>
<% else %>
<%= t('discussion_submission_description',
"The submissions for this assignment are posts in the assignment's discussion. Below are the discussion posts for %{user}, or you can *view the full discussion*.",
:user => user_name,
:wrapper => " params[:hide_student_name], :student_id => @submission.user.id, :headless => 1)}\">\\1") %>
<% end %>
<% else %>
<% if @assignment.discussion_topic.for_group_discussion? && (group = @assignment.discussion_topic.group_category.group_for(@user)) %>
<%= t('group_discussion_submission_description_without_link',
"The submissions for this assignment are posts in the assignment's discussion for this group. Below are the discussion posts for %{user}.",
:user => user_name) %>
<% else %>
<%= t('discussion_submission_description_without_link',
"The submissions for this assignment are posts in the assignment's discussion. Below are the discussion posts for %{user}.",
:user => user_name) %>
<% end %>
<% end %>
<% image = @submission.attachment if @submission.processed? %>
<%= t('external_url_submission', 'This submission was a URL to an external page.') %>
<% if image %>
<%= t('entry_with_image', "We've included a snapshot of what the page looked like when it was submitted.") %>
<% else %>
<%= t('entry_no_image', 'Keep in mind that this page may have changed since the submission originally occurred.') %>
<% end %>
<% end %>
<% end %>
<% js_bundle 'legacy/submissions_show_preview_upload' %>
<% elsif @submission.submission_type == "online_quiz" %>
<%= t('quiz_submission', 'This submission was a quiz submission. Redirecting to quiz page.') %>
<% elsif @submission.submission_type == 'media_recording' && @submission.media_comment_id %>
<%= t('media_comment_link', "This submission is a media recording. *click here to view.*", :wrapper => '