Randomize Radio Button Answers Within a Formula Question

Randomize Radio Button Answers Within a Formula Question

by Daniel Milan -
Number of replies: 4

Hello whomever can help, 

I am wondering if there is code that will allow the images and associated answer radio buttons to randomize within a formula question.  I looked at the random "letter" example in the FormulaQuestion help, but that is far more complicated then I need (nor can I understand).

I have included the xlm.

Thanks in advance.

Average of ratings: -
In reply to Daniel Milan

Re: Randomize Radio Button Answers Within a Formula Question

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi Daniel,

Yesterday, I tried looking for the "letter" example you mention in the Formula Question Help, but could not locate it. Could you provide a link to it:

Using formula question type to generate random values for your question is pretty easy to do, so that each student winds up with their own specific question. The trick is to generate the correct graph and three incorrect ones to go along with it.

The problem I've run into is being able to generate your graphs like you show in the pictures included in your sample question. Could you tell me what you used to create the graphic plots? I'm trying to do it with a JSXGraph filter for Moodle, with limited success so far.

In reply to AL Rachels

Re: Randomize Radio Button Answers Within a Formula Question

by Daniel Milan -

Hi Al, 

Thanks for taking a look at my predicament.  I have attached the xml file of the example I was referencing.  It is from the formula question examples:

https://moodleformulas.org/course/view.php?id=22&section=19

As for the "graphs".  They are not graphs, they are png. images that I created in Visio and uploaded.

I have had success with randomizing formula questions when there is a multiple calculated answers that can be shuffled.

The issue with this style of radio button question is that the answer set is created within a table.  

I'm wondering if there is a way to shuffle the image answers and the corresponding radio buttons with the images.  Shuffling the images will do nothing if the answer is always set to be the second radio button for example.

Thanks again for your help.

In reply to Daniel Milan

Re: Randomize Radio Button Answers Within a Formula Question

by AL Rachels -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Thanks for the link you gave as a reference to what you are trying to do. Now I understand.

One problem I note with your use of png image files for the students to select from, is that the names of the images tell me the correct answer. Due to my age related vision problems, I generally have to zoom in on some images to "see" what is there and I routinely right click and view images, or download them to a viewer. The name of the image then appears and I could instantly see that the first one I viewed was a wrong answer. I quickly found that the fourth one was the right one.

Anyway, to do this question is easier as a Cloze type question than it is as a Formulas type. I created the shuffled MC part as just words using the Atto Cloze tool, and then drag and drop the image for each answer. The sample I enclose includes two versions of the question. Each question has two Cloze numerical, and one Multiple Choice with shuffle. Since I have no idea how to calculate the right "phasor" I have wrong and right included in the first question so I could get the right answer. In both questions I did not change the names of the pictures, but both work and shuffle the pictures.

In reply to AL Rachels

Re: Randomize Radio Button Answers Within a Formula Question

by Daniel Milan -
Thanks Al,



I originally had this question as a Cloze question as it is most certainly

the easier way to tackle it.  I think that I will just stick with that for

now.



Appreciate the help



On Wed, 19 Sep 2018 at 11:38, AL Rachels (via Moodle.org) <