Skip to content
Browse files

MDL-27952 quiz - fix navigation for users having 0 nodes in module nav

  • Loading branch information...
1 parent 3552484 commit 1b8655ab0f51c12395c96bfe904cb24fcb26e4a4 @stronk7 stronk7 committed Jun 21, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 mod/quiz/lib.php
View
5 mod/quiz/lib.php
@@ -1571,13 +1571,12 @@ function quiz_extend_settings_navigation($settings, $quiznode) {
// We want to add these new nodes after the Edit settings node, and before the
// Locally assigned roles node. Of course, both of those are controlled by capabilities.
$keys = $quiznode->get_children_key_list();
+ $beforekey = null;
$i = array_search('modedit', $keys);
- if ($i === false) {
+ if ($i === false and array_key_exists(0, $keys)) {
$beforekey = $keys[0];
} else if (array_key_exists($i + 1, $keys)) {
$beforekey = $keys[$i + 1];
- } else {
- $beforekey = null;
}
if (has_capability('mod/quiz:manageoverrides', $PAGE->cm->context)) {

0 comments on commit 1b8655a

Please sign in to comment.
Something went wrong with that request. Please try again.