Multiple choice next to a facultative number answer - Formulas plugin

Multiple choice next to a facultative number answer - Formulas plugin

by Christine Cutting -
Number of replies: 11

Hello,


I am using Moodle version 3+ (I do not know the exact version as it is hidden) and I would like to create a multiple-choice question using the Formulas plugin (I do not have many available unfortunately). Depending on the chosen answer, I would like the students to fill an answer box, for example: what is the domain of function \(f\) ?

  • option A: all reals numbers.
  • option B: all real numbers except "answer box" (students have to fill it)
  • option C: all real numbers except "answer box 1" and "answer box 2" (students have to fill them both)

Do you know how I could do that ? I want them to choose an option first and then fill the answer boxes accordingly. So if they choose option A, they do not have to fill any box, if they choose option B, they have to fill the corresponding box (and only this one) and finally, if they choose option C, they have to fill the two corresponding boxes.

Thank you !


Average of ratings: -
In reply to Christine Cutting

Re: Multiple choice next to a facultative number answer - Formulas plugin

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

While this is not a standard feature of the Formulas question, I think it might be possible to do this using a little JavaScript.

Would you like to have different types of domain and if so which ones? Do options A, B or C depend on the type of domain for a given function? It would be easier for us to help you if you provided a more specific example of what you want to do.
In reply to Dominique Bauer

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Christine Cutting -
Thank you for your quick reply.
What I want to do precisely is give my students a function and I want them to find its domain. For example, if the function is \( \frac{3}{x+2} \), I want them to say that the domain is \( \mathbb{R}\setminus\{ -2 \} \) and if the function is \( \sqrt{x-5} \), that it is \( [5,+\infty[ \).
I thought that the simplest way to program that question was to give them several options (all real numbers, all but one, all but two, a semi-infinite interval) they can customise. So if they choose that the domain is all real numbers, they do not have to fill any answer box. But if they choose that it is all real numbers but one, they have to say which number is not in the domain. And in the case of a semi-infinite interval, they have to give its boundaries.
Is it clearer ?
In reply to Christine Cutting

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Yes, it is clearer but I don't think it will be easy to do. Give me a little time to look at this.
In reply to Dominique Bauer

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
Is it an exam or an exercise? More specifically, are students entitled to more than one try on the question?
In reply to Dominique Bauer

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Christine Cutting -
I would be interested in both but I will take whatever option works.
In reply to Christine Cutting

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
The question could take the following form. Would this suit you? This is just the format of the question. Verification of the answers remains to be done.



In reply to Dominique Bauer

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Christine Cutting -
Yes, it would be exactly what I need !
In reply to Christine Cutting

Re: Multiple choice next to a facultative number answer - Formulas plugin

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

Sorry for the delay. I need to fix a little bug...
In reply to Dominique Bauer

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Christine Cutting -
No worries, thank you so much for your help smile
In reply to Christine Cutting

Re: Multiple choice next to a facultative number answer - Formulas plugin

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

Hello Christine,

Here is the question I prepared for you: https://moodleformulas.org/course/view.php?id=78&section=34 ↗

I have taken the liberty of including it in moodleformulas.org's question bank and giving your name as co-author. Hope you don't have a problem with this.

The question can be changed relatively easily to consider other functions, but you have to take the time to understand the code.

Choice 4 is made up of four entries: two brackets, a number and infinity. For now, the score for this choice is all or nothing, but it would be easy to add criteria to award a portion of the points to each entry.

Disadvantages:

  • The script is a bit long and complicated because it's almost like a new question type.
  • The order of the choices is not random. Maybe it could be, but the code would probably get even more complicated.

Advantage:

  • The question seems to be working fine.

In reply to Dominique Bauer

Re: Multiple choice next to a facultative number answer - Formulas plugin

by Christine Cutting -
Wow this is amazing, thank you so much !!! I am sorry to have taken so much of your time, especially considering that this plugin was not developed for such questions. I will take time to understand the code as it will prove to be useful for similar questions.