Herramientas de usuario

Herramientas del sitio


moodle:cuestionarios:el_problema_de_las_puntuaciones_negativas

El problema de Moodle con las puntuaciones negativas a cada pregunta

El problema

Negative marking in MCQ with one correct answer only
https://moodle.org/mod/forum/discuss.php?d=85473

Negative Scoring –clarification
https://moodle.org/mod/forum/discuss.php?d=47599

Negative marking to questions https://moodle.org/mod/forum/discuss.php?d=46862

  • Negative quiz grading is something that is used quite often in multiple choice, single-answer tests. Perhaps we need a new type of quiz that provides for this.
  • In the existing quiz module, I can assign a negative percentage point value to an individual question, but it has no effect on the outcome. As an example, I create 10 questions, 5 answers each, with each question having a value of 1 point. Correct answer is assigned a +100% value, incorrect is assigned a -25% value. If I take the quiz and answer 6 correct and 4 incorrect, my reported score is 6, where it should be 5.
  • Granted, using the adaptive mode I can do penalty points, but this has no relationship to the workings of a true test. They don't actually get the penalty until they retake the question. The student should be able to see a true representative score on a single attempt of a test.

La causa

La causa es que hay un control después de definir y valorar cada pregunta que impide que las preguntas tengan puntuación negativa. El problema se resuelve eliminando las líneas de código que imponen dicha restricción.

La solución

Consiste en editar dos ficheros para comentar una línea y rectificar otra.

En los siguientes ejemplos se ha documentado la modificación mediante los marcadores

  • negative marks hack start
  • negative marks hack stop

File: moodle\lib\questionlib.php

En este fichero se comentan las líneas:

// Ensure that the grade does not go down  
$state->grade = max($state->grade, $state->last_graded->grade);

Aquí se ve la modificación efectuada en su contexto

function question_apply_penalty_and_timelimit(&$question, &$state, $attempt, $cmoptions) {
// deal with penalty 
if ($cmoptions->penaltyscheme) {
$state->grade = $state->raw_grade - $state->sumpenalty;
$state->sumpenalty += (float) $state->penalty; 
} else {
$state->grade = $state->raw_grade;
}

// deal with timelimit
if ($cmoptions->timelimit) { 
// We allow for 5% uncertainty in the following test
if (($state->timestamp - $attempt->timestart) > ($cmoptions->timelimit * 63)) {
$state->grade = 0; 
}
} 

// deal with closing time
if ($cmoptions->timeclose and $state->timestamp > ($cmoptions->timeclose + 60) // allowing 1 minute lateness
and !$attempt->preview) { // ignore closing time for previews
$state->grade = 0;
}

/* negative marks hack start: commented the line below
// Ensure that the grade does not go down 
$state->grade = max($state->grade, $state->last_graded->grade);
negative marks hack stop */
}

File: moodle\question\type\multichoice\questiontype.php

En este fichero se sustituye la línea

$state->raw_grade = min(max((float) $state->raw_grade, 
0.0), 1.0) * $question->maxgrade; 

por

$state->raw_grade = min((float) $state->raw_grade, 1.0) * $question->maxgrade;

Aquí se ve la modificación efectuada en su contexto

function grade_responses(&$question, &$state, $cmoptions) {
$answers = $question->options->answers;
$testedstate = clone($state);
$teststate = clone($state);
$state->raw_grade = 0;
foreach($answers as $answer) { 
$teststate->responses = array('' => $answer->id);
if($question->options->single) {
if($this->compare_responses($question, $testedstate, 
$teststate)) {
$state->raw_grade = $answer->fraction;
break;
}
} else {
foreach($state->responses as $response) {
$testedstate->responses = array('' => $response); 
if($this->compare_responses($question, $testedstate,
$teststate)) {
$state->raw_grade += $answer->fraction; 
break;
}
}
}
}
if (empty($state->raw_grade)) {
$state->raw_grade = 0;
}

/* negative marks hack start 
// Make sure we don't assign negative or too high marks
$state->raw_grade = min(max((float) $state->raw_grade,
0.0), 1.0) * $question->maxgrade; */
$state->raw_grade = min((float) $state->raw_grade, 1.0) * $question->maxgrade;
// Negative marks hack stop
 
// Apply the penalty for this attempt
$state->penalty = $question->penalty * $question->maxgrade;

// mark the state as graded
$state->event = ($state->event == QUESTION_EVENTCLOSE) ? QUESTION_EVENTCLOSEANDGRADE : QUESTION_EVENTGRADE; 

return true;
}

Parche MDL-20726

https://tracker.moodle.org/browse/MDL-20726

Moodle provides default negative grades but actually they are not counted in final results.Here is a patch to employ negative marking to your questions.It is only for multichoice questions.Just follow the instructions.t works greatly with Moodle 1.6 and later upto Moodle 1.9.x

Trucos para evitar el problema sin modificar el código

La solución en versiones posteriores

Implementation of true negative marks in MC-type questions
http://docs.moodle.org/dev/Implementation_of_true_negative_marks_in_MC-type_questions

moodle/cuestionarios/el_problema_de_las_puntuaciones_negativas.txt · Última modificación: 2013/07/19 08:10 por jherrero