Set question in quiz as mandatory?

Set question in quiz as mandatory?

by David Nash -
Number of replies: 18

Hi,

Is it possible to set questions in a quiz/test as mandatory, as all questions must be answered in particular tests.

What happens at the moment is that if a user does not answer the question they are automatically marked as incorrect, which is not what I want, especially if a user simply skipped a question to come back to later and then forgot to answer the question.

Average of ratings: -
In reply to David Nash

Re: Set question in quiz as mandatory?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I assume you are using Moodle 1.9.x. Try Moodle 2.0. It may address your concerns.

In reply to Tim Hunt

Re: Set question in quiz as mandatory?

by David Nash -

Hi, Yes, 1.9.3.

Working on updating to 2.01. Still testing to make sure that the Live Server will update ok. Have to also update PHP and Apache so this needs to be tested also so as not to effect other applications.

thanks for the update

In reply to Tim Hunt

Re: Set question in quiz as mandatory?

by David Nash -

Hi, I have upgraded now to 2.2 on the test server.

I cannot see where I can set the questions in a quiz as manatory or compulsery.

I simply need the option that users cannot submit a test without attempting all of the questions.

In reply to David Nash

Re: Set question in quiz as mandatory?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

David "I simply need the option that users cannot submit a test without attempting all of the questions."

If you were doing that test on paper, what would you do to force the students to answer all questions before handing their paper?

Joseph

In reply to Joseph Rézeau

Re: Set question in quiz as mandatory?

by Itamar Tzadok -

I could have someone reviewing the papers and returning them to the students if not all questions were answered. It's not difficult and should be easier with an online system. smile

In reply to Itamar Tzadok

Re: Set question in quiz as mandatory?

by Lev Abramov -

You can create a sort of "all-or-nothing" tool: unless ALL questions have been answered, the quiz remains ungraded (grade 0?). A bit cruel - but if this is the objective... smile

Lev

In reply to Itamar Tzadok

Re: Set question in quiz as mandatory?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

I beg to disagree, Itamar. If it's an exam with a set time, it would be unfair to the other students to return their test for completion to those students who would have left some questions un-answered.

I have quite a few times expressed the opinion in this forum that I see no reason to force students to answer questions that they do not want to answer or - more likely - do not know the answer to.

Please note that this is quite different from a (desirable?) feature of warning the students, upon submitting their test, that they have left some questions un-answered, and providing them with the option to answer them or submit anyway.

Joseph

In reply to Joseph Rézeau

Re: Set question in quiz as mandatory?

by Itamar Tzadok -

By the same token, Joseph, I see no reason to force an instructor to this or that strategy/pedagogy.

One of the main advantages of online assessment over in-class assessment is realized in precisely such features. You can allow the instructor to require answers to all questions and attach to the timer a warning to students if not all questions are already answered. smile 

In reply to Joseph Rézeau

Re: Set question in quiz as mandatory?

by Ermal Apostoli -

Hi Joseph,


I notice you are very addamant on this but we have a very practical problem.


1. We work with middle schoolers, they tend to click on random buttons.
2. There is a pre and post test that are identical thus we need sequencial quizes (which we now have).

3. Students press the next button by mistake than complain they cant go back to that question.


so if we forced them to answer this would not be a problem. I am also fine with a I don't want to answer option, but something needs to be checked so they don't move on by mistake.

We can code our way out of this, but need a place to start.

 

Thank you for any help,

Ermal

In reply to Ermal Apostoli

Re: Set question in quiz as mandatory?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I see, so the real problem is that students accidentally, or mistakenly, click next before they have answered all the questions, and then they cannot work out how to get back to the previous page. That is a useful observation.

Moodle provides to mechanisms to try to solve this: the navigation block shows which questions you have answered, and you can click there to get back to any question; and the summary page gives you a summary of which questions you have answered, and another way to get back to answer any missed ones, before you click Submit all and finish. However, these mechanisms are still not working for your students.

Like Joseph, I am sceptical that enforcing "Answer all questions before you can go on to the next page" will really solve the problem. I fear that student will just be a bit more persistent as they "click on random buttons" until the computer does let them move on.

However, you asked for pointers, and so here they are. You need to look at mod/quiz/processattempt.php. In particular look at how it works out which page it should go to next after it has processed all the responses from the current page.

The one thing that is not currently done in that code, which you will need, is to check the state of each question. For that you will need something like

        foreach ($attemptobj->get_slots($thispage) as $slot) {
            $state = $attemptobj->get_question_attempt($slot)->get_state()
            // Do something with $state.
        }
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Set question in quiz as mandatory?

by Ermal Apostoli -

Thanks Tim! We unfortunately have to force students through a sequential path, because the pre and post test we administer are identical, that is why they can't go back through the navigation widget.

In reply to Ermal Apostoli

Re: Set question in quiz as mandatory?

by samaya b -

Hi,

in the renderer.php file , The function "attempt_form" you should few  things to achieve this.

Added  jquery files and validated the radio buttons with the name attribute. if the radio group having the same name is empty then alert a message. Hope this works!

public function attempt_form($attemptobj, $page, $slots, $id, $nextpage) {
 
<script language='javascript'>
function callValid() {
var names = {};
$('input:radio').each(function() { // find unique names
names[$(this).attr('name')] = true;
});
var count = 0;
$.each(names, function() { // then count them
count++;
});
if($('input:radio:checked').length == count) {
return true;
}
else
{
alert( 'Please answer all questions');
return false;
}
}
</script>

and

$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'next',
'value' => get_string('next'),'onClick'=>'return callValid();'));

 

here u have to trigger a function to validate.

Samaya

www.placetoexplore.com

 

In reply to samaya b

Re: Set question in quiz as mandatory?

by Manuel Costales -

This solution didn't work for me, but what I did was create a function in javascript using confirm:

echo "

<script language='javascript'>

function areyousure(){

        return confirm('Are you sure?');

}

</script>

";


and

$output .= html_writer::empty_tag('input', array('type' => 'submit', 'name' => 'next',
'value' => get_string('next'),'onClick'=>'return areyousure();'));

In reply to David Nash

Re: Set question in quiz as mandatory?

by Marty Soupcoff -

I have to agree with Joseph on this one. Forcing students to answer every question before allowing them to submit an exam is a little much. What if the teacher has set up penalties on the quiz? If they leave the question blank because they didn't know the answer, then they just don't receive credit for it. If they are forced to guess on a question, they would then lose points if they got it wrong.

Taking a step back even farther, if you want to force students to answer every question, how are you going to force students to take the quiz in the first place?

Furthermore, if the objective is making sure students answer all the questions before submitting, in 2.x the quiz module has a summary of the attempt page (Student Perspective > Process of taking a quiz > Step 8) that students can review before submitting. It will let them know which questions have been answered and which are unanswered. If a student reviews the summary page and still submits a quiz with an unanswered question, in my mind you have done all you can to make them aware of the unanswered question.

Happy Moodle Logooodling!

In reply to Marty Soupcoff

Re: Set question in quiz as mandatory?

by David Nash -

The issue is simple:

A user has been given a test of 50 questions.

They go through the questions as they are able to answer them. Then they go back to the ones they had initial difficulty with.

On some occasions, they might even think they ticked the correct radio button or multiple answer box, but did not.

When they submit their test, they are not aware that they have not answered or may have forgotten to answer a question or two.

Currently these questions are marked as incorrect once submitted.

When I check the test attempt I often see questions that are marked as incorrect but have not been answered/attempted at all.

I simply want to give the students a notification that they have unanswered questions before submitting.

And yes, there are occasions when we require answers.

We are in an Industry Environment, not Academic, and so the thinking is different.

Currently, if they do not need to answer a question.......they won't!

Less than 10% of users will fill out an evaluation form...that's another story.

As we deal with professional workers and they have their jobs to do, my job is to find and determine the trainings gaps so that we can fill those gaps with targeted training so that they can succeed in their jobs.

We are not trying to punish anyone, but provide the needed support, since different people learn at different speeds, and take in information differently.

In the academic world you are "punished" with no mark for not attempting or getting the answer wrong....you then simply move on.

We cannot do that, we need to understand why they get it wrong, or why it was not attempted and then build a training structure for that person to allow them to do their job successfully.

We do not share or publicise their results, even to the user, unless there are drastic results. We use the information to improve their knowledge, not punish them for getting it wrong.

Unfortunately there is often too much emphasis on Academic  pedagogy which does not apply often to Industry learning. But that is another debate.

In reply to David Nash

Re: Set question in quiz as mandatory?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

"I simply want to give the students a notification that they have unanswered questions before submitting."

That is exactly what happens in Moodle 2.0+

Why are we still arguing?

Average of ratings: Useful (1)
In reply to David Nash

Re: Set question in quiz as mandatory?

by Lev Abramov -

If you make the survey a conditional activity - e.g., the final grade is not visible untilo the survey has been completed - then you can get it done. Just keep in mind that in this case, the ONLY/MAIN motivation to complete it is the desire to see the grade, and not to share what they REALLY think. So - the grain of salt we always take when reviewing survey results will have to be doubled in this case. smile