Dependent answers in two-part questions

Re: Dependent answers in two-part questions

by AL Rachels -
Number of replies: 4
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi shahin k,

Here are a couple of question banks. One contains the two formula type questions I was working on. The one named "soil swell" is the one that gives the results shown in the second picture from above. The second question bank includes a version of the "soil swell" created using calculated multiple choice that gives the results in the first picture.

The second of the two formula type questions named "heavy equipment productivity" is a work in progress and has not been completed yet. If I remember correctly, I have not implemented table 3-6 and 3-2 from the pdf. It's a jumbled up mess at the moment as I was modifying a copy of the soil swell.

I have not spent any time on it lately due to other, personal projects and doctor appointments.

Average of ratings: Useful (1)
In reply to AL Rachels

Re: Dependent answers in two-part questions

by shahin k -

Hi Al,

Thanks so much for sharing these sample questions with me. 

Working around the questions to better understand the logic of the Formulas plug-in, I realized that this plug-in does not generate accurate answers (please see the snapshots)

For instance, the way "i", "st" and "sw" are defined in the random and global variables respectively, my understanding is that when i = 1, the st == "clay" and the sw = 30. But by looking at the "10 instantiated dataset", we will see that when "i" is 2 or 3, clay is selected for both and gravel has never been selected.

Even by looking at the "statistics" table, we will see that the plug-in considers the variables defined for "i" and "sw" as the "min" and "max". Therefore, it never generates the variables correctly (that's why "25" has never been generated for sw). I think this must be a bug in the system. I will be happy to know your thoughts and if there is a way to fix this issue. Otherwise, it is a great plug-in.




In reply to shahin k

Re: Dependent answers in two-part questions

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi shahin k,

Sorry, I made the mistake of assuming the pick from the lists was being indexed from one, but it is zero. I also did not know that the random number generators never used the max number. So I changed the random number generator for i so it is now i={0,3,1}; which will result in giving us a 0, 1, or 2.

I then changed the pick lists to the following:

st = pick(i,"clay","sand","gravel");
sw = pick(i,30,12,25);

Notice I got rid of the square brackets and spaces. With these changes I am now getting a more reasonable list of results when I look at any instantiated dataset.

Finally figured all this out by tracking down the old, original documentation at https://code.google.com/archive/p/moodle-coordinate-question/wikis/Documentation.wiki

Here's a picture showing my current local and global variables.


Average of ratings: Useful (1)
In reply to AL Rachels

Re: Dependent answers in two-part questions

by shahin k -

Hi Al,

Thank you. Now it works perfect. I designed the following question and it works just fine. However, the last part of this question requires an "If statement" like : If X>y then "Performs", "Does Not perform". Since I didn't know how to define string variables in an If statement, I used 1 for "Performs" and 0 for "Does Not Perform". I was wondering how this "if statement" can be done properly in this plugin.

Thanks again for your help

In reply to shahin k

Re: Dependent answers in two-part questions

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

It's done with a pick that compares two values to control which answer to use. Here are two versions of the question. The one with the word (copy) in the name is probably the best way to do it. Just got the other one to work first when I tracking down the right format to use for the pick.

Sorry, I forgot to remove my calculator code and answer cheats before I uploaded them.