Negative marks/points in multi answer quiz

Negative marks/points in multi answer quiz

- Manoj Rajiwadekar の投稿
返信数: 15

Hi, 

I am using moodle 3.6.

I observed behaviour of negative scoring in multiple choice questions. When there is only a single answer the scoring can be negative and when there are multiple answers possible the lowest grade is 0. How can I change this for multi answer questions? Is there any plugin or hack possible for this?

Manoj Rajiwadekar への返信

Re: Negative marks/points in multi answer quiz

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers

With the Multiple choice question type, the lowest possible score is 0, regardless of whether it is set to Multiple answers allowed or to One answer only.

Dominique Bauer への返信

Re: Negative marks/points in multi answer quiz

- Manoj Rajiwadekar の投稿

Are you referring to total quiz's score. I am referring to each question's score.  

Manoj Rajiwadekar への返信

Re: Negative marks/points in multi answer quiz

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers

Manoj,

I was referring to the total score of the question. Regarding the score for each individual choice, it can be set between 100% and -100%, regardless of whether the question is set to Multiple answers allowed or to One answer only.

I suggest that you check the settings of your question. You can try a Multiple choice question on the Moodle sandbox to verify the correct behavior.

You can also consult the documentation of the Multiple choice question type on MoodleDocs:

Single-answer questions

...You can specify negative or non-negative marks for each answer...

Multiple-answer questions

...Each answer may carry a positive or negative grade...

I do not know why you can not set negative grades when you set Multiple answers possible. This is not the expected behavior. Maybe someone else can help you.

Dominique Bauer への返信

Re: Negative marks/points in multi answer quiz

- Manoj Rajiwadekar の投稿

Hi Dominique,

I think you didn't understand my problem.

Let me explain it with some screenshots. 

Case 1:

When I take a multi choice question with single correct answer in "deferred feedback" and allot the correct answer 3 points and -33% for any incorrect option then I see following question behaviour.


Case 2: And when I select a question of multi choice with multiple answers in "deferred feedback" and allot 3 points for question with 3 correct options (that means individually 1 point for a correct option) and -33% for any incorrect option (that means -1 for any incorrect choice) then I get 0 point instead of -1 if I select 2 incorrect and one correct option.


I hope I am pretty much clear here. Anyways, thanks for your help. 

Manoj Rajiwadekar への返信

Re: Negative marks/points in multi answer quiz

- Tim Hunt の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 Plugin developers

That is the expected behaviour.

Tim Hunt への返信

Re: Negative marks/points in multi answer quiz

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers

Single-answer questions (MoodleDocs)

... A single-answer Multiple Choice question can result in a negative grade.

During the attempt and review, the above statement is correct for Deferred feedback. It is incorrect for Adaptative mode and Interactive with multiple tries: the lowest possible mark is 0.

In the Gradebook, the above statement is incorrect for Deferred feedback, Adaptive mode and Interactive with multiple tries: negative grades do not appear in the gradebook, i.e. the lowest possible mark is 0.

All this is not properly documented. The negative mark for Deferred feedback during the attempt and review is a misleading behaviour.

Dominique Bauer への返信

Re: Negative marks/points in multi answer quiz

- Manoj Rajiwadekar の投稿

Also, I don't understand why there is difference in behaviour for same type of question i.e. MCQ

Manoj Rajiwadekar への返信

Re: Negative marks/points in multi answer quiz

- Tim Hunt の投稿
画像 Core developers 画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Peer reviewers 画像 Plugin developers

The are not the same type of question. The grading calculation is completely different and always has been.

Tim Hunt への返信

Re: Negative marks/points in multi answer quiz

- stefan weber の投稿
画像 Plugin developers

i just had the same problem and stumbled on this thread via google

i find this behaviour extremely misleading - it is neither documented nor can anyone except this

how are people supposed to know that these are not the same type of question?

  • the name of the question type is the same
  • the plugin name of the question type is the same
  • both are created by choosing the same question type in the question chooser

for one to allow negative points while the other doesn't clearly makes absolutely no sense, and is very misleading, even by moodle standards

there is not even any help text for the "one of multiple answers" setting - so how should anyone expect that this setting chooses a completely different grade calculation method? it makes no sense!

stefan weber への返信

Re: Negative marks/points in multi answer quiz

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers

Hello Stefan,

Tim Hunt provided the reason for this at https://moodle.org/mod/forum/discuss.php?d=383245.

Dominique Bauer への返信

Re: Negative marks/points in multi answer quiz

- stefan weber の投稿
画像 Plugin developers

sorry, I don't understand the reasoning at all - apparently it is about adaptive behaviour being more consistent that way? I don't see or understand the connection here.

also, the overwhelming majority of quizzes uses deferred feedback, so wouldn't it make more sense to have that behave consistently, rather than sacrifice consistency there in order to make adaptive consistent?


Tim Hunt への返信

Re: Negative marks/points in multi answer quiz

- Dominique Bauer の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers

Tim,

It would help me clarify the question if you could comment on my last post. I am right? I would not want to mislead anyone. Should clarification be provided in MoodleDocs?

Manoj Rajiwadekar への返信

Re: Negative marks/points in multi answer quiz

- Suhailan Safei の投稿

I have managed to fix this problem by adding the following codes: 

- Filename : moodle/question/type/multianswer/question.php
- Function name: function grade_response(array $response) 
- Code added at line 267

public function grade_response(array $response) {
        $overallstate = null;
        $fractionsum = 0;
        $fractionmax = 0;
        foreach ($this->subquestions as $i => $subq) {
            $fractionmax += $subq->defaultmark;
            $substep = $this->get_substep(null, $i);
            $subresp = $substep->filter_array($response);
            if (!$subq->is_gradable_response($subresp)) {
                $overallstate = $this->combine_states($overallstate, question_state::$gaveup);
            } else {
                list($subfraction, $newstate) = $subq->grade_response($subresp);
                $fractionsum += $subfraction * $subq->defaultmark;
                $overallstate = $this->combine_states($overallstate, $newstate);
            }
        }
        if ($fractionsum <0) $fractionsum =0;    //ADDED THIS LINE TO FILTER NEGATIVE MARK
        return array($fractionsum / $fractionmax, $overallstate);
    }

Suhailan Safei への返信

Re: Negative marks/points in multi answer quiz

- Manoj Rajiwadekar の投稿

Hi Suhailan,

I tried your hack but it doesn't work for me. Also If I put " if ($fractionsum <0) $fractionsum =0;" this line on 267 line, it is below " return array($fractionsum / $fractionmax, $overallstate);" this line and you posted here above this line. I tried both the positions but it doesn't work.