diff --git a/edit_geogebra_form.php b/edit_geogebra_form.php index 36e3093..d470eb5 100644 --- a/edit_geogebra_form.php +++ b/edit_geogebra_form.php @@ -92,13 +92,21 @@ public function __construct($submiturl, $question, $category, $contexts, $formed */ protected function get_per_answer_fields($mform, $label, $gradeoptions, &$repeatedoptions, &$answersoption) { + global $CFG; + if ((int)$CFG->branch < 311) { + // Pre-3.11 string. + $gradestr = get_string('grade', 'grades'); + } else { + // New string for "Grade", see MDL-71941. + $gradestr = get_string('gradenoun'); + } $repeated = array(); $answeroptions = array(); $answeroptions[] = $mform->createElement('text', 'answer', $label, array('size' => 40)); $answeroptions[] = $mform->createElement('select', 'fraction', - get_string('grade', 'grades'), $gradeoptions); + $gradestr, $gradeoptions); $repeated[0] = $mform->createElement('group', 'answeroptions', $label, $answeroptions, null, false); $repeated[1] = $mform->createElement('hidden', 'feedback'); diff --git a/question.php b/question.php index e838269..e9b59cf 100644 --- a/question.php +++ b/question.php @@ -229,9 +229,17 @@ public function is_gradable_response(array $response) { * @return string a plain text summary of that response, that could be used in reports. */ public function summarise_response(array $response) { + global $CFG; if (empty($this->answers) && !$this->isexercise) { return "Response graded manually"; } else { + if ((int)$CFG->branch < 311) { + // Pre-3.11 string. + $gradestr = get_string('grade', 'grades'); + } else { + // New string for "Grade", see MDL-71941. + $gradestr = get_string('gradenoun'); + } $resp = $response['answer']; if ($resp === '' && !$this->isexercise) { return get_string('noresponse', 'question'); @@ -248,10 +256,10 @@ public function summarise_response(array $response) { $summary .= $answer->answer . '='; if ($correct) { $fraction += $answer->fraction; - $summary .= 'true' . ', ' . get_string('grade', 'grades') . ': ' . + $summary .= 'true' . ', ' . $gradestr . ': ' . format_float($answer->fraction, 2, false, false); } else { - $summary .= 'false' . ', ' . get_string('grade', 'grades') . ': 0'; + $summary .= 'false' . ', ' . $gradestr . ': 0'; } $j++; }