How to create wildcards that are multiples of 10 in moodle?

How to create wildcards that are multiples of 10 in moodle?

by Nicolás Ruiz -
Number of replies: 2

Hello everybody! I am running Moodle 3.7 and I have a question regarding wild cards.

First of all, I am new to calculated questions and it took a while to learn to use them. 

My problem

I want to create a question where the random values are multiple of 10. Is this possible?

Average of ratings: -
In reply to Nicolás Ruiz

Re: How to create wildcards that are multiples of 10 in moodle?

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nicolás,

Generating random values is much easier with the Formulas question. With this type of question, to obtain random values that are multiples of 10, for example between 10 and 1000, it suffices to write:

a = {10:1010:10};

Depending on what you want to do, you may find the Formulas question easier to use than the Calculated question.

Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: How to create wildcards that are multiples of 10 in moodle?

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello Nicolás,

Of course, you can also do this with the Calculated question. Take question # 7, which is a Calculated question, from the Demo Quiz with all standard Quiz Questions. Let's say we want x (complete beginners) to be a multiple of 10 between 10 and 100, and y (relatively experienced Moodle users) to be a multiple of 10 between 100 and 200.

"Editing a Calculated question" page

Question text: ... In your group you have {={x}*10} complete beginners and {={y}*10} relatively experienced Moodle users.

Answer 1 formula = {x}*10 + {y}*10

"Edit the wildcards datasets" page

Wild card {x}
Range of values: Minimum: 1 - Maximum: 10
Decimal places: 0

Wild card {y}
Range of values: Minimum: 10 - Maximum: 20
Decimal places: 1



With the Formulas question, you just need:

Random variables:
   x={10:110:10};
   y={100:210:10;}

Question text: ... In your group you have {x} complete beginners and {y} relatively experienced Moodle users.

Answer: x + y

Average of ratings: Useful (1)