calculated quiz question

calculated quiz question

by Stephen Eglinski -
Number of replies: 3

Hello, 

I am trying to set up a several calculated quiz questions and am getting stuck on how to have moodle only calculate whole numbers in the question.  I want the students to convert the ingredients in a recipe from grams to ounces and have set up the question with all of the ingredients as ratios to one ingredient.  The base amount is produced by the calculated question and then all the other ingredients are calculated in relation to that.  I'm good so far getting the question to work.  The problem I'm having is that it is calculating the new numbers with decimal points and I am looking to have only whole numbers.  I think I am just missing a button or toggle somewhere but don't know where.  Here's the question.

Use the following recipe and covert the ingredients from grams to ounces

Lean dough

bread flour  {b}

salt  {={b}*0.02}

yeast {={b}*0.01}

water {={b}*0.66}


How many ounces of bread flour?


Average of ratings: -
In reply to Stephen Eglinski

Re: calculated quiz question

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Moodle provides several functions, including round, floor, ceil, and probably some others.

But your desire to round doesn't make sense.  Let's say someone wants to make one bun (or roll) that only takes 40 g or flour.  For the yeast, this would calculate to .4.  Would you round this down to zero, meaning no yeast?    So I think you might want to round to at least one decimal, and of course, don't use small values for flour.

The round function looks something like this: round([amount],[number of decimal places]) ex. ROUND({a},3).

If you do this correctly, you might get what you desire.

I use water {={b}*0.76}, salt  {={b}*0.025}, and yeast {={b}*0.003}.  The yeast affects the length of bulk fermentation, in this case around 10-12 hours.

The French might do it a little differently.


Attachment 20170619-Ricks Bread.JPG
In reply to Rick Jerz

Re: calculated quiz question

by Stephen Eglinski -

Thanks for getting back.  I am trying to use the "round" function but not having any luck.  First I thought it might be because since I don't want any decimal places and put in "0" that it caused a problem but I went and tried it asking to round to 1 decimal place and still no luck.  See below.

Use the following recipe and covert the ingredients from grams to ounces

Lean dough

bread flour  {b}

salt  ROUND({={b}*0.02},1)

yeast {={b}*0.01}

water {={b}*0.66}

Here is the preview.

Use the following recipe and covert the ingredients from grams to ounces

Lean dough

bread flour  1433.6

salt  ROUND(28.672,1)

yeast 14.336

water 946.176


(BTW your loaves of bread look very nice.)


How many ounces of bread flour?

Answer:


How many ounces of bread flour?



In reply to Stephen Eglinski

Re: calculated quiz question

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I gave a presentation about Calculated Mulitchoice questions a few years ago. Maybe it will help. The ROUND function is available and should work, but you might need to practice it. I am not an expert on all Moodle functions, but I think it might take the form of {=round({b}*0.66,2)} or something like that.

MoodleMoot2019 (Global and Mountain), "Using Calculated Multichoice Questions"

Ken Forkish's book titled "Flour, Water, Salt, Yeast" says that flour should be the starting point, and he always begins with 1000g. When I make bread, I prefer only one loaf, so I start with 500g.