Group ExamSoft imports into one activity per file - #19
Merged
Merged
Conversation
Also updates docx/html/rtf converter specs' pre-existing activities assertions, which tested the old always-empty placeholder and would otherwise fail against the new one-activity-per-file behavior.
Restore main's exact header-warning logic (unstripped join, same guard nesting) while deriving the activity title separately via strip.presence || fallback_title, so whitespace-only headers fall back to the filename instead of becoming a blank title. Add a regression test pinning the case where header_nodes contain a text-empty node (a bare <table>, which pandoc keeps as its own node unlike <img>, which gets wrapped in <p> and filtered out before header_nodes). Also assert dynamic fallback titles on the three Tempfile-based converter specs (rtf/docx/html) instead of only checking counts.
There was a problem hiding this comment.
Pull request overview
Updates the classic ExamSoft import pipeline so each imported file produces a single Learnosity Activity that wraps the converted items in order, with the Activity title derived from the detected exam header when present (otherwise from the source filename). This aligns the gem’s ExamSoft export structure with how downstream consumers expect to organize items into activities.
Changes:
- Generate one activity per successfully-converted ExamSoft file (no activity for zero-question files).
- Switch classic ExamSoft multiple choice rendering to Learnosity’s standard horizontal layout; ensure MA imports set
multiple_responses: true. - Bump gem version to 0.5.0 and update documentation/tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/atomic_assessments_import/examsoft/rtf_converter_spec.rb | Updates expectations to assert a single activity output; adds layout and activity-construction coverage. |
| spec/atomic_assessments_import/examsoft/integration_spec.rb | Verifies activity title comes from detected exam header and that activities are produced. |
| spec/atomic_assessments_import/examsoft/html_converter_spec.rb | Updates activity expectations and adds a regression test ensuring the header warning message remains byte-identical while the activity title is stripped. |
| spec/atomic_assessments_import/examsoft/docx_converter_spec.rb | Updates expectations to assert a single activity output. |
| README.md | Documents the “one activity per imported file” ExamSoft behavior. |
| lib/atomic_assessments_import/version.rb | Bumps gem version to 0.5.0. |
| lib/atomic_assessments_import/exam_soft/extractor.rb | Removes the forced "template" => "block layout" so MC defaults to horizontal layout. |
| lib/atomic_assessments_import/exam_soft/converter.rb | Builds and returns an activity when items exist; titles it from header text or filename; updates MA UI style to horizontal. |
| Gemfile.lock | Updates the local gem version entry to 0.5.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Fixes the grouping clause of atomicjolt/atomic-assessments#2237: every classic ExamSoft import now produces one Learnosity Activity containing the file's questions in order.
ui_style: {type: "horizontal"}) instead of the block/upper-alpha style — requested during manual verification; a visible appearance change for existing imports.build_activity).examsoftimport path uploads whatever activities the archive contains. Only the~> 0.5.0Gemfile bump follows the release.Verification
bin/convert spec/fixtures/simple.rtf out.zip examsoft→ archive containsactivities/<ref>.jsonalongside items/questionsContext
The broader ExamSoft work — format auto-detection, OC Tech printout support, zip imports, image assets — is parked by team decision on
feature/oc-tech-converter(draft PR #18) and will be revisited for the OC Tech migration. This PR is deliberately the smallest reviewable fix for #2237.@mpetrowi — release ask: publish 0.5.0 after merge (same flow as 0.4.0).
🤖 Generated with Claude Code