From 5b800e3d8b9dd10c8ba3e7e3630b7910478584e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Mar=C3=ADa=20M=C3=A9ndez=20P=C3=A9rez?= Date: Wed, 5 Sep 2018 17:02:37 +0200 Subject: [PATCH] SAK-40551: Assignment that has been saved and release to student, the grade is not shown in a student without a submission (#5949) --- .../assignment/tool/AssignmentAction.java | 15 ++++++--------- .../chef_assignments_student_view_grade.vm | 6 +----- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java b/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java index c94e361c85e1..153695c0b2b7 100644 --- a/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java +++ b/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java @@ -1513,19 +1513,13 @@ private String build_student_view_submission_context(VelocityPortlet portlet, Co if (s != null) { log.debug("BUILD SUBMISSION FORM HAS SUBMISSION FOR USER {}", user); context.put("submission", s); + String currentUser = userDirectoryService.getCurrentUser().getId(); + String grade = assignmentService.getGradeForSubmitter(s, currentUser); + context.put("grade", grade); if (assignment.getIsGroup()) { context.put("selectedGroup", s.getGroupId()); context.put("originalGroup", s.getGroupId()); context.put("submitterId", s.getGroupId()); - - String currentUser = userDirectoryService.getCurrentUser().getId(); - - String gradeOverride = assignmentService.getGradeForSubmitter(s, currentUser); - - // if still no grade then there is no override - if (gradeOverride != null) { - context.put("override", gradeOverride); - } } setScoringAgentProperties(context, assignment, s, false); @@ -2034,6 +2028,9 @@ protected String build_student_preview_submission_context(VelocityPortlet portle AssignmentSubmission submission = getSubmission(aReference, user, "build_student_preview_submission_context", state); if (submission != null) { context.put("submission", submission); + String currentUser = userDirectoryService.getCurrentUser().getId(); + String grade = assignmentService.getGradeForSubmitter(submission, currentUser); + context.put("grade", grade); context.put("submissionReference", AssignmentReferenceReckoner.reckoner().submission(submission).reckon().getReference()); } diff --git a/assignment/tool/src/webapp/vm/assignment/chef_assignments_student_view_grade.vm b/assignment/tool/src/webapp/vm/assignment/chef_assignments_student_view_grade.vm index 114a7785c245..db9db6021d35 100644 --- a/assignment/tool/src/webapp/vm/assignment/chef_assignments_student_view_grade.vm +++ b/assignment/tool/src/webapp/vm/assignment/chef_assignments_student_view_grade.vm @@ -130,11 +130,7 @@ #if ($!assignment.TypeOfGrade.ordinal() != 1) - #if ($!override) - $!service.getGradeDisplay($override, $!assignment.TypeOfGrade, $!assignment.ScaleFactor) - #else - $!service.getGradeDisplay($!submission.Grade, $!assignment.TypeOfGrade, $!assignment.ScaleFactor) - #end + $!grade #else $tlang.getString("gen.nograd") #end