Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Cerrado
#6,305 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
192
Forks
310
Merge medio
2 d 22 h
PR fusionados (30 d)
71

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de learningequality/studio

Todos los issues de learningequality/studio

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.