ace-lab / pl-faded-parsons

This contains the Berkeley Faded Parson's element and is designed to be used as a submodule
0 stars 0 forks source link

Require `answers-name` Property #39

Open SybelBlue opened 3 weeks ago

SybelBlue commented 3 weeks ago

answers-name is a required property across all the builtin PrairieLearn elements that are designed to be graded. By convention, it is used to return student submissions to users of an element. It cannot be repeated within a single question because it will clobber other submissions with the same answers-name; duplication may silently err!

Fixing this is trivial, but breaks all known uses of pl-faded-parsons!

Example:

<pl-integer-input answers-name="int_value" label="$y =$">
    <!-- Student inputs "4" -->
</pl-integer-input>

Would return data['raw_submitted_values']['int_value'] == '4' and data['submitted_values']['int_value'] == 4

SybelBlue commented 3 weeks ago

Note to Self

Make sure that missing answers-name results in a helpful error message! The usual PL error message can sometimes be inscrutable...