Wildcards in Calculated Question (ver 3.0)

Wildcards in Calculated Question (ver 3.0)

by Rameshwar Vupadhyayula -
Number of replies: 5

In word problems, how can I introduce wildcards for text values such as names? I do not wish to have the same names in all questions generated. I would like to give a set of values and allow the system to pick random value from that set. 

Average of ratings: -
In reply to Rameshwar Vupadhyayula

Re: Wildcards in Calculated Question (ver 3.0)

by Pierre Pichet -

"In word problems, how can I introduce wildcards for text values such as names?"

As calculated questions are designed to handle wildcards for numerical values, this questiontype cannot handle your needs.

Or perhaps I do not understand well your needs ?

Pierre

In reply to Pierre Pichet

Re: Wildcards in Calculated Question (ver 3.0)

by Rameshwar Vupadhyayula -

Let us say for example, the question states...


John is traveling at a speed of 25 mph.

In this question, we can change the number '25' by using a wildcard. However, all questions will carry the word 'John'. If I want to have one among {John, Smith, Dave, Trevor}, can it be done?

GeoGebra has this feature. I have been using GGB and hence this query.

In reply to Rameshwar Vupadhyayula

Re: Wildcards in Calculated Question (ver 3.0)

by Pierre Pichet -

This is not a feature of Moodle Calculated question.

But this can be done by creating four similar questions with the only difference being the name.

You put them in a specific category and use the random question feature when building the quiz.

If you have a lot of questions, this will complexify unnecessarily ( I think) your quiz.


In reply to Rameshwar Vupadhyayula

Re: Wildcards in Calculated Question (ver 3.0)

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

Yes, I too know exactly what you are requesting, I would love this randomly selected "word" to go along with the randomly selected variable, but as Pierre said, moodle doesn't do this "yet."

Pierre's suggestion could work, but it required more thinking when you are creating questions and creating exams.

You can add this idea to the Moodle Tracker system as a suggested "enhancement."  Maybe someone would develop this feature.  I really like the idea, but as a non-programmer, don't have a feel for how much work it would take to do this.

a=4, a1_text="Bob", a2_text "is a drive"

a=3, a1_text="Mary", a2_text "is an executive"

And so forth.

In reply to Rick Jerz

Re: Wildcards in Calculated Question (ver 3.0)

by Matthias Giger -
Picture of Particularly helpful Moodlers

The easiest way to include a random name is to include a small javascript into your question.

I didn't try it in calculated questions, but it certainly works in the cloze question type.


Go to the HTML view and enter something like this:


<p>Just an example.</p><p>Hi 
<script>
var names = ["Steven","Peter","James","Ralph"];
n = Math.trunc(Math.random()*names.length);
document.write(names[n]);
</script>
</p><p>What is the sum of 2 + 2 = {1:NM:=4}.<br></p>


I use small scripts like this, if I want students to work on different topics.

The only problem with the approach, it is not permanent. When you reload the question another name will appear, but I think for your purpose it doesn't really matter.