Hola Albert,
Para hacer lo que pides debes modificar
Concretamente en cuatro ficheros, aunque pone que es para versión 1.8.6,
debería servir para la 1.8.2
NOTA: ANTES DE MODIFICAR LOS FICHEROS, REALIZA UNA COPIA DE CADA UNO DE ELLOS, POR SEGURIDADFichero 1: moodle/lib/questionlib.phpHacia la línea 768, busca el código:
$states[$i]->last_graded = clone($states[$i]);
}
}
Y a continuación escribe:
// make sure sumgrades are non-negative $attempt->sumgrades = max($attempt->sumgrades, 0.0);El código que va después es:
return $states;
}
En este mismo fichero, hacia la línea 1280-84 , busca el el código:
// Ensure that the grade does not go down
$state->grade = max($state->grade, $state->last_graded->grade);
Y cámbialo por: // This is specific to penalties/timelimit/closing time, so it should not run always!
if ($cmoptions->penaltyscheme or $cmoptions->timelimit or $cmoptions->timeclose) {// The structures are initialized to zero, so on the first time it will reset any negative value to zero. if ($state->last_graded->seq_number != 0) { $state->grade = max($state->grade, $state->last_graded->grade); } }Fichero 2: moodle/mod/quiz/attempt.phpBusca las líneas (hacia la 343)
save_question_session($questions[$i], $states[$i]);
}
Y a
continuación pon:
// make sure sumgrades are non-negative $attempt->sumgrades = max($attempt->sumgrades, 0.0);En el mismo fichero busca la línea (hacia la 383):
add_to_log($course->id, 'quiz', 'close attempt',
"review.php?attempt=$attempt->id",
"$quiz->id", $cm->id);
Y
ANTES de ella pon:
// make sure sumgrades are non-negative $attempt->sumgrades = max($attempt->sumgrades, 0.0);Fichero 3:moodle/question/type/multianswer/questiontype.phpBsuca la línea (hacia la 482)
$state->raw_grade = min(max((float) $state->raw_grade, 0.0), 1.0)
* $question->maxgrade;
Y
cámbiala por:
$state->raw_grade = min(max((float) $state->raw_grade, -1.0), 1.0) * $question->maxgrade;Fichero 4: moodle/question/type/multichoice/questiontype.phpBusca la línea (hacia la 368):
$state->raw_grade = min(max((float) $state->raw_grade,
0.0), 1.0) * $question->maxgrade;
Y cámbiala por:
$state->raw_grade = min(max((float) $state->raw_grade, -1.0), 1.0) * $question->maxgrade;Más información en el Tracker de moodle:
MDL-1647" target="_blank" title="http://tracker.moodle.org/browse/MDL-1647" rel="noreferrer noopener">
Allowing Negative Marks for Questions MDL-1647Hasta pronto,
Salu2
J. Raul (juagarc4)