Skip to content

Commit

Permalink
SAM-3254 Student waiting until after due date and then starting asses…
Browse files Browse the repository at this point in the history
…sment should not create new submission (sakaiproject#4786)
  • Loading branch information
josecebe authored and ottenhoff committed Sep 12, 2017
1 parent 82488bb commit a223287
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3409,7 +3409,7 @@ private boolean isAvailable(){
return isAvailable;
}

private boolean pastDueDate(){
public boolean pastDueDate(){
boolean pastDue = true;
Date currentDate = new Date();
Date dueDate;
Expand All @@ -3424,7 +3424,7 @@ private boolean pastDueDate(){
return pastDue;
}

private boolean isAcceptLateSubmission() {
public boolean isAcceptLateSubmission() {
boolean acceptLateSubmission = AssessmentAccessControlIfc.ACCEPT_LATE_SUBMISSION.equals(publishedAssessment.getAssessmentAccessControl().getLateHandling());
//If using extended Time Delivery, the late submission setting is based on retracted
if (extendedTimeDeliveryService.hasExtendedTime()) {
Expand All @@ -3434,7 +3434,7 @@ private boolean isAcceptLateSubmission() {
return acceptLateSubmission;
}

private boolean isRetracted(boolean isSubmitForGrade){
public boolean isRetracted(boolean isSubmitForGrade){
boolean isRetracted = true;
Date currentDate = new Date();
Date retractDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@ public void processAction(ActionEvent ae) throws
// there is no action needed (the outcome is set in BeginDeliveryActionListener).
return;
}

if (delivery.pastDueDate()){
if (delivery.isAcceptLateSubmission()) {
if(delivery.getTotalSubmissions() > 0) {
// Not during a Retake
if (delivery.getActualNumberRetake() == delivery.getNumberRetake()) {
return;
}
}
} else {
if(delivery.isRetracted(false)){
return;
}
}
}
// Clear elapsed time, set not timed out
clearElapsedTime(delivery);

Expand Down

0 comments on commit a223287

Please sign in to comment.