Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-27952

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: 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:

      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.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            stronk7 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
            stronk7 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
            timhunt Tim Hunt added a comment -

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

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

            Looks good to me - integrated now, thanks Eloy

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

            PASS

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

            Whoops sorry

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

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

            Show
            stronk7 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:
                  Fix Release Date:
                  1/Jul/11