codemirror renderer in pythoncode doesn't properly escape initial code #102

Open
opened 2025-09-29 15:01:09 +00:00 by hz · 1 comment
Owner

This caused problems in a 6.101 quiz just a few moments ago. 6.101 was doing something unexpected (csq_initial changed from student to student, with student-crafted code), but it still should have worked. The fix should be as simple as calling html.escape on the initial display in render_html_codemirror the same way we call it on submitted code, but we'll need some testing to verify that.

This caused problems in a 6.101 quiz just a few moments ago. 6.101 was doing something unexpected (`csq_initial` changed from student to student, with _student-crafted_ code), but it still should have worked. The fix should be as simple as calling `html.escape` on the initial display in [`render_html_codemirror`](https://catsoop.org/git/catsoop/catsoop/src/branch/main/catsoop/__QTYPES__/pythoncode/pythoncode.py#L619) the same way we call it on submitted code, but we'll need some testing to verify that.
hz added this to the v20.0.0 milestone 2025-09-29 15:09:22 +00:00
hz changed title from codemirrror renderer in pythoncode doesn't properly escape csq_initial to codemirrror renderer in pythoncode doesn't properly escape initial code 2025-09-29 15:32:16 +00:00
hz changed title from codemirrror renderer in pythoncode doesn't properly escape initial code to codemirror renderer in pythoncode doesn't properly escape initial code 2025-09-29 16:19:05 +00:00
Author
Owner

After giving some time for my understanding of the problem to evolve, I'm making an executive decision that we should remove Codemirror from the codebase completely in v20.0.0. I'm also noting that this may no longer be a "good first issue" as it's likely at least a little bit complicated.

After giving some time for my understanding of the problem to evolve, I'm making an executive decision that we should remove Codemirror from the codebase completely in v20.0.0. I'm also noting that this may no longer be a "good first issue" as it's likely at least a little bit complicated.
hz removed this from the v20.0.0 milestone 2025-09-29 17:51:49 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
catsoop/catsoop#102
No description provided.