-
-
Notifications
You must be signed in to change notification settings - Fork 999
SAK-51239 Samigo adjust late acceptance logic when extended time is enabled and retractDate is empty #14247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughUpdated DeliveryBean.isAcceptLateSubmission() so that when extended-time delivery is active, late submissions are accepted if the assessment is not retracted; previous behavior for non-null Changes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| if (extendedTimeDeliveryService.hasExtendedTime()) { | ||
| //Accept it if it's not retracted on the extended time entry | ||
| acceptLateSubmission = (extendedTimeDeliveryService.getRetractDate() != null) ? !isRetracted(false) : false; | ||
| acceptLateSubmission = (extendedTimeDeliveryService.getRetractDate() != null) ? !isRetracted(false) : true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor but this ternary is not needed
| acceptLateSubmission = (extendedTimeDeliveryService.getRetractDate() != null) ? !isRetracted(false) : true; | |
| acceptLateSubmission = extendedTimeDeliveryService.getRetractDate() == null && !isRetracted(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ern - I'm not sure I concur with the '&&', as I would expect '||' there instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java (1)
2295-2295: The||logic is correct, but the null check is redundant.The current implementation correctly handles all scenarios. However, the explicit null check
extendedTimeDeliveryService.getRetractDate() == nullis redundant becauseisRetracted(false)already returnsfalsewhen retractDate is null (line 2303 checksretractDate != null).As discussed in the past review comments, using
&&as suggested would incorrectly reject submissions when a retractDate is set but not yet reached. Your use of||is the correct choice.For slightly cleaner code, you could simplify to:
- acceptLateSubmission = extendedTimeDeliveryService.getRetractDate() == null || !isRetracted(false); + acceptLateSubmission = !isRetracted(false);This works because
isRetracted()returnsfalsewhen retractDate is null, effectively handling both the null case and the "not yet retracted" case. However, the current explicit null check does make the intent clearer, so this simplification is entirely optional.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ottenhoff
Repo: sakaiproject/sakai PR: 0
File: :0-0
Timestamp: 2025-10-07T15:11:27.298Z
Learning: In samigo’s Total Scores view (samigo/samigo-app/src/webapp/jsf/evaluation/totalScores.jsp), mailto links were hidden after commit dee05746 (PR #12312, SAK-49674) added a render check requiring email.fromEmailAddress to be non-empty; PR #14154 (SAK-52058) restores visibility by checking only description.email.
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: sakai-deploy
- GitHub Check: maven-build
- GitHub Check: maven-build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ottenhoff
Repo: sakaiproject/sakai PR: 0
File: :0-0
Timestamp: 2025-10-07T15:11:27.298Z
Learning: In samigo’s Total Scores view (samigo/samigo-app/src/webapp/jsf/evaluation/totalScores.jsp), mailto links were hidden after commit dee05746 (PR #12312, SAK-49674) added a render check requiring email.fromEmailAddress to be non-empty; PR #14154 (SAK-52058) restores visibility by checking only description.email.
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: sakai-deploy
- GitHub Check: maven-build
- GitHub Check: maven-build
🔇 Additional comments (1)
samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java (1)
2293-2296: Logic correctly implements the PR objective.The simplified logic
!isRetracted(false)correctly handles both cases:
- When
retractDateis null: returnstrue(accept indefinitely)- When
retractDateis not null: returnstrueif not yet passed,falseif passedThis is cleaner than the previous ternary and matches the PR goal of accepting late submissions indefinitely when the extended time Late Acceptance Date is blank.
samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java
Outdated
Show resolved
Hide resolved
…/bean/delivery/DeliveryBean.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Jira: https://sakaiproject.atlassian.net/browse/SAK-51239
If the Late Acceptance Date for an exception is blank (null), this means that submissions will be accepted indefinitely for that student or group of students. Thus, for this case, acceptLateSubmission should return true instead of false. This proposed change resolves the cases described in the jira's test plan.
Summary by CodeRabbit