Skip to content

Commit 63e3cf2

Browse files
committed
fix: use get_string for instead of static string
1 parent 533e3b6 commit 63e3cf2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lang/en/qtype_questionpy.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
$string['attempt_step_no'] = 'Step #';
3333
$string['attempt_steps'] = 'Attempt Steps';
3434
$string['change_package'] = 'Change';
35+
$string['contact_administrator'] = 'Please contact an administrator.';
3536
$string['disable_json_formatting'] = 'Disable JSON formatting';
3637
$string['enable_json_formatting'] = 'Enable JSON formatting';
3738
$string['event_grading_response_failed'] = 'Grading response failed';
@@ -65,6 +66,7 @@
6566
$string['questionpy:uploadpackages'] = 'Upload custom QuestionPy packages';
6667
$string['questionpy:viewdetails'] = 'View technical details of QuestionPy questions';
6768
$string['remove_packages_button'] = 'Remove Packages';
69+
$string['render_error_message'] = 'There was an error attempting to view the question.';
6870
$string['render_error_section'] = 'An error occurred';
6971
$string['render_warning_invalid_value'] = 'The last submission set the field {$a->name} to the value {$a->value}, but that option is no longer available. The available options are: {$a->availablevalues}.';
7072
$string['render_warning_invalid_value_not_preserved'] = 'The invalid value will be overwritten the next time you save your answer.';

renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public function head_code(question_attempt $qa) {
5555
*/
5656
private function render_error(): string {
5757
return $this->output->render_from_template('qtype_questionpy/render_error', [
58-
'message' => 'There was an error attempting to view the question.',
59-
'info' => 'Please contact an administrator.',
58+
'message' => get_string('render_error_message', 'qtype_questionpy'),
59+
'info' => get_string('contact_administrator', 'qtype_questionpy'),
6060
]);
6161
}
6262

0 commit comments

Comments
 (0)