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

Cannot continue Quiz - get "No questions found" error

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.3
    • None
    • Quiz
    • MOODLE_23_STABLE

    Description

      Sometimes, when a user goes to resume their quiz attempt, they get a page saying "No questions found". The problem is that the url they get redirected to ( http://mymoodle.com/mod/quiz/attempt.php?attempt=564&page=28 ) has a non-existent page number. I've no idea where the 28 came from – there's only 3 pages in the quiz (10 questions each).

      We've only seen this since moving from 2.2 to 2.3.

      I haven't managed to make the problem recur, but have seen 3 independent instances of the issue.

      I've put in a rather hacky fix in mod/quiz/attemptlib.php::get_slots() so that if it can't find the quiz page, it shows all, but the real fix should find where the incorrect page number comes from.

      public function get_slots($page = 'all') {
      //Hacky fix added by Mark to prevent noquesitonsfound error with non-existent page #s
      if ($page !== 'all') {
      if(!array_key_exists($page, $this->pagelayout))

      { $page='all'; }

      }

      if ($page === 'all') {
      $numbers = array();
      foreach ($this->pagelayout as $numbersonpage)

      { $numbers = array_merge($numbers, $numbersonpage); }

      return $numbers;
      } else

      { return $this->pagelayout[$page]; }

      }

      Refs:
      http://moodle.org/mod/forum/discuss.php?d=206271
      http://moodle.org/mod/forum/discuss.php?d=206272

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              mwebster Mark van Hoek
              Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: