Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.3
    • Fix Version/s: 2.2.3
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1) create a test quiz
      2) create at least two essay questions
      3) Add the questions to the test quiz
      4) login as student and attempt the quiz answer the questions, submit and finish(better having at least two students attempting the quiz).
      5) login as marker/admin, on navigation block under your test quiz, under Reslts, click on Manual grading. You should see the table with qustions in the quiz.
      6) press the link(s) under "To garde" column, then mark all questions on the page and press "Save and go to next page" button, you'll get the error message above before this fix and should not get it after the fix.

      Show
      1) create a test quiz 2) create at least two essay questions 3) Add the questions to the test quiz 4) login as student and attempt the quiz answer the questions, submit and finish(better having at least two students attempting the quiz). 5) login as marker/admin, on navigation block under your test quiz, under Reslts, click on Manual grading. You should see the table with qustions in the quiz. 6) press the link(s) under "To garde" column, then mark all questions on the page and press "Save and go to next page" button, you'll get the error message above before this fix and should not get it after the fix.
    • Workaround:
      Hide

      In mod/quiz/report/grading/report.php in quiz_grading_report class, in the method display_grading_interface(), the redirect() and other related lines above it, see below:

      // Make sure there is something to do.
      $statecounts = $this->get_question_state_summary(array($slot));

      $counts = null;
      foreach ($statecounts as $record) {
      if ($record->questionid == $questionid)

      { $counts = $record; break; }

      }

      // If not, redirect back to the list.
      if (!$counts || $counts->$grade == 0) {
      redirect($this->list_questions_url(), get_string('alldoneredirecting', 'quiz_grading'));
      }

      This logic needs to be put before

      // Start output.
      $this->print_header_and_tabs($cm, $course, $quiz, 'grading');

      in display() method and obviously the variable $counts (probably with a better variable name like $numberofstates) is passed to the display_grading_interface() method as an argument.

      Another solution would be to modify display_grading_interface() method to return whatever it displays and instead of redirect(), returning false, then in display() method before starting output calling the newly refactor method and if it returns false, we will call redirect(), otherwise, we store the return value to a varible and diplay in in the write position.

      Show
      In mod/quiz/report/grading/report.php in quiz_grading_report class, in the method display_grading_interface(), the redirect() and other related lines above it, see below: // Make sure there is something to do. $statecounts = $this->get_question_state_summary(array($slot)); $counts = null; foreach ($statecounts as $record) { if ($record->questionid == $questionid) { $counts = $record; break; } } // If not, redirect back to the list. if (!$counts || $counts->$grade == 0) { redirect($this->list_questions_url(), get_string('alldoneredirecting', 'quiz_grading')); } This logic needs to be put before // Start output. $this->print_header_and_tabs($cm, $course, $quiz, 'grading'); in display() method and obviously the variable $counts (probably with a better variable name like $numberofstates) is passed to the display_grading_interface() method as an argument. Another solution would be to modify display_grading_interface() method to return whatever it displays and instead of redirect(), returning false, then in display() method before starting output calling the newly refactor method and if it returns false, we will call redirect(), otherwise, we store the return value to a varible and diplay in in the write position.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:

      Description

      If all questions on a page are marked and you select 'save & go to next page', answers are saved but you get the error message shown below.

      Error:
      You should really redirect before you start page output

      line 566 of /lib/outputrenderers.php: call to debugging()
      line 2513 of /lib/weblib.php: call to core_renderer->redirect_message()
      line 328 of /mod/quiz/report/grading/report.php: call to redirect()
      line 137 of /mod/quiz/report/grading/report.php: call to quiz_grading_report->display_grading_interface()
      line 100 of /mod/quiz/report.php: call to quiz_grading_report->display()

      All selected attempts have been graded. Returning to the list of questions.
      (Continue)

      Error output, so disabling automatic redirect.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  14/May/12