Older-Kolibri Perseus export of a QTI Text entry item answered `1_000` or `٥` has no answers

已关闭
#6,281 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Start with perseus_derive._accepted_values, extract_value, and PerseusExerciseGenerator._process_input_answers, then reproduce the issue using derive_perseus_item as described. Check the rendered perseus/input_question.json output and add coverage showing that non-xsd:double forms such as 1_000 and ٥ are handled as expected without producing an incorrect answer set.

由索引模型根据 Issue 内容生成。

描述

bug

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: unstable

Observed behavior

perseus_derive._accepted_values keeps any answer Python float() reads as finite. float() also reads forms that are not xsd:double:

  • digit separators: 1_000, 1_0E3
  • non-ASCII digits: ٥, 5

extract_value rejects these, so PerseusExerciseGenerator._process_input_answers drops them. The derived Perseus item ships "answers": [].

Errors and logs

None. No warning is logged.

Expected behavior

_accepted_values accepts only xsd:double values (ASCII digits, no _), so an item whose only answers are these forms is answerless and publishes in neither archive.

User-facing consequences

Learners on older Kolibri get an input question that marks every answer wrong.

Steps to reproduce

  1. derive_perseus_item(_Item(_text_item("single", ["1_000"]))) — answers ["1_000"].
  2. Pass them through _process_input_answers, then render perseus/input_question.json.
  3. The numeric-input 1 widget has no answers.

Same for ["٥"].

Context

  • The editor rejects these forms; ricecooker-imported QTI items do not.
  • Related: #6222, #6224

AI usage

Drafted by Claude Code during review of #6224. Reproduced on unstable with a script calling derive_perseus_item, _process_input_answers and the template.

主要语言
Python
星标
211
派生
317
平均合并
4 天 10 小时
30 天内合并 PR
25

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

learningequality/studio 的其他 Issue

查看 learningequality/studio 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。