Moodle
  1. Moodle
  2. MDL-42640

2.4 restore does not honor site's quiz overduehandling setting when restoring a 2.2 backup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.6, 2.5
    • Fix Version/s: 2.4.7, 2.5.3, 2.6
    • Component/s: Quiz
    • Labels:
    • Testing Instructions:
      Hide

      1. Get a backup of a quiz from Moodle 2.2 or earlier.

      2. Go to Admin -> Plugins -> Activity modules -> Quiz and set When time expires to Open attempts are submitted automatically.

      3. Restore the backup. Make sure that, in the settings for the restored quiz, When time expires is set to Open attempts are submitted automatically.

      4. Create a quiz in your up-to-date Moodle, with When time expires is set to Attempts must be submitted before time expires, or they are not counted.

      5. Backup that quiz, and restore it, and verify that the When time expires settings has been copied accurately.

      Show
      1. Get a backup of a quiz from Moodle 2.2 or earlier. 2. Go to Admin -> Plugins -> Activity modules -> Quiz and set When time expires to Open attempts are submitted automatically. 3. Restore the backup. Make sure that, in the settings for the restored quiz, When time expires is set to Open attempts are submitted automatically. 4. Create a quiz in your up-to-date Moodle, with When time expires is set to Attempts must be submitted before time expires, or they are not counted. 5. Backup that quiz, and restore it, and verify that the When time expires settings has been copied accurately.
    • Affected Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull 2.4 Branch:
    • Pull 2.5 Branch:
    • Rank:
      54473

      Description

      Since 2.2 does not have a quiz overduehandling setting, 2.2 course backups do not contain the setting. When restoring a 2.2 course backup into a 2.4 instance, the restore process should apply the site-level default for the overduehandling setting, but it does not. Instead, it always leaves it at the database default, which is to abandon late submissions.

      I will attach a patch shortly.

        Activity

        Hide
        Tim Hunt added a comment -

        Peer review comments.

        1. It seems that get_config now has caching, so calling it repeatedly is not too bad.

        2. So, the patch looks fine, but the commit comment is not good. See http://docs.moodle.org/dev/Coding_style#Git_commits.

        3. Also, this needs to be back-ported to stable branches, since it is a bug fix.

        Can you fix that up, then this is ready for integration.

        Show
        Tim Hunt added a comment - Peer review comments. 1. It seems that get_config now has caching, so calling it repeatedly is not too bad. 2. So, the patch looks fine, but the commit comment is not good. See http://docs.moodle.org/dev/Coding_style#Git_commits . 3. Also, this needs to be back-ported to stable branches, since it is a bug fix. Can you fix that up, then this is ready for integration.
        Hide
        Colin Campbell added a comment -

        I fixed the commit comment and added a branch for 2.5. Besides 2.4 and 2.5, I believe there are no other stable branches.

        Show
        Colin Campbell added a comment - I fixed the commit comment and added a branch for 2.5. Besides 2.4 and 2.5, I believe there are no other stable branches.
        Hide
        Tim Hunt added a comment -

        That looks gread now. Just two things:

        • We need some testing instructions. I just wrote those, but feel free to edit them if you think they can be improved.
        • You should have made a branch based on master. Shall we rely on integrators cherry-picking it? However, it would be good if you could create such a branch before the integrators get here, and please remember this for future bug fixes.

        Thanks. Submitting for integration now.

        To INTEGRATORS: Please cherry pick to master form the 2.5 branch, if necessary.

        Show
        Tim Hunt added a comment - That looks gread now. Just two things: We need some testing instructions. I just wrote those, but feel free to edit them if you think they can be improved. You should have made a branch based on master. Shall we rely on integrators cherry-picking it? However, it would be good if you could create such a branch before the integrators get here, and please remember this for future bug fixes. Thanks. Submitting for integration now. To INTEGRATORS: Please cherry pick to master form the 2.5 branch, if necessary.
        Hide
        Marina Glancy added a comment -

        Thanks Colin and Tim, integrated in 2.4, 2.5 and 2.6

        P.S. There is no caching in get_config() in 2.4 but I think it's still better than errors during restore

        Show
        Marina Glancy added a comment - Thanks Colin and Tim, integrated in 2.4, 2.5 and 2.6 P.S. There is no caching in get_config() in 2.4 but I think it's still better than errors during restore
        Hide
        Marina Glancy added a comment -

        All good on 2.4, 2.5 and 2.6

        Show
        Marina Glancy added a comment - All good on 2.4, 2.5 and 2.6
        Hide
        Damyon Wiese added a comment -

        Here lies 52 bugs.
        All fixed or swept under a rug.
        If they come back one day,
        To our dismay,
        We all will feel quite un-smug.

        Thanks for the reporting/fixing/testing on this issue. It has been sent upstream.

        Show
        Damyon Wiese added a comment - Here lies 52 bugs. All fixed or swept under a rug. If they come back one day, To our dismay, We all will feel quite un-smug. Thanks for the reporting/fixing/testing on this issue. It has been sent upstream.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: