feat(gradebook): export-canvas template overlay for clean Canvas re-import - #25
Merged
Merged
Conversation
…mport `reg-gradebook export-canvas --template <canvas-export.csv> [--only lab2]` overlays vault scores onto a Canvas gradebook EXPORT, preserving its exact structure (identity columns, `Name (assignment_id)` headers, posting row) so the result re-imports into the existing assignment instead of creating a duplicate. - assignment match by id-suffixed header → schema canvas_title → short_name - `--only` restricts the overlay to specific components (push one lab/exam) - student match by zero-padded SIS User ID; unknown students passed through - minimal diff: a cell is rewritten only when its value actually changed, so the import touches just the moved grades (extra credit folded in via the component score, e.g. base 96 + ACE 14 → 110) - read-only/computed Canvas columns ride along untouched (Canvas ignores them) Bare mode (no --template) is unchanged. Validated against a real CECS 378 Lab 2 export (only the six ACE cells changed). 11 new tests; full suite 405 passed. Docs: docs/canvas-grades-workflow.md + README/reg-gradebook row. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015cY2osrcunEXb5a8xtTy2V
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.
What
reg-gradebook export-canvas --template <canvas-export.csv> [--only lab2]overlays vault scores onto a Canvas gradebook export, preserving its exact structure (identity columns,Name (assignment_id)headers, posting row) so the file re-imports into the existing assignment rather than creating a duplicate. This makes pushing one lab or exam's grades to Canvas a normal grading product.canvas_title→short_name;--onlyrestricts to specific components.SIS User ID; students in the export but not the gradebook (Canvas Test Student, late adds) pass through untouched.--template) is unchanged.Aligns with Canvas's import rules: https://community.instructure.com/en/kb/articles/660862-how-do-i-import-grades-in-the-gradebook.
Validation
Run against the real CECS 378 Su26 §01 Lab 2 Canvas export — output identical to the export except the six ACE cells (82→91, 91→106, 92→97, 96→110, 92→104, 71→75).
Tests & docs
11 new tests (overlay targeting, id-suffix match, unknown-student passthrough, no-match error, minimal-diff formatting, CLI). Full suite 405 passed. New
docs/canvas-grades-workflow.md; README reg-gradebook row + docs index updated.🤖 Generated with Claude Code
https://claude.ai/code/session_015cY2osrcunEXb5a8xtTy2V