diff --git a/app/jsx/grading/GradeSummary.js b/app/jsx/grading/GradeSummary.js index 36937f39acc..e224139424a 100644 --- a/app/jsx/grading/GradeSummary.js +++ b/app/jsx/grading/GradeSummary.js @@ -196,6 +196,10 @@ const GradeSummary = { const score = GradeSummary.getOriginalScore($assignment) let title + if (score.numericalValue == null) { + score.formattedValue = GradeSummary.parseScoreText(null).formattedValue + } + if ($assignment.data('muted')) { if (ENV.post_policies_enabled) { title = I18n.t('Hidden') diff --git a/app/presenters/grade_summary_assignment_presenter.rb b/app/presenters/grade_summary_assignment_presenter.rb index da418d39c73..d5811485da4 100644 --- a/app/presenters/grade_summary_assignment_presenter.rb +++ b/app/presenters/grade_summary_assignment_presenter.rb @@ -52,13 +52,14 @@ class GradeSummaryAssignmentPresenter (submission.present? ? @summary.unread_submission_ids.include?(submission.id) : false) end - def posted_to_student? - assignment.course&.post_policies_enabled? ? submission.posted? : !assignment.muted? + def hide_grade_from_student? + return assignment.muted? unless assignment.course&.post_policies_enabled? + assignment.post_manually? ? !submission.posted? : (submission.graded? && !submission.posted?) end def graded? return false if submission.blank? - (submission.grade || submission.excused?) && posted_to_student? + (submission.grade || submission.excused?) && !hide_grade_from_student? end def is_letter_graded? @@ -82,7 +83,7 @@ class GradeSummaryAssignmentPresenter end def has_no_score_display? - !posted_to_student? || submission.nil? + hide_grade_from_student? || submission.nil? end def original_points @@ -99,12 +100,12 @@ class GradeSummaryAssignmentPresenter def has_scoring_details? return false unless submission&.score.present? && assignment&.points_possible.present? - assignment.points_possible > 0 && posted_to_student? + assignment.points_possible > 0 && !hide_grade_from_student? end def has_grade_distribution? return false if assignment&.points_possible.blank? - assignment.points_possible > 0 && posted_to_student? + assignment.points_possible > 0 && !hide_grade_from_student? end def has_rubric_assessments? diff --git a/app/presenters/grade_summary_presenter.rb b/app/presenters/grade_summary_presenter.rb index a448f03cb9c..f3a093bc4b6 100644 --- a/app/presenters/grade_summary_presenter.rb +++ b/app/presenters/grade_summary_presenter.rb @@ -234,7 +234,10 @@ class GradeSummaryPresenter def hidden_submissions? if @context.post_policies_enabled? - !submissions.all?(&:posted?) + submissions.any? do |sub| + return !sub.posted? if sub.assignment.post_manually? + sub.graded? && !sub.posted? + end else assignments.any?(&:muted?) end diff --git a/app/views/gradebooks/grade_summary.html.erb b/app/views/gradebooks/grade_summary.html.erb index aae243dfbdb..2d8a43b0e60 100644 --- a/app/views/gradebooks/grade_summary.html.erb +++ b/app/views/gradebooks/grade_summary.html.erb @@ -148,7 +148,7 @@ can_view_distribution = can_do(@context, @current_user, :read_as_admin) || !assignment_presenter.hide_distribution_graphs? %>