Formula Questions- it doesn't calculate b^n1 in the Answer

Formula Questions- it doesn't calculate b^n1 in the Answer

gan Ahmad Amer -
Number of replies: 1

When I try to solve the problem,

it gives me an incorrect because it doesn't calculate (b^n1) as it is defined in my variables

(it gets the top answer box right as well as the right answer box but somehow it fails to calculate b^n1 for the bottom answer box).

is there an explanation to this problem? How do I deal with it?

Thanks.



Cyfartaledd sgoriau: -
In reply to Ahmad Amer

Re: Formula Questions- it doesn't calculate b^n1 in the Answer

gan Dominique Bauer -
Llun o Documentation writers Llun o Particularly helpful Moodlers Llun o Plugin developers
In the answer, b^n1 represents the bitwise operator XOR. Therefore, 3^2 is equal to 1, not 9.

Use the appropriate syntax, that is, the exponentiation operator ** (recommended) or the power function pow(). So you must write:

Answer   [b**n1,1,n1]

or

Answer   [pow(b,n1),1,n1]