Someone has a completely reasonable situation that doesn't work as they expect: a question with a number entry part, where the expected answer is defined in terms of a static variable X. After some students started attempts, they noticed X was wrong, so they changed it and update the exam package in the LTI tool. They expected the existing attempts to show the corrected expected answer, but they still show the old one, because the variable value was restored from the saved attempt data. They expected the value of the variable to be updated from the new definition.
One reason Numbas doesn't do this is that it could lead to inconsistencies when there's randomisation. Under what circumstances can we re-evaluate a variable?
It's not safe to re-evaluate a random variable.
When there's no randomness anywhere in a dependency chain, it's safe to re-evaluate.
I think it's safe to re-evaluate non-random dependants of a random variable.
It might not be safe to re-evaluate a variable with a random dependant. For example, a=4, b = repeat(random(1..5),a) could lead to an inconsistency.
Variables which change under student input, such as interactive diagrams, can't be reproduced from just the definition.
Explore mode might be more complicated.
A benefit of re-evaluating a variable on resume is that you don't have to store it in the suspend data.
Maybe, similar to the random flag on operations, there could be a deterministic flag, declaring that they're always safe to re-evaluate on fixed inputs.
Someone has a completely reasonable situation that doesn't work as they expect: a question with a number entry part, where the expected answer is defined in terms of a static variable
X
. After some students started attempts, they noticedX
was wrong, so they changed it and update the exam package in the LTI tool. They expected the existing attempts to show the corrected expected answer, but they still show the old one, because the variable value was restored from the saved attempt data. They expected the value of the variable to be updated from the new definition.One reason Numbas doesn't do this is that it could lead to inconsistencies when there's randomisation. Under what circumstances can we re-evaluate a variable?
a=4
,b = repeat(random(1..5),a)
could lead to an inconsistency.Explore mode might be more complicated.
A benefit of re-evaluating a variable on resume is that you don't have to store it in the suspend data.
Maybe, similar to the
random
flag on operations, there could be adeterministic
flag, declaring that they're always safe to re-evaluate on fixed inputs.