Skip to content

Create script to extract IMS CC files and generate Gradescope-compatible markdown for self-check modules - #145

Open
cycomachead wants to merge 1 commit into
mainfrom
cycomachead/1-extract-imscc-to-gradescope-markdown/1
Open

Create script to extract IMS CC files and generate Gradescope-compatible markdown for self-check modules#145
cycomachead wants to merge 1 commit into
mainfrom
cycomachead/1-extract-imscc-to-gradescope-markdown/1

Conversation

@cycomachead

Copy link
Copy Markdown
Contributor

Add IMS CC extractor and Gradescope self-check markdown generator

Adds a script that extracts Self-Check QTI questions from the course's IMS Common Cartridge export and generates Gradescope-compatible Markdown, one file per module.

Changes

  • New self-checks/gradescope/imscc_to_gradescope.py (stdlib only, no dependencies):
    • Parses imsmanifest.xml to locate every Self-Check X.Y: <topic> item and resolves it to its QTI 1.2 assessment file.
    • Parses each QTI question (prompt, choices, explanation) and determines the correct answer(s) from the QTI response-processing rules rather than assuming the first choice is correct.
    • Converts embedded HTML to Markdown and copies/relinks referenced images locally (external URLs preserved as-is).
    • Accepts either the .imscc zip or an already-extracted cartridge directory.
  • New self-checks/gradescope/modules/ output: 12 Module X Self-Checks.md files (85 self-checks / 85 questions total) plus an images/ folder with the 4 referenced question images.
  • Gradescope Markdown format used:
    • Single-answer MC → ( ) / (x)
    • Select-all → [ ] / [x]
    • Free response → prompt only
    • Explanations emitted as [[ ... ]] lines (each starting/ending on a single line, per Gradescope's concatenation rules), replacing an earlier HTML-comment approach
    • Questions separated by ---
  • New self-checks/gradescope/README.md documenting usage and the output format.

Verification

  • Audited correct-answer placement across all 85 questions: while most are authored with the correct choice first, 3 (Self-Checks 2.2, 5.2, 7.8) are not, confirming the script reads real correctness from the QTI rules rather than defaulting to option order.
  • Re-ran against a freshly attached cartridge export and confirmed identical coverage (12 modules, 85 self-checks/questions) to validate the zip vs. extracted-dir code paths produce the same result.

Screenshots

Sample generated module and image outputs:


Superconductor Ticket Implementation | Guided Review

- Add Python script to parse IMS Common Cartridge QTI questions and extract correct answers
- Generate Gradescope-compatible Markdown modules with `[[ ... ]]` explanations and `---` question separators
- Copy and relink referenced question images locally

https://www.superconductor.com/tickets/JF97LTFrD7NH/implementations/HRHwHTQPgnJw#message_QpGF6rFKqqCH

Co-authored-by: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant