From 11f2cec1ac5c14fe350d90e10cae7126c7929ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Fri, 15 Dec 2017 18:01:40 +0100 Subject: [PATCH] MDL-51089 quiz: "Add" menu in edit quiz more keyboard accessible --- mod/quiz/classes/output/edit_renderer.php | 22 +++++++++++----------- mod/quiz/styles.css | 2 +- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mod/quiz/classes/output/edit_renderer.php b/mod/quiz/classes/output/edit_renderer.php index e7383924be3..09350bbdc36 100644 --- a/mod/quiz/classes/output/edit_renderer.php +++ b/mod/quiz/classes/output/edit_renderer.php @@ -632,17 +632,6 @@ class edit_renderer extends \plugin_renderer_base { // Get section, page, slotnumber and maxmark. $actions = array(); - // Add a new section to the add_menu if possible. This is always added to the HTML - // then hidden with CSS when no needed, so that as things are re-ordered, etc. with - // Ajax it can be relevaled again when necessary. - $params = array('cmid' => $structure->get_cmid(), 'addsectionatpage' => $page); - - $actions['addasection'] = new \action_menu_link_secondary( - new \moodle_url($pageurl, $params), - new \pix_icon('t/add', $str->addasection, 'moodle', array('class' => 'iconsmall', 'title' => '')), - $str->addasection, array('class' => 'cm-edit-action addasection', 'data-action' => 'addasection') - ); - // Add a new question to the quiz. $returnurl = new \moodle_url($pageurl, array('addonpage' => $page)); $params = array('returnurl' => $returnurl->out_as_local_url(false), @@ -680,6 +669,17 @@ class edit_renderer extends \plugin_renderer_base { $attributes = array_merge(array('data-header' => $title, 'data-addonpage' => $page), $attributes); $actions['addarandomquestion'] = new \action_menu_link_secondary($url, $icon, $str->addarandomquestion, $attributes); + // Add a new section to the add_menu if possible. This is always added to the HTML + // then hidden with CSS when no needed, so that as things are re-ordered, etc. with + // Ajax it can be relevaled again when necessary. + $params = array('cmid' => $structure->get_cmid(), 'addsectionatpage' => $page); + + $actions['addasection'] = new \action_menu_link_secondary( + new \moodle_url($pageurl, $params), + new \pix_icon('t/add', $str->addasection, 'moodle', array('class' => 'iconsmall', 'title' => '')), + $str->addasection, array('class' => 'cm-edit-action addasection', 'data-action' => 'addasection') + ); + return $actions; } diff --git a/mod/quiz/styles.css b/mod/quiz/styles.css index d8c34564a9b..0e5d71338ae 100644 --- a/mod/quiz/styles.css +++ b/mod/quiz/styles.css @@ -659,7 +659,7 @@ table.quizreviewsummary td.cell { } #page-mod-quiz-edit ul.section li.pagenumber:first-child .add-menu-outer .menu > :first-child, -#page-mod-quiz-edit .last-add-menu .add-menu-outer .menu > :first-child { +#page-mod-quiz-edit .last-add-menu .add-menu-outer .menu > :last-child { display: none; }