Error with Calculated Question Type

Error with Calculated Question Type

by Robin Leung -
Number of replies: 11
Hello community,

I have an instructor who is having issues delivering a quiz to students. He is using the calculated question type in for his entire quiz and is grabbing the quiz questions from the question bank.

However, when launching preview, we come across this error that says nothing much more about the problem.
"Cannot get the specified dataset for a dataset dependent question! (question: 1391342, datasetitem:66)

Running Moodle 3.0 latest.
Anybody can shed any light on this error? Thanks in advance.


Average of ratings: -
In reply to Robin Leung

Re: Error with Calculated Question Type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The error message is extrememly technical, so it does not really tell you where to start, but it does contain a lot of useful information.

For example, we know it is the question with id 1391342. How is that question set up? Is it sharing datasets with other questions or not? How many dataset items are there in the form?

In reply to Tim Hunt

Re: Error with Calculated Question Type

by Robin Leung -

Hi Tim,

Thanks for the info. The question goes something like this "If the couple force F is  41 newtons and acts along the z-direction, and the distance y is 347 millimetres, then find the magnitude of the couple moment. Answer in newton-metres but do not include units in your answer."

It is sharing datasets and the question has 4 parts. And there are 30 wildcard values for each of the 2 variables.

Do you see any problems with this?

In reply to Robin Leung

Re: Error with Calculated Question Type

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

As I glance at your question, I cannot see any problem.  But maybe Tim will.

You might want to consider using Calculated Multiple Choice questions.  This question type removes the need to say "do not include units in your answer."

In reply to Robin Leung

Re: Error with Calculated Question Type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

OK, so if this question only has 30 datasets, then the bit of the original error that says "datasetitem:66" makes some sort of sense. There is no dataset 66!

The fact you are sharing datasets with other quetsions might be what is causing that. I think when you are sharing datasets, then all the questions involved with the sharing must have the same number of dataset itemes. Can you check if that is the case?

In reply to Tim Hunt

Re: Error with Calculated Question Type

by Robin Leung -

Hi Tim & Rick,

Thanks for troubleshooting.

If you are referring to the item count, they both are 30 (see screenshot)



Attachment 2017-01-27_12-16-56.jpg
In reply to Robin Leung

Re: Error with Calculated Question Type

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

OK, so the bug is that somehow it tried to display a non-existant variany number 66, when there are only 30. I don't know why that would be.

In reply to Tim Hunt

Re: Error with Calculated Question Type

by Robin Leung -

Weird, yes? I don't see a bug like this in the Tracker nor anywhere reported. Guess I will put one in.

In reply to Robin Leung

Re: Error with Calculated Question Type

by Kristen Thompson -
I think that I figured out a solution to this problem. In my assignment, each group of questions has a different number of data sets. For some reason then, moodle attempts to grab a data set that does not exist. It may be trying to pull the same data set for all questions? For example if question 1 has 53 data sets and question 5 only has 10 data sets, when the system tries to pull data set 51 for question 5, then this error appears.

It appears to have fixed the problem if all questions in a particular quiz have the same number of data sets.
In reply to Kristen Thompson

Re: Error with Calculated Question Type

by Robin Leung -

This issue has resurfaced. I had a bit of time with it and it seems like if you synchronize the data from shared datasets with other questions in a quiz, you will get the error message. But if you choose not to synchronize and reset the dataset values then it will be fine.


In reply to Robin Leung

Re: Error with Calculated Question Type

by Kristen Thompson -

I need to synchronize because the value are used in a multi-part problem. The value calculated in part (a) is then used to help calculate part (c), ect.  The next thing I need to try to figure out is if moodle is trying to pull the same data set for all items in the quiz. 

In reply to Kristen Thompson

Re: Error with Calculated Question Type

by Robin Leung -

Yes, same here. And this is where I'm running into difficulties. Let me know if you run into the same problem.