Skip to content

Commit

Permalink
SAK-46470 Assignments : avoid wrong calls showing log warn (sakaiproj…
Browse files Browse the repository at this point in the history
…ect#9969)

All the other calls to this method are already under these kind of checks.
  • Loading branch information
bgarciaentornos authored Nov 2, 2021
1 parent cc3a3b0 commit 205e77d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3576,8 +3576,6 @@ private String build_instructor_preview_assignment_context(VelocityPortlet portl
context.put("value_ContentTitle", state.getAttribute(NEW_ASSIGNMENT_CONTENT_TITLE));
context.put("value_ContentLaunchNewWindow", state.getAttribute(NEW_ASSIGNMENT_CONTENT_LAUNCH_NEW_WINDOW));
context.put("value_GradeType", state.getAttribute(NEW_ASSIGNMENT_GRADE_TYPE));
String maxGrade = (String) state.getAttribute(NEW_ASSIGNMENT_GRADE_POINTS);
context.put("value_GradePoints", displayGrade(state, maxGrade, assignmentService.getScaleFactor()));
context.put("value_Description", state.getAttribute(NEW_ASSIGNMENT_DESCRIPTION));
context.put("value_CheckAddDueDate", state.getAttribute(ResourceProperties.NEW_ASSIGNMENT_CHECK_ADD_DUE_DATE));
context.put("value_CheckHideDueDate", state.getAttribute(NEW_ASSIGNMENT_CHECK_HIDE_DUE_DATE));
Expand Down Expand Up @@ -3622,6 +3620,7 @@ private String build_instructor_preview_assignment_context(VelocityPortlet portl
context.put("value_CheckAnonymousGrading", assignmentService.assignmentUsesAnonymousGrading(a));
context.put("isDraft", a.getDraft());
if (a.getTypeOfGrade() == SCORE_GRADE_TYPE) {
String maxGrade = (String) state.getAttribute(NEW_ASSIGNMENT_GRADE_POINTS);
context.put("value_GradePoints", displayGrade(state, maxGrade, a.getScaleFactor()));
}
}
Expand Down Expand Up @@ -3710,6 +3709,10 @@ protected String build_instructor_grade_submission_context(VelocityPortlet portl
Map<String, Reference> attachmentReferences = new HashMap<>();
a.getAttachments().forEach(r -> attachmentReferences.put(r, entityManager.newReference(r)));
context.put("assignmentAttachmentReferences", attachmentReferences);

if (a.getTypeOfGrade() == SCORE_GRADE_TYPE) {
context.put("value_grade", displayGrade(state, (String) state.getAttribute(GRADE_SUBMISSION_GRADE), scaleFactor));
}
}

String submissionRef = (String) state.getAttribute(GRADE_SUBMISSION_SUBMISSION_ID);
Expand Down Expand Up @@ -3830,8 +3833,6 @@ protected String build_instructor_grade_submission_context(VelocityPortlet portl
context.put("value_feedback_text", state.getAttribute(GRADE_SUBMISSION_FEEDBACK_TEXT));
context.put("value_feedback_attachment", state.getAttribute(ATTACHMENTS));
context.put("value_CheckAnonymousGrading", assignmentService.assignmentUsesAnonymousGrading(assignment.get()));
context.put("value_grade", displayGrade(state, (String) state.getAttribute(GRADE_SUBMISSION_GRADE), scaleFactor));


// is this a non-electronic submission type of assignment
context.put("nonElectronic", (assignment.isPresent() && assignment.get().getTypeOfSubmission() == Assignment.SubmissionType.NON_ELECTRONIC_ASSIGNMENT_SUBMISSION) ? Boolean.TRUE : Boolean.FALSE);
Expand Down

0 comments on commit 205e77d

Please sign in to comment.