Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Restoring a published QTI item stores lxml's reserialization instead of the published XML

Đã đóng
#6,305 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

Read contentcuration/contentcuration/utils/import_tools.py around lines 585–588 and contentcuration/contentcuration/utils/assessment/qti/media.py around lines 33–34 to trace how restore handles QTI XML. Run pytest contentcuration/contentcuration/tests/test_restore_channel.py -k QTIRestore to reproduce the failure. Done means the restore tests pass, restored QTI and Perseus raw_data matches the source, and republished package item files match the source package; the issue says it is not open for contribution.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug DEV: backend python

❌ 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

  • Restore stores a QTI item's raw_data by passing the packaged XML through rewrite_qti_media_paths (import_tools.py#L585-L588, from #6243).
  • Since #6241, rewrite_qti_media_paths reparses the item and returns lxml's serialization (media.py#L33-L34), so the restored raw_data differs from the source item's.
  • The two PRs merged minutes apart; the Python unit tests job has failed on unstable since then, and on every PR based on it.

Errors and logs

FAILED test_restore_channel.py::QTIRestoreTestCase::test_dual_published_node_restores_each_question_once
FAILED test_restore_channel.py::QTIRestoreTestCase::test_qti_only_node_restores_editor_and_legacy_items_as_qti
SUBFAILED(order=1) test_restore_channel.py::QTIRestoreTestCase::test_perseus_question_in_package_restores_as_perseus_question
E   AssertionError: '<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n<qti-assess[1250 chars]tem>' != '<?xml version="1.0" encoding="UTF-8"?><qti-assessment-i[1247 chars]tem>'
contentcuration/contentcuration/tests/test_restore_channel.py:417: AssertionError

User-facing consequences

  • CI is red for every Studio PR, so real regressions in the Python suite are hidden.

Steps to reproduce

  1. Check out unstable at 51657a6d9.
  2. Run pytest contentcuration/contentcuration/tests/test_restore_channel.py -k QTIRestore.

Acceptance Criteria

  • pytest contentcuration/contentcuration/tests/test_restore_channel.py passes on unstable.
  • A restored QTI or Perseus-question item's raw_data equals its source item's raw_data.
  • Republishing a restored node produces package item files equal to the source package's.

AI usage

Claude Code found the failure while fixing CI on #6273, bisected it to the #6241/#6243 merge, and drafted this issue.

Ngôn ngữ chính
Python
Star
192
Fork
310
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
70

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của learningequality/studio

Tất cả issue của learningequality/studio

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.