Handling with blank answers

Handling with blank answers

by Giuliano Boava -
Number of replies: 9

Hello!

 This is my first post here, so I apologize in advance if I'm doing something wrong. I also apologize for the bad English.

 I love the "Formula" type question, but in a recent attempt, I ran into a problem that I can't solve. I searched several posts here and apparently, there is no solution for that right now. Even so, I share here to see if anyone proposes a solution.

 I would like to create a question with several items of type True / False (say, 5 items). Each one weighing 0.2 and the student has the following options: True, False and "I don't know". Choose "I don't know" does not lose or earn points. Choose True or False incorrectly loses 0.2.

 I can create a question like this without using the "Formula" type, but using the "Multiple choice" type. In this type, it is necessary to create 2 * 5 = 10 items, in which the student assigns one of them to True, another to False and does not assign any to "I don't know". But this solution is not the most elegant.

 I switched to the "Formula" type and managed to reproduce the same behavior using only 5 items, placing a dropdown for each item and each dropdown with three possibilities: "True", "False" and "I don't know". In order to be able to deal with discounts for incorrectly marked items, I had to place all items in the same part and consistently configure the Grading criterion. Everything worked (almost) perfectly!

 Unfortunately , when any dropdown is left blank, the Grading criterion is completely ignored and a score of 0 is always assigned. Is it possible to work around this situation? There may be more specific questions.

1. Is it possible to identify when a dropdown is left blank and be able to choose the Grading criterion from that condition?

2. Is it possible to create dropdown without the blank space option?

3. Is it possible to have Moodle automatically assign the value “I don't know” when the dropdown is left blank?

 The option to allow multiple attempts in the quiz is not good in my case.

 I would also like to keep the "Formula" type as it allows me to store several items and can choose 5 at random and allows using variables in the items.

 

Thank you! Best regards,

Giuliano.


PS. I couldn't find the version of Moodle that I use. What I can say is that I use Moodle made available by the Federal University of Santa Catarina (UFSC - Brazil).

Average of ratings: -
In reply to Giuliano Boava

Re: Handling with blank answers

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

Before going any further, it is important to know if you could instead put the five items in five different parts. It would be much easier and, unless the items are linked together, this is the normal way to proceed. Perhaps you could attach a simplified version of your question so that we can better assist you.
In reply to Dominique Bauer

Re: Handling with blank answers

by Giuliano Boava -
Thank you for the feedback, Dominique!

My first attempt was to do it in separate parts, but as the student should be penalized in the score if they mark a wrong answer, so I had to put all the items in the same part. This solved the scoring problem, but created the blank answer problem.

I attached a test version of the question. I hope it is possible to better understand what I would like to do.

In summary, there are 5 items and
1. If he correctly marks True or False: he receives 0.2.
2. If he incorrectly marks True or False: he loses 0.2.
3. If he marks "I don't know": he doesn't lose or win.

Thank you!
Giuliano.
In reply to Giuliano Boava

Re: Handling with blank answers

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

I understand better what you want to do.

In the quiz settings, set the question behaviour to "Interactive with multiple tries". It doesn't force multiple tries, you can only have one if you want. The feedback you want to give to students is controlled in the review options under "During the attempt". By setting the question behaviour to "Interactive with multiple tries", students are forced to answer all questions, so there can be no unanswered questions.

With the drop-down menus, the first choice may display a message such as "Please select" or be left blank. In both cases, this means that no selection has been made yet. It is possible to remove it and preselect a choice such as "I do not know" but this requires a custom script and it may not be necessary if you set the question behaviour to "Interactive with multiple tries" like I mentioned above.

Another option would be to use radio buttons. You can arrange them horizontally if you want. With radio buttons, it is not necessary to have a blank choice as it is obvious when none of the radio buttons is selected. As with the drop-down menu selection, by setting the question behaviour to "Interactive with multiple tries", students are required to answer all questions, so there can be no unanswered question.
Average of ratings: Useful (1)
In reply to Dominique Bauer

Re: Handling with blank answers

by Giuliano Boava -
Thanks again, Dominique!

I did some tests with the "Interactive mode with multiple tries", but the fact that the student can close the quiz without completing it is still an unwanted effect.

On the other hand, I think that using radio buttons with a script to start all the radio buttons with a particular item marked solves the problem. In fact, as the radio buttons cannot be unchecked (at least not in my Moodle version), the initialization with an already checked alternative prevents any item from being left blank.

I searched the manuals and managed to find a script to show the radio buttons horizontally (it works for me):

But I couldn't find a script to start the radio buttons with an option checked. In addition, I would like to know if it is possible to add a line in the script to control the space between the radio button and its corresponding text.

I believe that with these changes we will have the desired behavior.

Thanks a lot for the help!
Giuliano.
In reply to Giuliano Boava

Re: Handling with blank answers

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

Hello Giuliano,

If I understood you correctly, you would like to have something like this:

ForumQuiz_20210303_1800.png

To start the radio buttons with an option checked, add the following line:

$('input[type="radio"][value=2]').prop('checked', true);

To add a line in the script to control the space between the radio button and its corresponding text, add the following line:

$(".multichoice_answer .r0 label, .multichoice_answer .r1 label").css("margin-left", "7px");

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

Re: Handling with blank answers

by Giuliano Boava -
That's it! Exactly what I was looking for! Thanks a lot for the help.

Without wanting to abuse his goodwill, there was only one thing that didn't work here: the spacing between the radio button and its corresponding text.

I thought I was doing something wrong, but even when I imported the xml, the spacing didn't appear as it should. I tried to make all kinds of changes among "padding" or "margin", "left" or "right", with or without "label". None of these options was able to reduce the space. I think there is some configuration overriding the command.

But this spacing is just a small detail. The question works perfectly, exactly as I would like.

Once again, thank you very much for your help.
Best regards,
Giuliano.


In reply to Giuliano Boava

Re: Handling with blank answers

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

Hello Giuliano,

We could meet on Zoom if you want to investigate this spacing problem. (There is only a two hour difference between Florianópolis and Montreal.) Email me and I'll send you an invitation.

In reply to Dominique Bauer

Re: Handling with blank answers

by Giuliano Boava -
Hello Dominique,

I probably got it wrong and instead of posting an answer here, I sent an email directly. Anyway, here I put the message I sent to your email.

If it is not uncomfortable for you, I would accept a meeting at Zoom to investigate the spacing problem. And if possible, I would like to add an additional question to the meeting: if there is any script capable of creating new functions that can be used in numerical and algebraic answers (basically, the idea is to create functions whose names are in Portuguese, for example, "sen" instead of "sin").

In the next two weeks, the possible days and times for me are:

03/18, Thursday, 2pm to 12pm (12am to 10pm in Montreal);
03/19, Friday, 2pm to 12pm;
03/22, Monday, 2pm to 12pm;
03/23, Tuesday, 2pm to 12pm;
03/24, Thursday, 2pm to 12pm;
03/25, Friday, 2pm to 12pm.

Thank you for all the support you have given me and everyone in the community.
Sincerely,
Giuliano.
In reply to Giuliano Boava

Re: Handling with blank answers

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

Let's meet at 2 p.m. (your time) Thursday. I just sent you the invitation link by email.