Dependent answers in two-part questions

Dependent answers in two-part questions

by shahin k -
Number of replies: 20

I am using calculated multichoice question and I want to design a two-part question where the answer of the first part, when calculated, is used to find the answer of the second part of the quiz. for example: 

  • We have soil in a rectangular cube with {height} m, {width} m, and {length} m.
  1. find the {volume} of this soil                                                               
  2. the soil swells by {s}% when excavated. what is the {Svolume}?  

How can I do this?

Thanks for your help

Average of ratings: -
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

I am not sure if I understand what you want.

"...two-part question where the answer of the first part, when calculated, is used to find the answer of the second part of the quiz." - Are you wanting the students to calculate the volume and type in the answer? The question type, calculated multichoice question, doesn't do this as it provides a list of possible answers from which the students can pick one or more of the possible answers.

When doing this question with, calculated multichoice question, after setting the question to Multiple answers allowed, all you need to do is make sure two of the possible answers use the correct formulas with each set to score 50%, and then provide some more answers using common mistakes to create the formulas for the distraction answers with all their scores set to none.

The enclosed attempt will need to have the swell volume formula "fixed" as I just used the first example I could find online. It will also need to be checked to make sure it is using a realistic dataset so you are getting "reasonable" answers.


If I'm not mistaken, the Formula type question would also work well for this type question and allow you to make it a multiple answer fill-in-the-blank question.

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

Re: Dependent answers in two-part questions

by shahin k -

Thanks Al, the idea of defining two correct answers with 50% score for each was quite helpful.

In reply to shahin k

Re: Dependent answers in two-part questions

by shahin k -

I am now wondering if I can define text as variables in this question. For example, if I have three types of soils such as clay, sand & gravel, and common earth with different swell percents as 30%, 12%, 25% respectively, how I can define the soil types as variables in one question. Therefore, the corresponding swell percent is used in the formula each time a soil type is randomly generated in the question text. Like the examples below:

We have clay in a rectangular cube with height = {height} m, width = {width} m, length = {length} m. What is the volume of clay when excavated. (since the soil type is clay, 30% is multiplied by the volume)


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,

The only way that I can think of making a question that randomly picks clay, sand or gravel as well as random height, width, and length would be to use the Formulas type question plugin. Let me know if you can install that plugin and if so, I have a couple versions of the question I can post for you. Here is a picture of one version that asks for the volume with and without the swell factor applied. Might need to make the size random number max a little smaller as in this version all three can be from 10 to 100 in steps of 10. The calculator is optional. I use a Generico filter to put it there for my convenience when creating questions.


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

Re: Dependent answers in two-part questions

by Melissa . -

There is also a random plugin that automatically generates randomly created questions based on criteria (math type questions).  I have not tried it yet.  I have just seen it in the plugin directory as an option.

In reply to Melissa .

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 GamerHeadman,

By any chance, was that one of  the Variable Numeric question types?

In reply to AL Rachels

Re: Dependent answers in two-part questions

by shahin k -

Hi Al,

Thank you for your response. I studied about this plugin and this is exactly what I am needing to design my questions with. I contacted the Admin for the installation since I, as a user, seem not to be able to install it. I will let you know when I have it installed. 

Thanks

Shahin

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,

Hope you are successful in getting your admin to add this question type as it it truly amazing what you can do with it. It can be a challenge to learn how to create questions with it, but it's worth the effort.

In reply to AL Rachels

Re: Dependent answers in two-part questions

by shahin k -

Hi Al,

I hope so too. One of my ultimate goals is to define questions the variables of which are both text and numbers, something like the table attached. I think it is doable with this plugin.

Thanks 

SHahin 


Attachment table.PNG
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

Should definitely be doable with this questions type. That's what I did when making a couple of sample questions for swell factor. I used a random number from 1 to 3 to pick from two lists for soil type and soil swell percentage.

i = {1:3};

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

You should be able to do something very similar.

Average of ratings: Useful (1)
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

Forgot to ask last night, do you have an example question or two using the info in the above table?

In reply to AL Rachels

Re: Dependent answers in two-part questions

by shahin k -

Hi Al,

The table I have posted is related to the heavy equipment productivity. Below is a simple example (with a solution) based on the use of this table and other relevant tables attached. I have italicized those words that are related to the tables and to the formula to solve the problem. 

Problem: find the expected production (LCM/h) of a hydraulic shovel of a Medium-sized shovel equipped with a 4.0 m3 front-dump bucket. The material is common earth with a bucket fill factor of 0.95. The average angle of swing is 75º and the job and management conditions are excellent and good respectively.  

Solution: 

Production = C×S×V×B×E = 150×1.05×4×0.95×0.81 = 484.785 LCM/h

C = Cycles/hr = 150 (Table 3-6: the equipment is medium size equipped with a front-dump bucket)

S = 1.05 (Table 3-6: the adjustment factor for the 75º angle of swing)

V = 4 LCM (a bucket volume in medium range 3.8 - 7.6 m3  )

B = 0.95 (Table 3-2: bucket fill factor for common earth)

E = 0.81 (Table: Job efficiency since the conditions of job and management are excellent and good respectively)


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,

The Formulas type question definitely should be able to handle all that and give you a lot of variation with just one question. I'll try to come up with something soon, but I do have five other projects I'm also working on, so it might be a day or two.

Any word on getting the Formulas type question plugin installed?

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

Re: Dependent answers in two-part questions

by shahin k -

Hi Al,

Thanks much for your help. There is no rush at all. 

Not yet. The manager who should approve the plugin installation is on vacation!

I will let you know.

Thanks again

In reply to AL Rachels

Re: Dependent answers in two-part questions

by shahin k -

Hi Al,

I hope you are doing well. I finally just got access to the Formulas questions plug-in. of course, I am practicing with in in the sandbox. could you please show me how you designed the "productivity" example with three tables with this plug-in?

Thanks much for your help.

Shahin

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,

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.