Moodle
  1. Moodle
  2. MDL-27952

quiz_extend_settings_navigation() failing for users having 0 options in activity settings

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Navigation, Quiz
    • Labels:
      None
    • Testing Instructions:
      Hide
      • Debug enabled toDEVELOPER
      • Login as student and go to quiz/view.php page
      • TEST: No notices/warnings are shown
      • TEST: Student have no options in the quiz, so the quiz navigation block is not shown
      • Login as teacher and go to quiz/view.php page
      • TEST: No notices/warnings are shown
      • TEST: Teacher sees all the quiz-own-options on top of the quiz navigation block, after them the standard ones are shown (roles, permissions...)
      Show
      Debug enabled toDEVELOPER Login as student and go to quiz/view.php page TEST: No notices/warnings are shown TEST: Student have no options in the quiz, so the quiz navigation block is not shown Login as teacher and go to quiz/view.php page TEST: No notices/warnings are shown TEST: Teacher sees all the quiz-own-options on top of the quiz navigation block, after them the standard ones are shown (roles, permissions...)
    • Affected Branches:
      MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      17883

      Description

      Was testing some other quiz issues when logged as student I got:

      Notice: Undefined offset: 0 in /Users/stronk7/git_moodle/integration/mod/quiz/lib.php on line 1576
      

      It seems that the code introduced by MDL-27908 (commit bc502c16) does not handle the situations where there are 0 nodes in the $quiznode.

        Issue Links

          Activity

          Hide
          Eloy Lafuente (stronk7) added a comment -

          Submitting for integration. Initially I changed the array_key_exists() uses by simpler and quicker isset() ones, but at the end I continued using the former.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Submitting for integration. Initially I changed the array_key_exists() uses by simpler and quicker isset() ones, but at the end I continued using the former. Ciao
          Hide
          Tim Hunt added a comment -

          Ah, well spotted. The fix looks good to me. +1.

          Show
          Tim Hunt added a comment - Ah, well spotted. The fix looks good to me. +1.
          Hide
          Sam Hemelryk added a comment -

          Looks good to me - integrated now, thanks Eloy

          Show
          Sam Hemelryk added a comment - Looks good to me - integrated now, thanks Eloy
          Hide
          Sam Hemelryk added a comment -

          PASS

          Show
          Sam Hemelryk added a comment - PASS
          Hide
          Sam Hemelryk added a comment -

          Whoops sorry

          Show
          Sam Hemelryk added a comment - Whoops sorry
          Hide
          Eloy Lafuente (stronk7) added a comment -

          All git & cvs servers have been updated with these cool changes, so closing, many thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - All git & cvs servers have been updated with these cool changes, so closing, many thanks!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: