How to fix the following problem with Stack question?

How to fix the following problem with Stack question?

by Armand Majer -
Number of replies: 3

Hi everyone. I'd need some help editing Stack questions.

There are some details:

The variables in the problematic question are:

ww: rand([1,2,3,4,5,6,7,8,9,10,11,12,13,14]);

mm: rand([220,330,440,550,770]);

mv: rand([55,75,170,240,250,310]);

exp: ((mP*wP)/(mP+mR));

ta1: remainder(exp,x);

prem: (ww/100);

form: decimalplaces(((mm*prem)/(mm+mv)),2);

The student is supposed to calculate the mass fraction of HNO3 solution of {@ww@} %  with a mass of {@mm@} g diluted with {@mv@} g of water, and type in the formula used to calculate the mass fraction, using the following symbols mP, wP, mR. 

The inputs are:

ans1 is an algebraic input, the model answer is: decimalplaces(((mm*prem)/(mm+mv)),2)

ans2 is an alg. input as well, and the model answer is: ta1

The response trees:

Potential response tree: prt1 Node 1: Answer test: AlgEquiv; SAns: ans1; TAns: form

Potential response tree: prt2 Node 1: Answer test: AlgEquiv; SAns: ans2; TAns: ta1

So, this is everything the question contains. The problem occurs, when the student enters a decimal number (the correct numerical answer, e.g.  1.6, and the response is:
This answer is invalid. Your answer contains floating point numbers, that are not allowed here. You need to type in numbers as fractions. For example, you should type 1/3 not 0.3333, which is after all only an approximation to one third.

Any ideas? Thank you in advance.

Average of ratings: Useful (1)
In reply to Armand Majer

Re: How to fix the following problem with Stack question?

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers
The default behaviour of an algebraic input is to prevent floating point numbers. This is to stop students typing x+0.33 when a pure mathematician expects x+1/3. Edit the question, inside the "input" section change the option to "forbid floats" and students will be able to use them. You might like to also check out the "mindp" option to make sure students provide you with enough decimal places to understand if they might be correct....
Average of ratings: Useful (1)
In reply to Christopher Sangwin

Re: How to fix the following problem with Stack question?

by Armand Majer -
Thank you sir. smile Could I ask where this mindp should be be?