Skip to content

Commit

Permalink
SAK-33480 Assignments Student Submission Preview template (sakaiproje…
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored Oct 19, 2017
1 parent a4a9fff commit dc08095
Show file tree
Hide file tree
Showing 2 changed files with 193 additions and 187 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1895,11 +1895,15 @@ protected String build_student_preview_submission_context(VelocityPortlet portle
Assignment assignment = getAssignment(aReference, "build_student_preview_submission_context", state);
if (assignment != null) {
context.put("assignment", assignment);
context.put("assignmentReference", AssignmentReferenceReckoner.reckoner().assignment(assignment).reckon().getReference());
context.put("typeOfGradeString", getTypeOfGradeString(assignment.getTypeOfGrade()));
context.put("canSubmit", assignmentService.canSubmit((String) state.getAttribute(STATE_CONTEXT_STRING), assignment));

AssignmentSubmission submission = getSubmission(aReference, user, "build_student_preview_submission_context", state);
context.put("submission", submission);

context.put("canSubmit", assignmentService.canSubmit((String) state.getAttribute(STATE_CONTEXT_STRING), assignment));
if (submission != null) {
context.put("submission", submission);
context.put("submissionReference", AssignmentReferenceReckoner.reckoner().submission(submission).reckon().getReference());
}

setScoringAgentProperties(context, assignment, submission, false);

Expand All @@ -1921,7 +1925,6 @@ protected String build_student_preview_submission_context(VelocityPortlet portle
context.put("returnedFeedback", Boolean.TRUE);
state.removeAttribute(RETURNED_FEEDBACK);
}

}

context.put("text", state.getAttribute(PREVIEW_SUBMISSION_TEXT));
Expand All @@ -1934,8 +1937,7 @@ protected String build_student_preview_submission_context(VelocityPortlet portle
return template + TEMPLATE_STUDENT_PREVIEW_SUBMISSION;
} // build_student_preview_submission_context

private void canViewAssignmentIntoContext(Context context,
Assignment assignment, AssignmentSubmission submission) {
private void canViewAssignmentIntoContext(Context context, Assignment assignment, AssignmentSubmission submission) {
boolean canViewModelAnswer = assignmentSupplementItemService.canViewModelAnswer(assignment, submission);
context.put("allowViewModelAnswer", Boolean.valueOf(canViewModelAnswer));
if (canViewModelAnswer) {
Expand Down
Loading

0 comments on commit dc08095

Please sign in to comment.