maths / moodle-qtype_stack

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

Variable question values #1195

Closed Famondir closed 6 months ago

Famondir commented 6 months ago

Hi all, I try building questions that include two questions but show only one to the student. With [[ if ]] blocks I select which question text and which answer field a student gets presented based on a random variable generated in the question variable part. Later I have two PRTs that evaluate the given answer. But in the grade a studendt only gets 0.5 of 1 because one answer is missing by design. Thus it be handy for me to make the value of a PRT dependent on the random variable somehow (setting it 0 or 1).

I want to build these kind of questions so you can generate tests in Moodle by randomly picking questions without having to bother if two picked questions give away information for another question. In a simply example it is: a) put in a formula given the formulas name b) give the formulas name given the formula

[[ if test = 'questionmode = 0' ]]

Geben Sie die Formel für die allgemeine Bewegungsgleichung an:

[[input:ans1]] [[validation:ans1]] [[feedback:prt1]]

[[ else ]]

Geben Sie an, wie die folgende Formel heißt: {@TAns1@}

[[input:ans2]] [[validation:ans2]] [[feedback:prt2]]

[[/ if]]

It would be problematic if one gets both question variations.

If there already is another approach to this it be happy to learn about it. An even more advanced thing would be to automatically set question values to 0 when they are hidden by a conditional block.

Sincerely Simon

sangwinc commented 6 months ago

In designing the STACK question type there is a "model" we had in mind. You're fighting against this a little in an unanticipated way. The solution here really is to have two STACK questions and use the moodle quiz system to select only one of them. That keeps two separate, easier to maintain/simpler questions. It might be possible to make the PRT value depend on variables, but there might then be all sorts of unanticipated consequences to that.

Sorry, this is probably not a high-priority feature for us to add in the short term.

Famondir commented 6 months ago

Thanks for your quick respond. I'll have a look what gives the least drawbacks for our idea and work around some way or the other.