Skip to content

Commit

Permalink
MDL-50197 quiz editing: fix dialogue titles at the end of the quiz
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed May 11, 2015
1 parent 753d681 commit ca79762
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mod/quiz/classes/output/edit_renderer.php
Expand Up @@ -557,7 +557,11 @@ public function edit_menu_actions(structure $structure, $page,

// 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);
Expand All @@ -568,7 +572,11 @@ public function edit_menu_actions(structure $structure, $page,
$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);

Expand Down
2 changes: 2 additions & 0 deletions mod/quiz/lang/en/quiz.php
Expand Up @@ -45,13 +45,15 @@
$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';
$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';
Expand Down

0 comments on commit ca79762

Please sign in to comment.