Problem with calculated question - invalid datasets parameters

Problem with calculated question - invalid datasets parameters

by Agnieszka Herczak-Ciara -
Number of replies: 5

I've encountered a problem with datasets parameters in calculated question in Moodle 2.3.4+. I try to generate integer numbers for my wild cards in question but moodle generates decimal numbers. It fails when we try to generate more than one item to add.
Is it something wrong in my settings of wildcards datasets (see below)?




 

Average of ratings: Useful (1)
In reply to Agnieszka Herczak-Ciara

Re: Problem with calculated question - invalid datasets parameters

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

When you say it generates decimal numbers, do you mean that it generates 4.1, 6.2 etc whereas you want 4, 6?

If so, you can simply go into the variables and edit them to delete the bit after the decimal point. I know this is nowhere near as nice as a button that does it for you but it should work. I would think that a modification to only generates whole numbers (is that the right term), would be trivial.

Have you looked at Simple Calculated, it appears to me to do the same thing, only more simply. I assume there are some things it does not do that Calculated does, but I have not found out what yet.

I have found both question types to be a little "delicate", e.g. it doesn't do any checking at all on your answer formula so when a klutz like me forgets a brace it will fall over silently on preview sad, and I don't understand the outside limits messages that you have on your screen shot, as in I have experienced them myself and got rid of them by relatively random key pressing.

 

Average of ratings: Useful (1)
In reply to Marcus Green

Odp: Re: Problem with calculated question - invalid datasets parameters

by Agnieszka Herczak-Ciara -

Thank you for your reply.

This problem didn't occur in Moodle 1.9.
Now I can't create Calculated questions with whole numbers for wildcards (sorry for integer numbers, I spend too much time programming). I need whole numbers as wildcards for special math questions.
Adding individual values by editing param fields isn't good solution when we want to add for example 50 items (with 2 or more wildcards).
As we can see on my image, I selected 0 in decimal places dropdown list and I expected to get whole numbers between 1 and 10 for {a} and {b}. But after clicking "Get New Item to Add" button or "Add" button Moodle generated decimal values (i.e. 8.7 and 4.4) and displayed error in "Answer tolerance parameters" section.  
What's wrong?

The Simple calculated question type works fine smile
Documentation suggest that Simple calcualted question type offers the most used features of the Calculated question with a much simpler creation interface. It would be great to see full comparision (all features listed) between them.

In reply to Agnieszka Herczak-Ciara

Re: Odp: Re: Problem with calculated question - invalid datasets parameters

by Pierre Pichet -

Things are improving about generating number that appears as integer or warning about additional ) .

The main difference between calculated and calculatedsimple is that the last one only use wildcards created in this specific question.

Full featured calculated allow the sharing at the question category level of wildcards that can be synchonized between questions in a quiz . This alllow to create for example from a given radius two questions : the surface and the circonference.

This is more complex to create and to handle.

 

Pierre

P.S. this week : MDL-31680

Average of ratings: Useful (1)
In reply to Agnieszka Herczak-Ciara

Re: Problem with calculated question - invalid datasets parameters

by Christopher Kramer -

I had this identical problem. What has worked for me is changing the tolerance value to a small number, like 0.001. It seems the number generator for calculated questions malfunction with 0 for the tolerance. My school is using Moodle 2.2.