diff --git a/mod/quiz/classes/output/edit_renderer.php b/mod/quiz/classes/output/edit_renderer.php index 86eafdd96ba..8995c984cc4 100644 --- a/mod/quiz/classes/output/edit_renderer.php +++ b/mod/quiz/classes/output/edit_renderer.php @@ -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); diff --git a/mod/quiz/lang/en/quiz.php b/mod/quiz/lang/en/quiz.php index 9b9409557f5..bbcc1cb8178 100644 --- a/mod/quiz/lang/en/quiz.php +++ b/mod/quiz/lang/en/quiz.php @@ -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';