Skip to content

Commit

Permalink
SAK-43073 handle scenario where extended due date has passed and asse… (
Browse files Browse the repository at this point in the history
  • Loading branch information
ottenhoff authored Nov 10, 2020
1 parent 250a46a commit 7cde30d
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3065,21 +3065,29 @@ public int autoSubmitAssessments() {
Date dueDate = assessment.getAssessmentAccessControl().getDueDate();
Date retractDate = assessment.getAssessmentAccessControl().getRetractDate();
Integer lateHandling = assessment.getAssessmentAccessControl().getLateHandling();
boolean acceptLate = AssessmentAccessControlIfc.ACCEPT_LATE_SUBMISSION.toString().equals(lateHandling);
ExtendedTimeDeliveryService assessmentExtended = new ExtendedTimeDeliveryService(assessment,
adata.getAgentId());

//If it has extended time, just continue for now, no method to tell if the time is passed
if (assessmentExtended.hasExtendedTime()) {
//Continue on and try to submit it but it may be late, just change the due date
dueDate = assessmentExtended.getDueDate() != null ? assessmentExtended.getDueDate() : dueDate;
retractDate = assessmentExtended.getRetractDate() != null ? assessmentExtended.getRetractDate() : retractDate;

// If the extended time student received a retract date
if (assessmentExtended.getRetractDate() != null) {
retractDate = assessmentExtended.getRetractDate();
acceptLate = true;
}
}

//If the due date or retract date hasn't passed yet, go on to the next one, don't consider it yet
if ((AssessmentAccessControlIfc.ACCEPT_LATE_SUBMISSION.toString().equals(lateHandling) && retractDate!=null && (currentTime.before(retractDate) || adata.getAttemptDate().after(retractDate)))
|| (dueDate != null && currentTime.before(dueDate))) {
// If the due date or retract date hasn't passed yet, go on to the next one, don't consider it yet
if (acceptLate && retractDate != null && (currentTime.before(retractDate) || adata.getAttemptDate().after(retractDate))) {
continue;
}
else if ( (!acceptLate || retractDate == null) && dueDate != null && currentTime.before(dueDate)) {
continue;
}

adata.setForGrade(Boolean.TRUE);
if (adata.getTotalAutoScore() == null) {
Expand Down

0 comments on commit 7cde30d

Please sign in to comment.