Skip to content

Commit b31659a

Browse files
committed
fix: IndexError: list index out of range error in freetext question
Error was caused by a missing `textline` element. Thanks @Yagnesh1998 for providing a fix! Close #2.
1 parent 47285ff commit b31659a

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

examples/olx.tar.gz

11 Bytes
Binary file not shown.

examples/olx/problem/f2310074b275914a6e36bca277682a0a.xml

+2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@
77
</additional_answer>
88
<additional_answer answer="0">
99
</additional_answer>
10+
<textline size="20">
11+
</textline>
1012
</stringresponse>
1113
</problem>

mu/formats/olx/writer.py

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def on_freetextquestion(self, unit: units.MultipleChoiceQuestion) -> None:
9393
attrs={"answer": answer},
9494
)
9595
response_xml.append(answer_xml)
96+
response_xml.append(Tag(name="textline", attrs={"size": 20}))
9697
problem_xml.append(response_xml)
9798

9899
def on_rawhtml(self, unit: units.RawHtml) -> None:

0 commit comments

Comments
 (0)