How can we disable negative marking in Moodle 2.2+?

How can we disable negative marking in Moodle 2.2+?

by Jessica Gramp -
Number of replies: 22
Picture of Moodle HQ Picture of Plugin developers

Hi there,

We would like to disable negative marking in Moodle 2.2, as we are worried about the affect that this will have on existing quizzes where staff have assumed the minimum grade possible is 0 (not a negative number).

I had assumed that negative marking would be an option, not deployed across the board, so ideally I would like to have it off by default and turn it on in a particular quiz's settings. If this isn't possible I will need to try disabling it for everyone (which would be a shame).

I can't find any documentation about the negative marking beyond explaining what it does. Can anyone help me to determine how I would switch it off please? We have some very high stakes quizzes and need to ensure they do not behave in a different way (i.e. assign different marks) from Moodle 1.9 to Moodle 2.2+.

Thanks in advance.

Average of ratings: Useful (1)
In reply to Jessica Gramp

Re: How can we disable negative marking in Moodle 2.2+?

by Heikki Wilenius -

My institution is in the same position. I just realized today, two weeks from our 1.9->2.2 upgrade date, that the behaviour of quizzes is going to fundamentally change. We have a lot of big quizzes which have been designed specifically to function with the previous kind of quiz behaviour. I would be very happy if there was an option to disable negative marking.

In reply to Heikki Wilenius

Re: How can we disable negative marking in Moodle 2.2+?

by Heikki Wilenius -

Based on a quick test by my colleague, existing quizzes upgraded from 1.9 to 2.2 do not change their behaviour when it comes to negative marking. Only new quizzes featured negative question scores. Can anybody confirm this? 

In reply to Heikki Wilenius

Re: How can we disable negative marking in Moodle 2.2+?

by Jessica Gramp -
Picture of Moodle HQ Picture of Plugin developers

Only when you regrade existing quiz attempts or re-use the questions in a new quiz will you notice the negative marking.

In reply to Jessica Gramp

Re: How can we disable negative marking in Moodle 2.2+?

by Heikki Wilenius -

Hi Jessica,

yeah, at first we didn't realize that the negative grading does not apply to multiple choices with multiple answers.

Anyway, we used an SQL query to find all affected quizzes fashioned after the query Tim posted at the tracker.

Then we emailed all the teachers who have affected questions, listing the questions for them and describing the changed behaviour.

In reply to Jessica Gramp

Re: How can we disable negative marking in Moodle 2.2+?

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

Negative marking only happens for a few question types (I think only Multiple choice), and then only for single-response questions, where there are answers with fraction less-than-zero, and where the behaviour being used is not adaptive.

So, if you are really clever, you could probably write a Database query to see if any of your quizzes are acutally affected.

If you have questions that are affected, the best solution is to set question_answers.fraction to 0 where it is currently less than 0.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: How can we disable negative marking in Moodle 2.2+?

by Heikki Wilenius -

Hi Tim, thanks for your answer.

I didn't realize negative marking only applies to single-response multichoice questions. This is great news! The quizzes that we were mostly worried about had a lot of questions with multiple responses allowed.

This tracker link might be of interest to people too: http://tracker.moodle.org/browse/MDL-1647.

Tim posted an SQL query there, which can be used for checking out which questions are affected by the change. We plan on using this query, and then contacting the teachers whose quizzes are affected, if any.

In reply to Jessica Gramp

Re: How can we disable negative marking in Moodle 2.2+?

by Stefan Scholz -
Picture of Plugin developers

Hi there,

I came across the same problem as the author of the question. Can someone tell me, how to disable the negative marking?

We use quizzes with 10 questions and each question has 10 points.Each question should have scores between 0 and 10 points, i.e. if the user selects two answers, one with 33% and one with -50%, he should have 0 as score in this question.

We're using moodle 2.2.5

I appreciate any hints or help!

Thanks a lot in advance!
Stefan

In reply to Stefan Scholz

Re: How can we disable negative marking in Moodle 2.2+?

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

"if the user selects two answers, one with 33% and one with -50%, he should have 0 as score in this question."

Did you try it? That is exactly how it does work.

In reply to Tim Hunt

Re: How can we disable negative marking in Moodle 2.2+?

by Stefan Scholz -
Picture of Plugin developers

Hi Tim, thanks a lot for your answer.

Unfortunatley, it doesn't work that way on my moodle installation, and I have no clue why.

Here's a screenshot of the exportet grades:

 

Hope you can help me!

 

Best Wishes,

Stefan

 

 

Attachment Screen Shot 2013-02-08 at 5.24.35 PM.png
In reply to Stefan Scholz

Re: How can we disable negative marking in Moodle 2.2+?

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

That screen-grab does not help much. Please can you do a screen-grab of of hte quiz review page showing the negative mark for a question.

In reply to Tim Hunt

Re: How can we disable negative marking in Moodle 2.2+?

by Stefan Scholz -
Picture of Plugin developers

Hi Tim,

I finally found the problem: It seems that negative markings only happen for single choice questions. I.e. if you set -100% in a question where only one choice is allowed, moodle calculates negative values per question. 

I did not realize that until I wanted to take the screenshots for you...

In this case, I can easily solve my problem by changing the -100% which I've used at the moment to 0% (resp. 'none') - but I think this behaviour is a bit inconsistent and misleading - what do you think?

Thanks for your help!

Stefan

Average of ratings: Useful (1)
In reply to Stefan Scholz

Re: How can we disable negative marking in Moodle 2.2+?

by Jean-Michel Védrine -

Hello Stefan,

This is exactly what Tim has said : negative marking is only applied to single MCQ.

The change to permit negative gradings for single choice MCQ has been done one purpose and has been requested by many Moodle users along the years.

We are all gratefull to Tim he implemented it in Moodle 2.1 and would be quite worried if it was changed.

Do a search on negative marking/grading in this forum and you will understand the motives for this change.

But of course applying the same logic to multiple choice MCQ would have caused a lot of trouble because questions authors use negative grading in such questions no to produce negative grades but so that wrong answers deduce some mark from right answers

Additionnally I find a bit stange that a question author create a single choice question with negative gradings but don't want these to be applied, seems quite illogical to me.

In reply to Jean-Michel Védrine

Re: How can we disable negative marking in Moodle 2.2+?

by Stefan Scholz -
Picture of Plugin developers

Hi Jean-Michel,

in general, I totally agree with you, the logic itself is fine! Having the possibility is great and I'm sure I'll use that in future projects.

If I had read carefully enough I could have realized my mistake way earlier: "Negative marking only happens for a few question types (I think only Multiple choice), and then only for single-response questions, where there are answers with fraction less-than-zero, and where the behaviour being used is not adaptive." Tim's answer is actually pretty clear, sorry for being so lax!

However, I just wanted to point out that the behaviour might be misleading - the grading method differs within one question type, just by changing an option. Thus, I'd suggest a hint next to the dropdown with an explanation. What do you think?

Best Wishes,
Stefan

In reply to Stefan Scholz

Odp: Re: How can we disable negative marking in Moodle 2.2+?

by Kristina Ban -

I would like to disable negative grading in quiz. Anybody know in which version it was developed?

In reply to Kristina Ban

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

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

Well, just don't use it.

In reply to Joseph Rézeau

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

by Kristina Ban -

Thank you for your help, but I`ve got 8000 quizes to change and I want disable that option for next teachers.

In reply to Kristina Ban

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

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

Do you mean you want to do those two separate actions:

a) remove negative marking from existing questions used by existing quizzes;

b) remove the negative marking options from the dropdown scores list when creating a new question.

For question b) here is a solution, which assumes you have admin rights on your moodle site and... that you will remember to reproduce this hack whenever you update your Moodle site to a newer version.

Hack for Moodle 2.5. In file yourmoodle/question/engine/bank.php, lines 388 and seq. remove (or comment out) those lines:

        // The the negative grades in descending order.
        foreach (array_reverse($rawfractions) as $fraction) {
            self::$fractionoptionsfull['' . (-$fraction)] =
                    format_float(-100 * $fraction, 5, true, true) . '%';
        }

        self::$fractionoptionsfull['-1.0'] = '-100%';

Hope that helps.

Joseph

Average of ratings: Useful (2)
In reply to Joseph Rézeau

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

by Kristina Ban -

Joseph, thank you a lot for your tip.  It is a good solution, but how to make negative grading available only for one answers, but not for multiple answers? Should I check it somewhere in question/type/multichoice/edit_multichoice_form.php

 

protected function definition_inner($mform) {
        $menu = array(
            get_string('answersingleno', 'qtype_multichoice'),
            get_string('answersingleyes', 'qtype_multichoice'),
        );

In reply to Kristina Ban

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

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

Kristina "how to make negative grading available only for one answers, but not for multiple answers"

Do you mean you want to make negative grading available for "normal" multiple choice questions (one answer only), and to make is unavailable for multiple choice questions with the "multiple answers" option?

That is going to be more difficult than the easy solution I provided.

Joseph

Average of ratings: Useful (1)
In reply to Joseph Rézeau

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

by Kristina Ban -

Yes Joseph. I think that I need to make some changes in lib.php or use renderer.php in multichoice . Is it possible to override renderer.php with theme for that option?

Or maybe there is another solution. I need to find the solution. When I will find I will send info.

In reply to Kristina Ban

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

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

The only easy way to change this in bulk is to alter things directly in the database. Something like

UPDATE mdl_question_answers
SET fraction = 0
WHERE fraction < 0
AND 'multichoice' = (SELECT qtype FROM mdl_question WHERE id = mdl_question_answers.question)
AND 1 = (SELECT single FROM mdl_question_multichoice WHERE question = mdl_question_answers.question)

(Note, not tested, and executing DB queries like this can screw up your whole Moodle site if you make a mistake. Backup everything first and know how to restore it.)

Average of ratings: Useful (2)
In reply to Tim Hunt

Re: Odp: Re: How can we disable negative marking in Moodle 2.2+?

by Kristina Ban -

Tim, thank you a lot for your tip. I will check that query.