Skip to content

Commit

Permalink
SAK-45507 Assignment improve the use of the submission status
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored and Miguel Pellicer committed Jul 5, 2021
1 parent 8de8b92 commit 4d2385e
Show file tree
Hide file tree
Showing 9 changed files with 490 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ public interface AssignmentService extends EntityProducer {
* @param submissionId
* @return
*/
public AssignmentConstants.SubmissionStatus getSubmissionCannonicalStatus(AssignmentSubmission s);
AssignmentConstants.SubmissionStatus getSubmissionCanonicalStatus(AssignmentSubmission submission, boolean canGrade);

/**
* @param submissionId
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4013,7 +4013,7 @@ private void processIfHasSubmission(AssignmentSubmission submission, boolean isN
resetNavOptions(flag);

// If the submission is actually a submission, set the appropriate flag and reference; return true
if (!AssignmentConstants.SubmissionStatus.NO_SUBMISSION.equals(assignmentService.getSubmissionCannonicalStatus(submission)) && submission.getUserSubmission()) {
if (!AssignmentConstants.SubmissionStatus.NO_SUBMISSION.equals(assignmentService.getSubmissionCanonicalStatus(submission, true)) && submission.getUserSubmission()) {
applyNavOption(flag, submission);
}
}
Expand All @@ -4030,7 +4030,7 @@ private void processIfHasUngradedSubmission(AssignmentSubmission submission, boo
resetNavOptions(flag);

// If the submisison is actually a submission and is ungraded, set the appropriate flag and reference; return true
if (!submission.getGraded() && !AssignmentConstants.SubmissionStatus.NO_SUBMISSION.equals(assignmentService.getSubmissionCannonicalStatus(submission)) && submission.getUserSubmission()) {
if (!submission.getGraded() && !AssignmentConstants.SubmissionStatus.NO_SUBMISSION.equals(assignmentService.getSubmissionCanonicalStatus(submission, true)) && submission.getUserSubmission()) {
applyNavOption(flag, submission);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ function printView(url) {
#end
#if ($!submission)## && $submission.submitted)
## SAK-17606
#set($submissionId = $submission.Id)
#set($anonymousSubmissionId = $submission.getId() + ' ' + ($tlang.getString("grading.anonymous.title")))

<tr>
Expand All @@ -420,13 +421,6 @@ function printView(url) {
</td>
<td headers="studentname">
#if ($taggable)
#if (!$!submission.submitted)
#set($submittedText = $!submission.submittedText)
#set($submittedAttachments = $submission.Attachments)
#if ($!submittedText.length() > 0 || $!submittedAttachments.size() > 0 )
#end
#end

#if ($value_CheckAnonymousGrading)
$anonymousSubmissionId
#else
Expand Down Expand Up @@ -468,13 +462,6 @@ function printView(url) {
#else
#if(!$disableGrade)
<a href="#toolLinkParam("AssignmentAction" "doGrade_submission" "assignmentId=$formattedText.escapeUrl($assignmentReference)&submissionId=$formattedText.escapeUrl($userSubmission.Reference)")" title="$tlang.getString("listsub.grasub")">
#if (!$!submission.submitted)
#set($submittedText = $!submission.submittedText)
#set($submittedAttachments = $submission.Attachments)
#if ($submittedText && !$submittedText.isEmpty() || $!submittedAttachments.size() > 0 )
#end
#end

#if ($value_CheckAnonymousGrading)
$anonymousSubmissionId
#else
Expand Down Expand Up @@ -515,11 +502,7 @@ function printView(url) {
#end
</td>
<td headers="status">
#if ($!submission && $submission.submitted)
$!service.getSubmissionStatus($submission.Id)
#elseif (!$!submission.submitted)
$tlang.getString("listsub.nosub")
#end
$!service.getSubmissionStatus($!submissionId)
</td>
#if ($assignment.AllowPeerAssessment)
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,10 @@
&nbsp;
</td>
<td headers="status">
#if ($!submission)
$!service.getSubmissionStatus($submission.Id)
#if ($submission)
#set($submissionId = $submission.Id)
#end
$!service.getSubmissionStatus($!submissionId)
&nbsp;
</td>
#if ($withGrade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,16 +473,10 @@
#if ($allowAddAssignment && $!view.equals('lisofass1'))
$!service.getAssignmentStatus($assignment.Id)
#else
#if ($!submission)
$!service.getSubmissionStatus($submission.Id)
#if ($submission.Submitted)
#if ($assignment.DueDate && $submission.DateSubmitted && $submission.DateSubmitted.isAfter($assignment.DueDate))
<span class="highlight">$tlang.getString("gen.late2")</span>
#end
#end
#else
$tlang.getString("gen.notsta")
#if ($submission)
#set ($submissionId = $submission.Id)
#end
<span class="highlight">$!service.getSubmissionStatus($!submissionId)</span>
#end
</td>
<td headers="openDate" class="hidden-xs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@
#if ($!assignment.IsGroup)
<span> - $tlang.getString("gen.groupassignment") </span>
#end
#if ($submission.Returned)
<span class="highlight"> - $tlang.getString("gen.returned")</span>
#elseif (!$submission.Submitted)
<span class="highlight"> - $!service.getSubmissionStatus($!submission.Id) </span>
#elseif (!$!nonElectronicType && $!submission.UserSubmission)
<span class="highlight"> - $tlang.getString("gen.subm4")</span>
#if ($submission)
#set($submissionId = $submission.Id)
#end
<span class="highlight"> - $!service.getSubmissionStatus($!submissionId)</span>
</h3>
#if (!$!nonElectronicType)
#progressBar($!service.getProgressBarStatus($!submission))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,9 @@ $(document).ready(function(){
#else
<h3>
$formattedText.escapeHtml($assignment.Title)
#if(!$submitted)
<span class="highlight">
- $!service.getSubmissionStatus($!submission.Id)
</span>
#end
#if ($dateReturned && $dateSubmitted && $dateReturned.isAfter($dateSubmitted))
<span class="highlight">
- $tlang.getString("resubmit")
</span>
#end
<span class="highlight">
- $!service.getSubmissionStatus($submission.Id)
</span>
</h3>
#end
#if ($returned)
Expand Down

0 comments on commit 4d2385e

Please sign in to comment.