Hello moodle folks,
Since 2 days I am having a really hard time doing some formulas containing several wildcards and an array/list of numbers in a calculated question. For example, I want to calculate the file size of an image in megabytes from given specifications - {h} for height, {w} for width, "b" for bit depth. I can set a range of integer numbers for {h} and {w} and add them as wildcard sets but I also want to let moodle to choose the value of "b" from a predefined array or list. To be more precise, the bit depth value should be a any number of these - 1, 8, 16, 24, 32, 48. If there is such a function for this, I suppose it should be working like min/max or something like that array_rand(1,8,16,24,32,48). Is it possible to do something like that and how exactly?
The calculated question until now is working perfectly with the following formula - ({h}*{w}*{b})/(8*1024*1024), with the exception of the the "b" value which is always a random number from a set range just like {h} and {w} and not any of those six bit values.
I would really appreciate if you can help me to solve this problem!