From c2f8c4be5f32338fe24e4d71ba9fe51e6eac408d Mon Sep 17 00:00:00 2001 From: tjhunt Date: Wed, 21 Mar 2007 17:12:50 +0000 Subject: [PATCH] Improve string handling in the question type base class. Merged from MOODLE_18_STABLE. --- question/type/questiontype.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/question/type/questiontype.php b/question/type/questiontype.php index 1419b59b1e..03b2a1c799 100644 --- a/question/type/questiontype.php +++ b/question/type/questiontype.php @@ -55,7 +55,7 @@ class default_questiontype { if ($menu_name[0] == '[') { // Legacy behavior, if the string was not in the proper qtype_name // language file, look it up in the quiz one. - $menu_name = get_string($this->name(), 'quiz'); + $menu_name = get_string($name, 'quiz'); } return $menu_name; } @@ -107,11 +107,16 @@ class default_questiontype { * @param string $wizardnow is '' for first page. */ function display_question_editing_page(&$mform, $question, $wizardnow){ + $name = $this->name(); + $strheading = get_string('editing' . $name, 'qtype_' . $name); + if ($strheading[0] == '[') { + // Legacy behavior, if the string was not in the proper qtype_name + // language file, look it up in the quiz one. + $strheading = get_string('editing' . $name, 'quiz'); + } - print_heading_with_help(get_string("editing".$question->qtype, "quiz"), $question->qtype, "quiz"); - + print_heading_with_help($strheading, $name, 'quiz'); $mform->display(); - } /** -- 2.39.5