G'day,
moodle 3.3 (current release)
I'm working on a slightly complex equation to use for calculated questions, specifically I am trying to generate density altitude given three variables, oat, qnh & altitude.
The formula is somewhat complex, this is what I have so far :
{= ({alt} + ((1013 - {qnh})*30)) + (120 * (-{oat} + (15 - abs( ( ({alt} + ((1013 - {qnh})*30)) / 500 )) ) ) ) }
As you can see, it's pretty messy (and, not quite right) and a nightmare to debug - all these braces! Is it at all possible to have a function or a variable embedded in this? For example, the ({alt} + ((1013 - {qnh})*30)) calculation occurs twice. It's the formula for pressure height, which gets used twice. I don't suppose there's a way to just do it once and then assign its value to another variable within the question?