-
-
Notifications
You must be signed in to change notification settings - Fork 999
SAK-52173 SCORM Import from site does not retain GB setting #14257
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
Draft
kunaljaykam
wants to merge
1
commit into
sakaiproject:master
Choose a base branch
from
kunaljaykam:SAK-52173
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+44
−0
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
Harden gradebook copy against null manifest ids and verify
addExternalAssessmentsignatureTwo points here:
copy.getManifestId()can benull(e.g., when the source had no manifest), but you callcontentPackageManifestDao.load(copy.getManifestId())without a guard. Elsewhere (copyManifest) you explicitly avoid callingload()with anullid, which suggestsload(null)may throw. Recommend guarding before the DAO call:This keeps gradebook copying best-effort and avoids unexpected runtime failures when a package lacks a manifest.
GradingService.addExternalAssessmentargument ordering and valuesThe call
assumes a specific 12-parameter signature and passes
toContexttwice, withScormConstants.SCORM_DFLT_TOOL_NAMElater in the list. Without the API in view, it’s hard to confirm that the secondtoContextand the position ofSCORM_DFLT_TOOL_NAMEalign with the expected(gradebookUid, externalAppName, externalId, ...)ordering.Please verify this against your
GradingServiceinterface and, if available, mirror the argument pattern used by other tools that create SCORM or external assessments, so points, due date, category, and release flags all line up as intended.Also consider whether
100.0should match the original external assignment’s points rather than a hardcoded value.To validate both the signature and typical usage patterns in your codebase, you can run:
🏁 Script executed:
Length of output: 28601
Null manifest id handling needs defensive guard;
addExternalAssessmentsignature is correctThe
GradingService.addExternalAssessmentcall is correctly formed. Verification confirms the 12-parameter signature atgradebookng/api/src/main/java/org/sakaiproject/grading/api/GradingService.javamatches your usage, and passingtoContextfor bothgradebookUidandsiteIdis consistent with other tools in the codebase (assignments, other SCORM usages).However, the null manifest id issue remains valid:
Guard
copy.getManifestId()before the DAO call (lines 363-364):This avoids potential DAO errors when a source package has no manifest, keeping gradebook copying best-effort and defensive.
Regarding the hardcoded
100.0points: consider whether this should inherit from the source package's original external assignment rather than using a fixed value, to preserve grading consistency across site copies.📝 Committable suggestion
🤖 Prompt for AI Agents