MDL-46195 Fix fractionsaddwrong string component in lesson & qformat_webct.
I know. You should not refer to strings from other plugins, but * qformat_webct is importing multichoice questions in that bit of code. I suppose a pedant would say that qformat_webct should declare dependencies on all the qtypes it relies on, but that would be silly. * Lesson should be using the question engine, rather than doing its own thing.
This commit is contained in:
@@ -222,7 +222,7 @@ function lesson_save_question_options($question, $lesson) {
|
||||
$totalfraction = round($totalfraction,2);
|
||||
if ($totalfraction != 1) {
|
||||
$totalfraction = $totalfraction * 100;
|
||||
$result->notice = get_string("fractionsaddwrong", "quiz", $totalfraction);
|
||||
$result->notice = get_string("fractionsaddwrong", "qtype_multichoice", $totalfraction);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -517,8 +517,8 @@ class qformat_webct extends qformat_default {
|
||||
$totalfraction = round($totalfraction, 2);
|
||||
if ($totalfraction != 1) {
|
||||
$totalfraction = $totalfraction * 100;
|
||||
$errors[] = "'$question->name': ".get_string('wronggrade', 'qformat_webct', $nlinecounter)
|
||||
.' '.get_string('fractionsaddwrong', 'question', $totalfraction);
|
||||
$errors[] = "'{$question->name}': ".get_string('wronggrade', 'qformat_webct', $nlinecounter)
|
||||
.' '.get_string('fractionsaddwrong', 'qtype_multichoice', $totalfraction);
|
||||
$questionok = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user