Skip to content

Commit

Permalink
MDL-45336 qtype_numerical: use own strings instead of mod_quiz
Browse files Browse the repository at this point in the history
These strings have already been copied from mod_quiz to qtype_numerical but
in the qtype_numerical plugin code the translations from mod_quiz were used.
Even though the strings were already present we copy the translations.

AMOS BEGIN
 CPY [invalidnumericanswer,mod_quiz],[invalidnumericanswer,qtype_numerical]
 CPY [multiplier,mod_quiz],[qtype_numerical]
 CPY [invalidnumerictolerance,mod_quiz],[qtype_numerical]
AMOS END
  • Loading branch information
marinaglancy authored and stronk7 committed Sep 23, 2014
1 parent 5a0221f commit 8766d19
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions mod/quiz/lang/en/deprecated.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
invalidnumericanswer,mod_quiz
multiplier,mod_quiz
invalidnumerictolerance,mod_quiz
9 changes: 6 additions & 3 deletions mod/quiz/lang/en/quiz.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,6 @@
$string['introduction'] = 'Description';
$string['invalidattemptid'] = 'No such attempt ID exists';
$string['invalidcategory'] = 'Category ID is invalid';
$string['invalidnumericanswer'] = 'One of the answers you entered was not a valid number.';
$string['invalidnumerictolerance'] = 'One of the tolerances you entered was not a valid number.';
$string['invalidoverrideid'] = 'Invalid override id';
$string['invalidquestionid'] = 'Invalid question id';
$string['invalidquizid'] = 'Invalid quiz ID';
Expand Down Expand Up @@ -476,7 +474,6 @@
$string['moveselectedonpage'] = 'Move selected questions to page: {$a}';
$string['multichoice'] = 'Multiple choice';
$string['multipleanswers'] = 'Choose at least one answer.';
$string['multiplier'] = 'Multiplier';
$string['mustbesubmittedby'] = 'This attempt must be submitted by {$a}.';
$string['name'] = 'Name';
$string['navmethod'] = 'Navigation method';
Expand Down Expand Up @@ -903,3 +900,9 @@
$string['xhtml'] = 'XHTML';
$string['youneedtoenrol'] = 'You need to enrol in this course before you can attempt this quiz';
$string['yourfinalgradeis'] = 'Your final grade for this quiz is {$a}.';

// Deprecated since Moodle 2.8

$string['invalidnumericanswer'] = 'One of the answers you entered was not a valid number.';
$string['invalidnumerictolerance'] = 'One of the tolerances you entered was not a valid number.';
$string['multiplier'] = 'Multiplier';
Empty file.
4 changes: 2 additions & 2 deletions question/type/numerical/edit_numerical_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ protected function add_unit_fields($mform) {
*/
protected function unit_group($mform) {
$grouparray = array();
$grouparray[] = $mform->createElement('text', 'unit', get_string('unit', 'quiz'), array('size'=>10));
$grouparray[] = $mform->createElement('text', 'unit', get_string('unit', 'qtype_numerical'), array('size'=>10));
$grouparray[] = $mform->createElement('text', 'multiplier',
get_string('multiplier', 'quiz'), array('size'=>10));
get_string('multiplier', 'qtype_numerical'), array('size'=>10));

return $grouparray;
}
Expand Down
4 changes: 2 additions & 2 deletions question/type/numerical/questiontype.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function save_question_options($question) {
$answer->answer = $this->apply_unit($answerdata, $units,
!empty($question->unitsleft));
if ($answer->answer === false) {
$result->notice = get_string('invalidnumericanswer', 'quiz');
$result->notice = get_string('invalidnumericanswer', 'qtype_numerical');
}
}
$answer->fraction = $question->fraction[$key];
Expand All @@ -212,7 +212,7 @@ public function save_question_options($question) {
$options->tolerance = $this->apply_unit($question->tolerance[$key],
$units, !empty($question->unitsleft));
if ($options->tolerance === false) {
$result->notice = get_string('invalidnumerictolerance', 'quiz');
$result->notice = get_string('invalidnumerictolerance', 'qtype_numerical');
}
}
if (isset($options->id)) {
Expand Down

0 comments on commit 8766d19

Please sign in to comment.