Commit f198cd9
committed
Fix three issues with display of answers on the problem grader page.
First, if an answer is a checkbox answer with multiple parts checked,
then the `⍮` character is not handled. This needs the same
processing as is done on the past answers page for this.
Second, the essay answers can not be put into a `Mojo::Collection` and
joined with `<br>` tags. The result of that is a `Mojo::ByteStream`
which means that it is not escaped. That was the original point since
the `<br>` tags cannot be escaped. However, the answers must be escaped
so that answers like `<script>alert('xss attack')</script>` are not
executed. So a for loop similar to that used for the checkbox answers
must be used. Note that these answers were also wrapped in a redundant
`<div>` tag with the same class as the containing `<div>` that is still
there, and that was removed.
Third, there was a dangling end `</div>` tag for formula answers that
was removed.1 parent 2d11be7 commit f198cd9
1 file changed
Lines changed: 10 additions & 5 deletions
Lines changed: 10 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
179 | | - | |
180 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
181 | 183 | | |
182 | 184 | | |
183 | 185 | | |
184 | | - | |
185 | 186 | | |
186 | 187 | | |
187 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
| |||
0 commit comments