maths / moodle-qtype_stack

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

Stack Units - Response Tree Evaluation #906

Open Famondir opened 1 year ago

Famondir commented 1 year ago

Hello, is there a way to specify different feedback for the multiple feedback types a response tree mit UnitsRelative can give?

I want to give different (or no) feedback to students if their units are not compatible with the units of the teacher answer. When the units are compatible I'ld like to give feedback on the value itself.

I came up with a workaround (also see image below). In a first node I test if the units are algebraic equivalent to the teachers units after converting them both to base units:

Sunit: stack_units_units(stack_unit_si_to_si_base(ans5));
Tunit: stack_units_units(stack_unit_si_to_si_base(TAns5));

If not I give the feedback that units are incompatible (but only in one language). If they are compatible they get a JX Graph showing what the students answer would mean (e. g. in a time-velocity graph).

This is quite cumbersome and has the drawback that I can't rely on the multilanguage support of STACK. I'd like to be able to specify feedback for those two cases seperately. Mayby like [[unitscompatible]]here is a nice graph[[/unitscompatible]] and [[unitsincompatible]]Go back to our unit tutorial or think about what units the answer should have[[/inunitscompatible]].

Another idea was making a second node with UnitsRelative and Test option inf so I don't have to compare units algebraicly (and convert them to base first). This is still little cumbersome but I would get mutlilanguage support from the wrong unit message.

Is there already something like that? What do you think about it?

image
mkraska commented 1 year ago

I think the two node solution is quite appropriate. You could limit node 2 to unit checking by applying a huge tolerance to the answer test and just use the derault feedback. Then you will go on to node 1 even if the value is wrong. Theoretically, this may fail because whatever tolerance you specify, student's response can be off that value. In that case you can produce some feedback like "Der Wert ist extrem daneben".

For multilingual feedback you can use things like this

Define this in the question variables or in the feedback variables

lbl: castext("[[lang code='en, other']]english[[/lang]][[lang code='ru']]русский[[/lang]]");

Use it in the PRT feedback field

{@lbl@}