maths / moodle-qtype_stack

Stack question type for Moodle
GNU General Public License v3.0
138 stars 147 forks source link

Parson proof not working if block defined in one line #1139

Closed smborio closed 3 months ago

smborio commented 3 months ago

In the question text, if you enter

[[parsons input="ans1"]]{# stackjson_stringify(proof_steps) #}[[/parsons ]]

in a single line, the question loads without any data.

If you enter it in three separate lines

[[parsons input="ans1"]]
{# stackjson_stringify(proof_steps) #}
[[/parsons ]]

it works fine.

Maybe a warning should be defined or something of the sort or a way to add the line breaks if they are not there?

sangwinc commented 3 months ago

Yes, here is a minimal example outside a question.

[[parsons ]]{# stackjson_stringify([["A", "Step A"],["B", "Step B"],["C", "Step C"]]) #}[[/parsons ]]

We should fix this!