Question type with random dataset with predefined answers

Question type with random dataset with predefined answers

by Olon Beauchemin -
Number of replies: 5

Hello,

Is there a question type that would choose from a random data set with predefined answers? The formula question cannot be used because I need to mix types (integers and strings) and use operators and functions that are not available Moodle.

Right now, my solution is to duplicate each question which is OK but not practical.

Example :

What is the maximum memory, in bytes, supported by a {a} computer architecture?

If we install {b} of memory on this computer, how many bytes will be unused?

Dataset :

a = {"32 bits", "8 bytes", "10 bits"}

b = {"64 Gb", "1000 KiB", "2 MB"}

Answers 1 = {4294967296, ...}

Answers 2 = {3705032704, ...}

In this question type, a and b would always be in sync. "32 bits" would always be used with "64 Gb", "8 bytes" would always be used with "1000 KiB", etc.

Average of ratings: -
In reply to Olon Beauchemin

Re: Question type with random dataset with predefined answers

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

Hello Olon,

At first glance and from what you give as an example, I think we can use the Formulas question and that it's probably easy to do.

Is your example complete or does it have other questions? What are the formulas for Answer 1 and Answer 2?

In reply to Dominique Bauer

Re: Question type with random dataset with predefined answers

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

The units can be a bit tricky but not that much. The rest is a snap.

In this example, we ask what is the maximum memory of a computer with an 8-bit, 10-bit or 32-bit architecture chosen at random.

ForumQuiz_20210829_1811.png


You can try and download the question at https://moodleformulas.org/course/view.php?id=104&section=6 ↗.

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

Re: Question type with random dataset with predefined answers

by Olon Beauchemin -
Thank you for your answer! Using your example, I made two questions, one for each type of unit (32 bits vs 8 bytes) in the statement. Instead of having 10 duplicate questions, I have only two which is more manageable.

However, I can't use formulas questions with some problems. Let's say I ask student to convert from a binary floating point number to decimal. I do not think Moodle supports bitwise operators. So in that case, I think I would need to have the questions duplicated?
In reply to Olon Beauchemin

Re: Question type with random dataset with predefined answers

by Olon Beauchemin -
I've found this question that answers mine : https://moodleformulas.org/course/view.php?id=104&section=5

I can use an array containing the right answers.
In reply to Olon Beauchemin

Re: Question type with random dataset with predefined answers

by Dominique Bauer -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
I understand that you have the answers to your questions. If I misunderstood or if you have any further questions, please do not hesitate to ask them.
Average of ratings: Useful (1)