Skip to content

Commit

Permalink
SAK-33365 Assignments Student Submission Confirmation template fixes (s…
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored Sep 15, 2017
1 parent 89bc29d commit 3f1a9b1
Show file tree
Hide file tree
Showing 2 changed files with 199 additions and 201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,6 @@ private String build_student_view_submission_confirmation_context(VelocityPortle
Assignment currentAssignment = getAssignment(currentAssignmentReference, "build_student_view_submission_confirmation_context", state);
if (currentAssignment != null) {
context.put("assignment", currentAssignment);
context.put("assignment_title", currentAssignment.getTitle());

// differenciate submission type
Assignment.SubmissionType submissionType = currentAssignment.getTypeOfSubmission();
Expand All @@ -1787,20 +1786,14 @@ private String build_student_view_submission_confirmation_context(VelocityPortle
context.put("textSubmissionOnly", Boolean.FALSE);
}

context.put("submissionType", submissionType.ordinal());

AssignmentSubmission s = getSubmission(currentAssignmentReference, submitter, "build_student_view_submission_confirmation_context", state);
if (s != null) {
context.put("submission", s);
context.put("submitted", Boolean.valueOf(s.getSubmitted()));
context.put("submission_id", s.getId());
if (s.getDateSubmitted() != null) {
context.put("submit_time", s.getDateSubmitted().toInstant().toString());
}
Set<String> attachments = s.getAttachments();
if (attachments != null && !attachments.isEmpty()) {
context.put("submit_attachments", attachments);
}

Map<String, Reference> attachmentReferences = new HashMap<>();
s.getAttachments().forEach(r -> attachmentReferences.put(r, entityManager.newReference(r)));
context.put("attachmentReferences", attachmentReferences);

context.put("submit_text", StringUtils.trimToNull(s.getSubmittedText()));
context.put("email_confirmation", serverConfigurationService.getBoolean("assignment.submission.confirmation.email", true));
}
Expand Down Expand Up @@ -15410,4 +15403,4 @@ public void setSubmissionTimestamp(String timeStamp) {
m_timeStamp = timeStamp;
}
}
}
}
Loading

0 comments on commit 3f1a9b1

Please sign in to comment.