MDL-50197 quiz editing: fix dialogue titles at the end of the quiz

This commit is contained in:
Tim Hunt
2015-05-11 16:22:16 +01:00
parent dc7b914677
commit bcda2f3745
2 changed files with 12 additions and 2 deletions
+10 -2
View File
@@ -492,7 +492,11 @@ class edit_renderer extends \plugin_renderer_base {
// Call question bank.
$icon = new \pix_icon('t/add', $str->questionbank, 'moodle', array('class' => 'iconsmall', 'title' => ''));
$title = get_string('addquestionfrombanktopage', 'quiz', $page);
if ($page) {
$title = get_string('addquestionfrombanktopage', 'quiz', $page);
} else {
$title = get_string('addquestionfrombankatend', 'quiz');
}
$attributes = array('class' => 'cm-edit-action questionbank',
'data-header' => $title, 'data-action' => 'questionbank', 'data-addonpage' => $page);
$actions['questionbank'] = new \action_menu_link_secondary($pageurl, $icon, $str->questionbank, $attributes);
@@ -503,7 +507,11 @@ class edit_renderer extends \plugin_renderer_base {
$url = new \moodle_url('/mod/quiz/addrandom.php', $params);
$icon = new \pix_icon('t/add', $str->addarandomquestion, 'moodle', array('class' => 'iconsmall', 'title' => ''));
$attributes = array('class' => 'cm-edit-action addarandomquestion', 'data-action' => 'addarandomquestion');
$title = get_string('addrandomquestiontopage', 'quiz', $page);
if ($page) {
$title = get_string('addrandomquestiontopage', 'quiz', $page);
} else {
$title = get_string('addrandomquestionatend', 'quiz');
}
$attributes = array_merge(array('data-header' => $title, 'data-addonpage' => $page), $attributes);
$actions['addarandomquestion'] = new \action_menu_link_secondary($url, $icon, $str->addarandomquestion, $attributes);
+2
View File
@@ -44,6 +44,7 @@ $string['addnewuseroverride'] = 'Add user override';
$string['addpagebreak'] = 'Add page break';
$string['addpagehere'] = 'Add page here';
$string['addquestion'] = 'Add question';
$string['addquestionfrombankatend'] = 'Add from the question bank at the end';
$string['addquestionfrombanktopage'] = 'Add from the question bank to page {$a}';
$string['addquestions'] = 'Add questions';
$string['addquestionstoquiz'] = 'Add questions to current quiz';
@@ -51,6 +52,7 @@ $string['addrandom'] = 'Add {$a} random questions';
$string['addrandomfromcategory'] = 'Add random questions from category:';
$string['addrandomquestion'] = 'Add random question';
$string['addarandomquestion_help'] = 'When a random question is added, it results in a randomly-chosen question from the category being inserted into the quiz. This means that different students are likely to get a different selection of questions, and when a quiz allows multiple attempts then each attempt is likely to contain a new selection of questions.';
$string['addrandomquestionatend'] = 'Add a random question at the end';
$string['addrandomquestiontopage'] = 'Add a random question to page {$a}';
$string['addrandomquestiontoquiz'] = 'Add a random question to quiz {$a}';
$string['addrandom1'] = '<< Add';