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

[QTI] Text entry answers are merged and reordered when the first answer has surrounding space

Abierto
#6,309 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
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
15/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript, xml
Área
frontend

Línea de trabajo

The bug is in _extractAnswers in interactions/textEntry/parse.js, which compares the trimmed qti-value with the untrimmed first map-key. Reproduce it with a Jest test using the declaration from the issue, then check that the output is [[' Paris', false], ['Paris', true], ['Paris', false]] and that opening the item emits no update:rawData. The issue states it is not open for contribution, so confirm with maintainers before starting.

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

Descripción

bug DEV: frontend

❌ 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

  • A base-type="string" declaration whose map-keys are Paris (case-insensitive), Paris (case-sensitive), Paris (case-insensitive) opens in the Text entry editor as two answers: Paris, Paris.
  • The case-sensitive Paris answer is dropped; the next save writes the merged list.
  • Cause: _extractAnswers (interactions/textEntry/parse.js) compares the trimmed <qti-value> with the untrimmed first map-key, so the editor-shaped check fails and answers are read by value instead.

Expected behavior

  • Answers open as stored: Paris, Paris (case-sensitive), Paris, in that order.

User-facing consequences

  • An author who edits such a question loses an answer and its case-sensitivity without being told.

Steps to reproduce

  1. Call _extractAnswers on the declaration:
    <qti-response-declaration identifier="RESPONSE" cardinality="single" base-type="string">
      <qti-correct-response><qti-value> Paris</qti-value></qti-correct-response>
      <qti-mapping default-value="0">
        <qti-map-entry map-key=" Paris" mapped-value="1" case-sensitive="false"/>
        <qti-map-entry map-key="Paris" mapped-value="1" case-sensitive="true"/>
        <qti-map-entry map-key="Paris" mapped-value="1" case-sensitive="false"/>
      </qti-mapping>
    </qti-response-declaration>
    
  2. It returns [['Paris', false], [' Paris', false]] as [value, caseSensitive].

Acceptance Criteria

  • The declaration above reads as [[' Paris', false], ['Paris', true], ['Paris', false]].
  • Opening such an item in edit mode emits no update:rawData.

AI usage

Claude Code found this while self-reviewing #6282 and drafted the issue; the bug was reproduced against unstable with a Jest test.

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

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.