feat(gradebook): CSV grade import for external assessments#8465
Open
LWS49 wants to merge 1 commit into
Open
Conversation
This was referenced Jun 28, 2026
38c0e8e to
c75dd03
Compare
2d5ebeb to
6f62578
Compare
Introduce the full external-assessment CSV import feature as a single slice on top of grade validation (pr3). Backend: - Course::Gradebook::ExternalAssessmentImportService — header-order tolerance, duplicate-header/identifier guards, reassigned-identifier detection, out-of-range flagging, and batched (bulk insert + upsert) grade writes. - external_assessment_imports controller (preview + create/commit), create/preview jbuilders, and import routes. Frontend: - ImportExternalAssessmentsWizard (upload → define → verify), with the ExternalGradeConflict prompt/table change-matrix and buildTemplate. - previewImport/commitImport operations + import API endpoints + types. - ManageExternalAssessmentsPanel gains the Import CSV entry point. Consolidates the previously planned pr4a (correctness) and pr4b (ux) into one PR: the import wizard and service are edited by both themes at the hunk level, so they do not separate into independently-reviewable slices. Fixes a pre-existing broken assertion in the import controller spec (course_externalassessments -> course_external_assessments) that prevented the replace-on-conflict test from running.
c75dd03 to
32c59d0
Compare
6f62578 to
245d005
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds CSV grade import for external assessments, reached through "Import CSV" in the manage panel. A three-step wizard defines the components, confirms the required headers and file, then previews the resolved rows before writing. Students are matched by External ID (Coursemology's term) or email, keyed by column position; headers are accepted in any order with duplicate-header reporting and near-miss ("did you mean") suggestions. The Verify step pairs each CSV identifier with its resolved student name, flags out-of-range cells as a non-blocking advisory, and blocks only on unresolved identifiers or non-numeric cells. Grade conflicts are shown as a per-student change matrix (old to new, unchanged cells dropped), and writes are batched with student emails preloaded to avoid N+1s.
Design decisions
Regression prevention
Covers (backend): header order tolerance, duplicate-header reporting, near-miss header suggestion, identifier resolution and reassigned-identifier detection, out-of-range computation, structured conflict rows, the weightage-zeroing guard, the email-preload N+1 fix, and batched writes (import service and imports controller specs). Covers (frontend): the full wizard (define / template / upload / verify, did-you-mean, loading), the conflict change-matrix table (struck old value, arrow, bold new value, blank sides shown as a dash, new-fill vs existing fallback), and the template builder. Adds the imports controller route; no schema change.