Details

Type: Bug

Status: Closed

Priority: Minor

Resolution: Fixed

Affects Version/s: 1.6

Fix Version/s: None

Component/s: Quiz

Labels:None

Environment:Linux
Apache
atabase mysql versie 3.23 is vereist en je gebruikt nu versie 4.1.20 OK
php versie 4.1.0 is vereist en je gebruikt nu versie 4.3.9 OK
Mysql

Affected Branches:MOODLE_16_STABLE
Description
When calculated questions are used and a variable is negative (In this case
{c} then the outcome is wrong, in our case 070/10
{a} / {b}  {c}
= ?
The result becomes 0
All positive variables calculate correct
When brackets are place around the (
{a}/
{b}) 
{c}= ?
the calculation is correct
When brackets are place around the negative value
{a} / {b} ( {c}) = ?the calculation is correct.
One way to correct is to replace each variable in the math function by its value enclosed in brackets so{a}
/
{b}
{c}= ?
{x}will give
(70)/(10)( 3).
But the the equation display could contain numerous () and the user could have problem to understand it.
On the other end, negative values seems to be rarely used as this problem has not been reported before (I think).
I prefer to add a notice on the docs about using
parameters with negative values and not change the code.