Calculated question: issue with data sets & nested parenthesis

Calculated question: issue with data sets & nested parenthesis

by Nelson Cartagena -
Number of replies: 8

A colleague of mine ran into a interesting problem. I do not know if this may be a bug or an unintended design problem.  I will attempt at describing the issue with Moodle 2.6.3 when creating calculated questions  and nested parenthesis in a formula.

Given the formula   (({VNL}-120)/120)*100  and a range of values of 120-145 with shared wild cards.

Description of the problem:

When attempting to create the first data set, Moodle comes up with a default of 1 to 10 for a range of values, with a (random?) value for a Wild card, which is not acceptable in the formula, so a value outside the 120-145, for example 8.1

This creates a problem (ERROR Correct answer : -93.1 % outside limits of true value )

Attempting to correct this is easily done, however, regardless of the number of data sets generated subsequently, the first default data set is still present in the pool, which is a source of a potential error in case you have 99 acceptable data sets, but still the one default incorrect data set present.

Can any one reproduce this problem, and tell us if this is a bug?


 

Average of ratings: -
In reply to Nelson Cartagena

Re: Calculated question: issue with data sets & nested parenthesis

by Pierre Pichet -

If you check on the button forceregeneration of all wildcards before generating your values, the initial value will not be used.

However you have to set the button again which is a known bug.

You can also edit any of these values if you need it.



In reply to Pierre Pichet

Re: Calculated question: issue with data sets & nested parenthesis

by Nelson Cartagena -

Thanks for your prompt answer, Pierre.

Here is what is puzzling, when adding 100 data sets with the same parameters from my initial posting (tolerance is set to 0.1, relative type)

This error is happening in 13 sets out of 100.  So, if the Min acceptable is 9.2% and the Max acceptable is 11.3 %,   one would think that 10.3 is within the limits... (???) Can you reproduce this type of behaviour?

Error outside limits

In reply to Nelson Cartagena

Re: Calculated question: issue with data sets & nested parenthesis

by Pierre Pichet -

Using the last moodle version I obtain

(({VNL}-120)/1...

((132.3-120)/120)*100 = 10.3
Correct answer : 10.3 inside limits of true value
Min: 9.2249999999999 --- Max: 11.275

Which version do you use ?

You could also check on moodle demo (https://moodle.org/demo/)



In reply to Pierre Pichet

Re: Calculated question: issue with data sets & nested parenthesis

by Nelson Cartagena -

Thanks, Pierre.

We use Moodle 2.6.3

I will try the demo site, which I did not know about.

Thanks again.

In reply to Pierre Pichet

Re: Calculated question: issue with data sets & nested parenthesis

by Nelson Cartagena -

Hi! Again:

I have tested the creation of a question inside a category with shared wildcards, using the parameters previously mentioned. Generated 100 datasets. I get this on the demo site:

Please note the Min-Max are showing 3 decimals, however I had set the original question to 1 decimal with tolerance 0.1

I am still wondering what happened here.

Error

In reply to Nelson Cartagena

Re: Calculated question: issue with data sets & nested parenthesis

by Pierre Pichet -
Effectively 0,2 is outside 0,225-0.275
(({VNL}-120)/1...
((120.3-120)/120)*100 = 0.2
ERROR Correct answer : 0.2 outside limits of true value
Min: 0.2475 --- Max: 0.2525
This is I (as you)  obtain with the following setting.
asyou
with a different setting
newtolerance
 I obtain
Wild card {VNL}
(({VNL}-120)/1...
((132.3-120)/120)*100 = 10.3
Correct answer : 10.3 inside limits of true value
Min: 9.2249999999999 --- Max: 11.275

Effectively calculated settings can be tricky because they were designed to offer many possible ways to handle numerical responses...


In reply to Pierre Pichet

Re: Calculated question: issue with data sets & nested parenthesis

by Nelson Cartagena -

I am not sure I understand.

While I understand the limits of the true value, I seem to have no control over the number of decimals in the Min: - Max:  limits.

Do I have control over this or is Moodle defaulting to 13 decimals?

In reply to Nelson Cartagena

Re: Calculated question: issue with data sets & nested parenthesis

by Pierre Pichet -

Effectively you don't have complete control of the number of decimals.

The code extend the min and max value by a small number that is related to the precision of the decimals value +- the last bit of their digital representation in the computer.

The main idea is that a good student response should not be excluded by converting its base ten representation of the response (i.e  3.1416)  in its binary computer representation.