-
-
Notifications
You must be signed in to change notification settings - Fork 996
SAK-52162 Scorm limit bypass when scorm session not properly closed #14255
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
WalkthroughEnforces attempt-number capping when preparing launches, updates canLaunch to compute the next attempt number considering contentPackage.getNumberOfTries(), and injects a DOM-ready script to refresh the opener window when the Scorm player popup closes. Changes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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 |
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: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
scormplayer/scorm-impl/service/src/java/org/sakaiproject/scorm/service/sakai/impl/SakaiStatefulService.java(1 hunks)scormplayer/scorm-tool/src/java/org/sakaiproject/scorm/ui/player/pages/ScormPlayerPage.java(2 hunks)
⏰ 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: maven-build
- GitHub Check: sakai-deploy
- GitHub Check: maven-build
🔇 Additional comments (2)
scormplayer/scorm-tool/src/java/org/sakaiproject/scorm/ui/player/pages/ScormPlayerPage.java (1)
24-24: LGTM!The import for
OnDomReadyHeaderItemis correctly added to support the DOM-ready script injection.scormplayer/scorm-impl/service/src/java/org/sakaiproject/scorm/service/sakai/impl/SakaiStatefulService.java (1)
82-82: Method namegetNewstAttemptis a pre-existing API typo, not introduced by this PR.The method
getNewstAttemptis defined in theScormResultServiceinterface and consistently used across the codebase (5 call sites). While it appears to be a typo for "Newest" (the underlying implementation callsattemptDao().lookupNewest()), this is a pre-existing public API naming issue, not specific to your changes. Fixing it would require coordinating updates across the interface and all call sites. Consider raising this as a separate refactoring task if desired.
...rm-impl/service/src/java/org/sakaiproject/scorm/service/sakai/impl/SakaiStatefulService.java
Outdated
Show resolved
Hide resolved
...rm-impl/service/src/java/org/sakaiproject/scorm/service/sakai/impl/SakaiStatefulService.java
Outdated
Show resolved
Hide resolved
scormplayer/scorm-tool/src/java/org/sakaiproject/scorm/ui/player/pages/ScormPlayerPage.java
Show resolved
Hide resolved
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 (2)
scormplayer/scorm-impl/service/src/java/org/sakaiproject/scorm/service/sakai/impl/SakaiStatefulService.java(1 hunks)scormplayer/scorm-tool/src/java/org/sakaiproject/scorm/ui/player/pages/ScormPlayerPage.java(2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-07T16:11:33.008Z
Learnt from: CR
Repo: sakaiproject/sakai PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-07T16:11:33.008Z
Learning: Applies to **/sakai-push-utils.js : Handle browser-specific Web Push logic in sakai-push-utils.js
Applied to files:
scormplayer/scorm-tool/src/java/org/sakaiproject/scorm/ui/player/pages/ScormPlayerPage.java
⏰ 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: maven-build
- GitHub Check: maven-build
- GitHub Check: sakai-deploy
🔇 Additional comments (1)
scormplayer/scorm-tool/src/java/org/sakaiproject/scorm/ui/player/pages/ScormPlayerPage.java (1)
24-25: Opener-refresh logic via pagehide looks correct and avoids beforeunload pitfalls.Using
pagehidewith the!event.persistedcheck pluswindow.opener && !window.opener.closedis a solid improvement overbeforeunload, and rendering it withOnDomReadyHeaderItemintegrates cleanly into Wicket’s head management. This should refresh the parent only when the popup actually goes away (or navigates off) without hammering it on internal interactions.Also applies to: 117-120
Summary by CodeRabbit
Bug Fixes
New Features
✏️ Tip: You can customize this high-level summary in your review settings.