Moodle
  1. Moodle
  2. MDL-31392

When upgrading from 2.0 to 2.2, cannot limit quiz attempt upgrades with tool_qeupgradehelper_get_quizzes_to_upgrade

    Details

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

      See Colin Campbell's comment. Do you want more testing than that?

      1. Install Moodle < 2.1
      2. Create some quizzes and some quiz attempts.
      3. Copy the 2.2.x code into place.
      4. Follow the instructions in admin/tool/qeupgradehelp/partialupgrade-example.php
      5. Run the upgrade.
      6. Make sure that only the expected quiz attempts have been upgraded during the upgrade process, and that the rest can be completed using qeupgradehelper.

      Show
      See Colin Campbell's comment. Do you want more testing than that? 1. Install Moodle < 2.1 2. Create some quizzes and some quiz attempts. 3. Copy the 2.2.x code into place. 4. Follow the instructions in admin/tool/qeupgradehelp/partialupgrade-example.php 5. Run the upgrade. 6. Make sure that only the expected quiz attempts have been upgraded during the upgrade process, and that the rest can be completed using qeupgradehelper.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      37909

      Description

      In 2.2, the qeupgradehelper is installed in admin/tool/qeupgradehelper, but get_quiz_ids() in question/engine/upgrade/upgradelib.php looks in local/qeupgradehelper for the qeupgradehelper code. Consequently, implementing a tool_qeupgradehelper_get_quizzes_to_upgrade in admin/tool/qeupgradehelper/partialupgrade.php does not limit the quiz attempts to upgrade during the instance upgrade.

        Activity

        Hide
        Tim Hunt added a comment -

        Oops! Sorry we failed to spot that.

        Can you try this fix, and tell me if it works for you?

        Show
        Tim Hunt added a comment - Oops! Sorry we failed to spot that. Can you try this fix, and tell me if it works for you?
        Hide
        Colin Campbell added a comment -

        Yes. I cherry-picked your commit, and then the instance upgrade upgraded only those quizzes that I selected to be upgraded. Looks good. Thanks.

        Show
        Colin Campbell added a comment - Yes. I cherry-picked your commit, and then the instance upgrade upgraded only those quizzes that I selected to be upgraded. Looks good. Thanks.
        Hide
        Tim Hunt added a comment -

        Great! Thanks. Submitting for integration now.

        Show
        Tim Hunt added a comment - Great! Thanks. Submitting for integration now.
        Hide
        Aparup Banerjee added a comment -

        This has been integrated into master and the 22 branch.

        Show
        Aparup Banerjee added a comment - This has been integrated into master and the 22 branch.
        Hide
        Adrian Greeve added a comment -

        I created an install on Moodle 2.0 I created some quizzes and made several attempts with different students. I also made several attempts with the same students.
        Next I uncommented the second function and created a text file with a few of the quizzes to restore.
        I upgraded to Moodle 2.2
        I checked out the quizzes that it restored. The attempts were still intact and the number of attempts still the same.
        There was a problem with the pop up div confirming that I wanted to retake the quiz. I don't think that it's related to this fix.
        I'll create a new bug for that with a bit more testing.

        Show
        Adrian Greeve added a comment - I created an install on Moodle 2.0 I created some quizzes and made several attempts with different students. I also made several attempts with the same students. Next I uncommented the second function and created a text file with a few of the quizzes to restore. I upgraded to Moodle 2.2 I checked out the quizzes that it restored. The attempts were still intact and the number of attempts still the same. There was a problem with the pop up div confirming that I wanted to retake the quiz. I don't think that it's related to this fix. I'll create a new bug for that with a bit more testing.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Many thanks for your collaboration, this code has been integrated upstream and it's available in all the repositories.

        Closing, ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Many thanks for your collaboration, this code has been integrated upstream and it's available in all the repositories. Closing, ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: