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:
Tim Hunt
2014-09-08 21:55:32 +01:00
parent 1e13288d77
commit efe2f20335
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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;
}
}
+2 -2
View File
@@ -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;
}
}