You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Older-Kolibri Perseus export of a QTI Text entry item with an overflowing numeric answer ships invalid JSON #6231
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Observed behavior
extract_value("1e400") returns inf. PerseusExerciseGenerator._process_input_answers keeps it (inf is truthy) and the numeric-input template renders "value": inf, which is not valid JSON.
Same for -1e400 and 1e0400. is_perseus_derivable returns True for all of them.
Errors and logs
json.loads on the rendered Perseus item raises JSONDecodeError.
Expected behavior
An item with an overflowing numeric answer is reported not derivable, so the node publishes QTI only.
User-facing consequences
Older Kolibri cannot load the item JSON, so learners get no exercise for the node.
Plan: A QTI text-entry item whose correct answer parses to a non-finite number (1e400, -1e400, 1e0400) is not Perseus-derivable, so the node publishes QTI only.
Reject non-finite text-entry answers in the derivability gate
Self-review the produced code
Assumptions — the issue did not settle these; say so if one is wrong.
Legacy INPUT_QUESTION items with a 1e400 answer still render invalid JSON via _process_input_answers; left out of scope, and a follow-up issue is needed if they should be fixed.
Underflow (1e-400 → 0.0) is finite and stays derivable; if a silent 0 answer is unacceptable, the gate needs a zero-vs-input check.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
Ran the project's full test suite and linter before committing
For UI changes: captured live screenshots to verify rendering
For backend changes: verified with example API/CLI output
Activity
rtibblesbot commentedon Sep 30, 2026
Plan: A QTI text-entry item whose correct answer parses to a non-finite number (
1e400,-1e400,1e0400) is not Perseus-derivable, so the node publishes QTI only.Assumptions — the issue did not settle these; say so if one is wrong.
extract_value; if the parser should returnNonefor non-finite, Numeric answers with a very small or very large mantissa and an exponent are not parsed byextract_value#6228 (local19ec005e5) already does so for exponents and this gate becomes redundant but harmless.abc) stay derivable here; if they should not be, that is Older-Kolibri Perseus export of QTI Text entry items has no answers when the accepted answers are not numbers #6222 and this gate must be folded into itsis not Nonecheck.INPUT_QUESTIONitems with a1e400answer still render invalid JSON via_process_input_answers; left out of scope, and a follow-up issue is needed if they should be fixed.1e-400→0.0) is finite and stays derivable; if a silent 0 answer is unacceptable, the gate needs a zero-vs-input check.@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?