Skip to content

Commit

Permalink
SAK-50903 Creating a new assignment and putting it to site users crea…
Browse files Browse the repository at this point in the history
…tes an asn.new.assignment event, but this does not happen when putting it to selected groups.
  • Loading branch information
susowrc committed Jan 28, 2025
1 parent b9e5060 commit e2fbfa7
Showing 1 changed file with 6 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9100,24 +9100,13 @@ private void post_save_assignment(RunData data, String postOrSave) {
}

if ((newAssignment && !a.getDraft()) || (!a.getDraft() && !newAssignment)) {

Collection aGroups = a.getGroups();
if (aGroups.size() != 0) {
// If already open
if (openTime.isBefore(Instant.now())) {
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_UPDATE_ASSIGNMENT_ACCESS, assignmentReference, true));
} else {
// Not open yet, delay the event
eventTrackingService.delay(eventTrackingService.newEvent(AssignmentConstants.EVENT_AVAILABLE_ASSIGNMENT, assignmentReference,
true), openTime);
}
// If already open
if (openTime.isBefore(Instant.now())) {
// post new assignment event since it is fully initialized by now
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_ADD_ASSIGNMENT, assignmentReference, true));
} else {
if (openTime.isBefore(Instant.now())) {
// post new assignment event since it is fully initialized by now
eventTrackingService.post(eventTrackingService.newEvent(AssignmentConstants.EVENT_ADD_ASSIGNMENT, assignmentReference, true));
} else {
eventTrackingService.delay(eventTrackingService.newEvent(AssignmentConstants.EVENT_AVAILABLE_ASSIGNMENT, assignmentReference, true), openTime);
}
// Not open yet, delay the event
eventTrackingService.delay(eventTrackingService.newEvent(AssignmentConstants.EVENT_AVAILABLE_ASSIGNMENT, assignmentReference, true), openTime);
}
}
}
Expand Down

0 comments on commit e2fbfa7

Please sign in to comment.