## Quiz

### multichoice calculated question

multichoice calculated question

I am having troubles to make this formula to work anyone kwows why.

La componente es {=({a}*pow({c},2)+{b}*{a}+{c}*{b}) / (pow({c},2)+pow({a},2}+pow({b},2))}

Average of ratings: -
Re: multichoice calculated question

La componente es {=({a}*pow({c},2)+{b}*{a}+{c}*{b}) / (pow({c},2)+pow({a},2 } +pow({b},2))}

You have } instead of ) in one place.

Average of ratings: -
Re: multichoice calculated question

I did corrected that typo, such that the process goes to the final step in whish show the answers in this way.

So it replace the variables values, but do not make calculations.

????

Average of ratings: -
Re: multichoice calculated question

Hi Jorge,

Effectively the calculations are not done in the third step although they are done when using the question (as in preview).

I will try to locate this apparent bug and creat a new issue in the tracker if necessary.

Pierre

Average of ratings: -
Re: multichoice calculated question

This is something quite weird.

In the Edit the wildcards datasets page the calculations are not shown if there is a space in the equations although the values display correctly in preview.

So I will set a bug.

In the mean time remove the spaces in your equations.

Pierre

Average of ratings: -
Re: multichoice calculated question

This is something quite weird.

Or it may appears as.

Looking closely at the code, I notice (and remember ) that spaces was excluded from formulas  inside {=...} in the question text and similarly in the multichoice answers.

This was done to limit possible interference if users use LATEX to show some maths equation  which use the  {...} in various ways, they could just put a space in their LATEX.

So I consider that this should be more a (undocumented) feature.

However if Tim wants this restriction to be removed, I will do it.

Pierre

P.S. I added the {=...} feature in question text some years ago.

Average of ratings: -
Re: multichoice calculated question

Ok.

But in the meantime, I jus can´t use the option for this kind of formulas?

Jorge

Average of ratings: -
Re: multichoice calculated question

If you remove the spaces in your formula everything should work fine.

{=({a}*pow({c},2)+{b}*{a}+{c}*{b}) / (pow({c},2)+pow({a},2 } +pow({b},2))}

Pierre

Average of ratings: -
Re: multichoice calculated question

Thanks

It's working fine

Average of ratings: -