Formula Question Type: 2 or 3 answers to Random Variable

Formula Question Type: 2 or 3 answers to Random Variable

by Dipo Adeniyi -
Number of replies: 8

Good afternoon,

Pls I'm trying to see if this is possible.

Bar Charts

Test question: How many millimetres of rainfall in August?

I want to define random variables:

months = {"January ", "February ","March ","April ","May ", ... "August""November "," December",

So that I can change the Test question: as: How many millimetres of rainfall were there in {months}?

I would also have already defined that January  = {50}, etc

This is to allow asking questions for several months as variables instead of writing out questions for various months?

Any help would be greatly appreciated.

Many thanks.


Average of ratings: Useful (1)
In reply to Dipo Adeniyi

Re: Formula Question Type: 2 or 3 answers to Random Variable

by Matthias Giger -
Picture of Particularly helpful Moodlers

This should get you started.


Import as Moodle XML-Format question into a test through the question database.

For this question you will need the JSX-Filter installed.


If everything works, the question should look like this:

Barcharts in Formulas

The question generates a random set of values and then randomly chooses a month.

Average of ratings: Useful (4)
In reply to Matthias Giger

Re:

by Dipo Adeniyi -
Thanks so much Matthias. I deeply appreciate this. I have installed JSX-Filter, but graph not showing. Will try again and let you know.
In reply to Matthias Giger

Re: Formula Question Type: 2 or 3 answers to Random Variable

by Dipo Adeniyi -

Thanks again. I have tried several times but keep on getting the below. I guess it has to do with the  JSX-Filter, although it says successfully installed.

Image

I am using Moodle 3.4.6.

In reply to Dipo Adeniyi

Re: Formula Question Type: 2 or 3 answers to Random Variable

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

Hello Dipo,

Graphs can easily be incorporated into Formulas questions using third-party applications. There are several of them. Here are some of them, in alphabetical order:

Variables can be passed to application scripts in the same way as to text and to equations, i.e. by enclosing variable names with { }. Expressions such as {=x/1000} can also be passed.

Some of these applications are easier to use than JSXGraph. For example, with ApexCharts you have nothing to install and the script is pretty simple. With the attached XML file, your question would look like this:

ForumQuiz-20190610-1043.png

You will find more information at MoodleFormulas.org ↗.

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

Re: Formula Question Type: 2 or 3 answers to Random Variable

by Bernat Martinez -

Hello Dipo,

In fact to use JSXGraph you don't need to install JSXGraph filter, see in the attachment an example. The use of the filter is only useful in some occasions.

In my opinion, not all  graph applications can do the same. Most of them the only thing that can do is graphs, JSX Graph can do much more, as it is a powerful library supported by a dedicated team from Bayreuth University. In fact, JSXGraph has been chosen by STACK as a means of performing graphical questions.

Average of ratings: Useful (2)