Details

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

      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.

        Activity

        Hide
        Tim Hunt added a comment -

        Peer review done verbally. Now we need a revised branch on github.

        Show
        Tim Hunt added a comment - Peer review done verbally. Now we need a revised branch on github.
        Hide
        Mahmoud Kassaei added a comment -
        Show
        Mahmoud Kassaei added a comment - here is the diff for review https://github.com/mkassaei/moodle/compare/MOODLE_22_STABLE...MDL-31910
        Hide
        Tim Hunt added a comment -

        To INTEGRATORS: please cherry-pick to master as well.

        Thanks Mahmoud, submitting for integration.

        Show
        Tim Hunt added a comment - To INTEGRATORS: please cherry-pick to master as well. Thanks Mahmoud, submitting for integration.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Some hours ago...

        the main moodle.git repository has been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Some hours ago... the main moodle.git repository has been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Aparup Banerjee added a comment -

        Thanks for the work and flow!
        This has been integrated into master and 22.

        I've tweaked whitespacing and commit message format.

        Show
        Aparup Banerjee added a comment - Thanks for the work and flow! This has been integrated into master and 22. I've tweaked whitespacing and commit message format.
        Hide
        Ankit Agarwal added a comment -

        Working as expected
        Thanks

        Show
        Ankit Agarwal added a comment - Working as expected Thanks
        Hide
        Eloy Lafuente (stronk7) added a comment -

        FCT (fixed, closing, thanks). Ciao

        "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!"
        ~ Benjamin Disraeli

        Show
        Eloy Lafuente (stronk7) added a comment - FCT (fixed, closing, thanks). Ciao "I feel a very unusual sensation - if it is not indigestion, I think it must be gratitude!" ~ Benjamin Disraeli

          People

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

            Dates

            • Created:
              Updated:
              Resolved: