<% # 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 . %> <% presenter = Submission::ShowPresenter.new( submission: @submission, current_user: @current_user, assessment_request: @assessment_request, current_host: request.host ) submission_comments = @submission.visible_submission_comments_for(@current_user) if presenter.anonymize_submission_owner? submission_owner_param = {anonymous_id: @submission.anonymous_id} rubric_assessment_user_param = {anonymous_id: @submission.anonymous_id} else submission_owner_param = {user_id: @submission.user_id} rubric_assessment_user_param = {assessment_user_id: @submission.user_id} end assessment_type = if !presenter.currently_peer_reviewing? && can_do(@submission, @current_user, :grade) "grading" else "peer_review" end show_updated_plagiarism_icons = @assignment.context.root_account.feature_enabled?(:new_gradebook_plagiarism_indicator) js_env({ GRADING_TYPE: @assignment.grading_type, RUBRIC_ASSESSMENT: { assessment_type: assessment_type, assessor_id: @current_user ? @current_user.id : "null", **rubric_assessment_user_param }, SUBMISSION: { assignment_id: @assignment.id, # don't leak grades if submission is not posted points_possible: @assignment.points_possible, # score below is useless without points possible submission: if @submission.user_can_read_grade?(@current_user, session) @submission.attributes.merge( entered_grade: presenter.entered_grade, entered_score: @submission.entered_score ) else {} end, **submission_owner_param }, :CUSTOM_GRADE_STATUSES => @assignment.course.custom_grade_statuses.as_json(include_root: false) }) provide :page_title, join_title(@assignment.title, submission_author_name_for(@assessment_request)) provide_blank :right_side %> <% if @assignment.omit_from_final_grade %>
This assignment does not count towards the final grade.
<% end %>

<%= @assessment_request ? t('peer_review', "Peer Review") : t('submission_details', "Submission Details") %>

<% if @submission.user_can_read_grade?(@current_user, session) %> <% if can_do(@assignment, @current_user, :grade) || @submission.user_can_read_grade?(@current_user, session) points_deducted = I18n.n([email protected]_deducted) if @submission.points_deducted&.> 0 points_possible = I18n.n(round_if_whole(@assignment.points_possible)) grade_breakdown_style = hidden unless points_deducted && [email protected]? %> <% end %>
<% if can_do(@assignment, @current_user, :grade) %> <%= render :partial => "gradebooks/grading_box", :object => @assignment, :locals => {:submission => @submission} %> <% else %> <% if @submission.excused? %> <%= t "Excused" %> <% else %> <%= i18n_grade(round_if_whole(presenter.entered_grade), @submission.grading_type) %> <% end %> <% end %> <% if [email protected]? && @assignment.grading_type == 'points' && @assignment.points_possible && [email protected]_quantitative_data?(@current_user) %> <%= t('/ %{points_possible}', points_possible: I18n.n(round_if_whole @assignment.points_possible))%> <% end %>
<%= I18n.t('Late penalty:') %> <%= points_deducted %>
<%= I18n.t('Final grade:') %> <% if can_do(@assignment, @current_user, :grade) %> <%= i18n_grade(round_if_whole(@submission.grade), @submission.grading_type) %> <% elsif @submission.user_can_read_grade?(@current_user, session) %> <%= i18n_grade(round_if_whole(@submission.published_grade), @submission.grading_type) %> <% end %> <% if @assignment.grading_type == 'points' %> / <%= points_possible %> <% end %>
<% if can_do(@submission, @current_user, :view_turnitin_report) %> <% if (turnitin_score = @submission.turnitin_data[@submission.asset_string]) && @submission.turnitin_data[:provider] == nil && turnitin_score[:similarity_score] %> <% if show_updated_plagiarism_icons %> <%= render partial: 'shared/originality_score_icon', locals: { plagiarism_data: turnitin_score, report_url: context_url(@context, :context_assignment_submission_turnitin_report_url, @submission.assignment_id, @submission.user_id, @submission.asset_string), } %> <% else %> <%= turnitin_score[:similarity_score] %>% <% end %> <% end %> <% end %> <% elsif @submission.hide_grade_from_student? %>

<%= t(:student_mute_notification, "Grades are unavailable because the instructor is working on them.") %>

<% end %> <% if @submission.can_view_plagiarism_report('vericite', @current_user, session) && @submission.posted? %> <% if (vericite_score = @submission.vericite_data(true)[@submission.asset_string]) && @submission.turnitin_data[:provider] == :vericite && vericite_score[:similarity_score] %> <% if show_updated_plagiarism_icons %> <%= render partial: 'shared/originality_score_icon', locals: { plagiarism_data: vericite_score, report_title: t("Similarity score -- more information"), report_url: context_url(@context, :context_assignment_submission_vericite_report_url, @submission.assignment_id, @submission.user_id, @submission.asset_string), tooltip_text: t("See VeriCite results") } %> <% else %> <%= vericite_score[:similarity_score] %>% <%= t(:see_vericite_results, "See VeriCite results") %> <% end %> <% end %> <% end %> <% if @assignment.active_rubric_association? && ( @submission.user_can_read_grade?(@current_user, session) || @assignment.rubric_association.user_can_assess_for?(assessor: @current_user, assessee: @submission.user) || @assignment.rubric_association.user_did_assess_for?(assessor: @current_user, assessee: @submission.user) || can_do(@assignment.rubric, @current_user, :read) ) %> <% unread_comments = @current_user.unread_rubric_assessments?(@submission) %>
<%= t('show_rubric', 'Show Rubric') %> <% if unread_comments %> <% js_env mark_rubric_comments_read_url: api_v1_course_submission_rubric_assessments_mark_read_url(@context.id, @assignment.id, @submission.user.id) %> <% end %>
<% end %>

<%= @assignment.title %>

<%= submission_author_name_for @assessment_request %> <%= t('submitted_at', 'submitted %{submit_date}', :submit_date => datetime_string(@submission.submitted_at)) %> <% if @submission.proxy_submitter %>
<%= I18n.t("Submitted by: %{name}", name: @submission.proxy_submitter.short_name) %> <% end %>
<% if @submission.custom_grade_status %> <% elsif @submission.late? %> <% elsif @submission.missing? %> <% elsif @submission.extended? %> <% end %> <% if @assignment.allowed_attempts&.> 0 %>
<%= t :attempts, 'Attempts' %> <%= @submission.attempt || 0 %>
<%= t :allowed_attempts, 'Allowed Attempts' %> <%= @assignment.allowed_attempts + (@submission.extra_attempts || 0) %>
<% end %>
<% if can_do(@context, @current_user, :grade) %> <%= t('speedgrader', 'SpeedGrader') %> <% end %> <% if @assignment.expects_submission? && can_do(@assignment, @current_user, :submit) && @current_user == @submission.user %> > <%= @submission.has_submission? ? t('links.resubmit', "Re-submit Assignment") : t('links.submit', "Submit Assignment") %> <% end %>
<% if @assessment_request %>
<%= t('peer_review_steps_complete', 'You have finished the required steps for this peer review.') %>
<% hide_assessment_instructions = @assessment_request.completed? || @assessment_request.active_rubric_association? %>
<%= mt('peer_review_not_done', "**This peer review is not finished yet.** For it to be considered finished, you need to leave at least one comment.") %>
<% end %>
<% if @assignment.active_rubric_association? %> <% @visible_rubric_assessments ||= [] %> <% end %>
<% unless @submission.user_can_read_grade?(@current_user, session) %> <% if @submission.hide_grade_from_student? %> <%= t('only_see_your_own_comments_muted', "You may not see all comments right now because the assignment is currently being graded") %> <% elsif @submission.peer_reviewer?(@current_user)%> <%= t('only_see_your_own_comments_peer', "As a peer reviewing student, you will only see comments written by you.") %> <% end %>

<% end %> <% submission_comments.each do |comment| %> <% if can_do(comment, @current_user, :read) %> <% author_name = comment_author_name_for(comment) created_at = datetime_string(comment.created_at) %>
<% if comment.media_comment_id %>
<%= t( "This is a media comment, *click here to view*.", wrapper: "
\1.") %>
<% end %>
<% comment.attachments.each do |attachment| %> <% end %>
<%= author_name %> , <%= created_at %>
<% end %> <% end %>
<% unless @context.account.grants_right?(@current_user, :make_submission_comments) %>
<% if @assignment.has_group_category? && can_do(@submission, @current_user, :make_group_comment) %> <% if @assignment.grade_as_group? %> <%= t("All comments are sent to the whole group.") %> <% else %>
<% end %> <% end %>
<% end %>
<% js_env :rubricAssessments => @visible_rubric_assessments.as_json(:include => :assessor, :permissions => {:user => @current_user, :session => session}) %>