Skip to content

Publish mixed exercises QTI only when Perseus can't read a legacy input answer - #6273

Merged
rtibbles merged 3 commits into
learningequality:unstablefrom
rtibblesbot:issue-6208-c38516
Oct 16, 2026
Merged

rtibbles merged 3 commits into
learningequality:unstablefrom
rtibblesbot:issue-6208-c38516

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves Perseus input-answer parsing onto QTI's format_number, replacing #6255's isfinite filter and #6259's _perseus_number; Perseus and QTI now read an input answer the same way.

  • Mixed nodes (native QTI + legacy input questions) publish QTI only when a legacy input answer is not a finite number (e.g. Sphere, +50%, 1e400); otherwise they keep their Perseus archive.
  • An input question answered only by an image publish drops counts as answerless, so it is left out of the Perseus archive and assessment metadata.
  • Every Perseus archive, Perseus-only nodes included, keeps JSON-number answers (4, 0), reads +3 / 1E3 as numbers, and no longer publishes "correct": false answers as correct.

References

Closes #6208. Closes #6266. Refs #6268. Refs #6232.

Reviewer guidance

  • The third bullet changes Perseus-only exports too; if that is out of scope, the gate must instead make the int-4 fixture QTI only.
  • QTI's input _process_answers override moved into the base generator (utils/assessment/base.py), so both formats keep a JSON 0.
  • Perseus logs no warning of its own for a skipped input; the QTI generator already warns.

AI usage

Used Claude Code to reproduce the bug with a scratch publish test, write the fix and its tests, and draft this description. Verified with the export channel, exercise creation and QTI test suites, and pre-commit.

🤖 Generated with Claude Code


Written by rtibblesbot, an LLM-based coding agent.

@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-10-16 22:35 UTC

@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Outside this PR's scope — tracked under #5998:


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks

@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Outside this PR's scope — tracked in:


Written by rtibblesbot, an LLM-based coding agent.

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please rebase this on latest unstable, it seems awfully similar to a recently merged PR.

@rtibblesbot

Copy link
Copy Markdown
Contributor Author

@rtibbles Rebased on unstable. This was stacked on #6262, which has merged, so the diff is now three commits:

The description's "Stacked on #6262" line and its second bullet describe #6262's work, not this diff.

@rtibblesbot
rtibblesbot force-pushed the issue-6208-c38516 branch 2 times, most recently from 241f64d to 1497555 Compare October 14, 2026 01:48

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As written, the description reads like a revert of merged work. Please rebase on latest unstable (#6282, #6302 and #6306 have merged since), then rewrite the description to match the diff:

  • Say up front that this moves Perseus input-answer parsing onto format_number, replacing #6255's isfinite filter and #6259's _perseus_number.
  • Drop "Supersedes #6255". It's already merged.
  • Drop "Not covered: +3 / 1E3 (#6224, #6259)". This diff deletes #6259's code and covers that case.

rtibblesbot and others added 3 commits October 16, 2026 15:24
- JSON-number answers (4, 0, 4.5) were published as answers: []
- Answers marked "correct": false were published as correct

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as answerless

Publishing strips unpackageable images before rendering, so an answer of
only such an image left a numeric-input with no answers in the archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… input

A legacy input answer Perseus can't read, such as "Sphere" or "1e400",
left the Perseus numeric-input with no answers; such nodes now skip the
Perseus archive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Rebased on unstable (98b560e, includes #6282, #6302, #6306); clean, export/exercise-creation/QTI suites pass. Description rewritten:

@rtibbles
rtibbles merged commit 48dfec1 into learningequality:unstable Oct 16, 2026
13 checks passed
@rtibblesbot

Copy link
Copy Markdown
Contributor Author

Quick check on rtibblesbot's work on this PR: react 👍 helpful · 😕 mixed · 👎 not helpful. Reply with anything specific.

@rtibblesbot
rtibblesbot deleted the issue-6208-c38516 branch October 16, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants