Moodle
  1. Moodle
  2. MDL-30174

Offset not adjusted when using 'saveandnext'

    Details

    • Testing Instructions:
      Hide

      Working with my patch for MDL-30173 applied and using the same base instructions:

      Users 1,2,4,6 have submitted work. It's not yet graded. As a teacher:

      • Click the 'Grade' link for user 1
      • write a comment, give a grade (be generous), and choose 'Save and Next'
      • Verify that the page for User 2 is displayed.
      • write a comment, give a grade (be generous), and choose 'Save and Next'

      Expected Result

      The grading page for user 4 should be displayed

      Actual result

      The grading page for user 6 is displayed

      Cause

      The offset was not reduced after marking in mod/assignment/lib.php::assignment_base->submission(). As a result when display_submission() is called and the offset retrieved, the wrong user is calculated for the next page.

      Show
      Working with my patch for MDL-30173 applied and using the same base instructions: Users 1,2,4,6 have submitted work. It's not yet graded. As a teacher: Click the 'Grade' link for user 1 write a comment, give a grade (be generous), and choose 'Save and Next' Verify that the page for User 2 is displayed. write a comment, give a grade (be generous), and choose 'Save and Next' Expected Result The grading page for user 4 should be displayed Actual result The grading page for user 6 is displayed Cause The offset was not reduced after marking in mod/assignment/lib.php::assignment_base->submission(). As a result when display_submission() is called and the offset retrieved, the wrong user is calculated for the next page.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-30174-master-2
    • Rank:
      26061

      Description

      When using the "Save and Next" during assignment grading, and after my patch to get filter results to apply in MDL-30173 is applied; a bug with offset calculation becomes apparent.

      When Saving grade information, the offset should be decreased when calculating the URL for the 'next' button.

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          Thanks again.

          Show
          Michael de Raadt added a comment - Thanks again.
          Hide
          Ankit Agarwal added a comment -

          Looks good!
          Thanks

          Show
          Ankit Agarwal added a comment - Looks good! Thanks
          Hide
          Andrew Nicols added a comment -

          Confirmed the presence of the bug and that it cherry-picks cleanly on MOODLE_21_STABLE
          Will check MOODLE_20_STABLE in a moment

          Show
          Andrew Nicols added a comment - Confirmed the presence of the bug and that it cherry-picks cleanly on MOODLE_21_STABLE Will check MOODLE_20_STABLE in a moment
          Hide
          Andrew Nicols added a comment -

          Verified presence of bug and confirmed that it cherry-picks cleanly onto MOODLE_20_STABLE.

          Show
          Andrew Nicols added a comment - Verified presence of bug and confirmed that it cherry-picks cleanly onto MOODLE_20_STABLE.
          Hide
          Ankit Agarwal added a comment -

          Hi Andrew,
          Thanks for confirming that.
          Submitting for integration

          Note to integrators: This can be cherry-picked to 20 and 21

          Thanks

          Show
          Ankit Agarwal added a comment - Hi Andrew, Thanks for confirming that. Submitting for integration Note to integrators: This can be cherry-picked to 20 and 21 Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just 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

          PS: Note this is the last message of this type that you will receive along the whole November month, because we are running continuous integration this weeks while QA tests for release of Moodle 2.2 (Dec 1st) are being performed.

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just 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 PS: Note this is the last message of this type that you will receive along the whole November month, because we are running continuous integration this weeks while QA tests for release of Moodle 2.2 (Dec 1st) are being performed.
          Hide
          Andrew Nicols added a comment -

          Still cherry-picks cleanly on latest MOODLE_20_STABLE, MOODLE_21_STABLE, and master.

          Show
          Andrew Nicols added a comment - Still cherry-picks cleanly on latest MOODLE_20_STABLE, MOODLE_21_STABLE, and master.
          Hide
          Andrew Nicols added a comment -

          I discovered during testing that if the filter applied wasn't FILTER_REQUIRED_GRADING, then the offset was not increased.

          I've adjusted the patch for this and MDL-30173 to use a default filter of FILTER_ALL if none was supplied in the get params, and to increase the offset if the filter wasn't FILTER_REQUIRE_GRADING too.

          Tested on master

          Show
          Andrew Nicols added a comment - I discovered during testing that if the filter applied wasn't FILTER_REQUIRED_GRADING, then the offset was not increased. I've adjusted the patch for this and MDL-30173 to use a default filter of FILTER_ALL if none was supplied in the get params, and to increase the offset if the filter wasn't FILTER_REQUIRE_GRADING too. Tested on master
          Hide
          Aparup Banerjee added a comment -

          Thanks for this fix!

          Its been integrated now and ready for testing.
          (cherry-picked to 2.x stable branches and master)

          Show
          Aparup Banerjee added a comment - Thanks for this fix! Its been integrated now and ready for testing. (cherry-picked to 2.x stable branches and master)
          Hide
          Sam Hemelryk added a comment -

          Passed thanks.

          Show
          Sam Hemelryk added a comment - Passed thanks.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Closing as fixed, many thanks for your effort!

          Note that the changes related to master (2.2beta) have been already sent upstream. But the stable ones will be part of next weeklies (Wed/Thu) as usual.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Closing as fixed, many thanks for your effort! Note that the changes related to master (2.2beta) have been already sent upstream. But the stable ones will be part of next weeklies (Wed/Thu) as usual. Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: