Skip to content

Group ExamSoft imports into one activity per file - #19

Merged
Bamboo72 merged 4 commits into
mainfrom
feature/examsoft-activities
Jul 27, 2026
Merged

Bamboo72 merged 4 commits into
mainfrom
feature/examsoft-activities

Conversation

@Bamboo72

@Bamboo72 Bamboo72 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

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.

  • Activity title: the exam header text when the chunker detects one, otherwise the uploaded file's name (sans extension).
  • Zero-question files: unchanged behavior — no activity, same warnings as today.
  • Multiple choice layout: classic MC questions now import with Learnosity's standard horizontal layout (ui_style: {type: "horizontal"}) instead of the block/upper-alpha style — requested during manual verification; a visible appearance change for existing imports.
  • Everything else untouched: question parsing, warnings (byte-identical, regression-tested), error reporting, and the CSV converter are exactly as in 0.4.0. The lib diff is ~45 lines (one converter edit + a private build_activity).
  • Deferred (commented at the build site): #2237's second clause — splitting one file containing multiple exams into separate activities — waits until a real classic-format sample shows what an exam boundary looks like.
  • The atomic-assessments app needs no code changes; its existing examsoft import path uploads whatever activities the archive contains. Only the ~> 0.5.0 Gemfile bump follows the release.

Verification

  • Suite: 205 examples, 0 failures (6 new examples: filename-titled activity, header-titled activity, zero-item case, and a byte-identity regression test for the header warning)
  • bin/convert spec/fixtures/simple.rtf out.zip examsoft → archive contains activities/<ref>.json alongside items/questions

Context

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

Bamboo72 added 3 commits July 27, 2026 12:48
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.

@mpetrowi mpetrowi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Bamboo72
Bamboo72 merged commit 8819360 into main Jul 27, 2026
2 checks passed
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.

3 participants