Skip to content

Commit

Permalink
SAK-40551: Assignment that has been saved and release to student, the…
Browse files Browse the repository at this point in the history
… grade is not shown in a student without a submission (sakaiproject#5949)
  • Loading branch information
jesusmmp authored and ern committed Sep 5, 2018
1 parent e4e4daa commit 5b800e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,7 @@
<td class="highlight">
<strong>
#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
Expand Down

0 comments on commit 5b800e3

Please sign in to comment.