Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-5532

Restore course from previous semester - with wrong year!

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.7
    • Component/s: Backup
    • Labels:
      None
    • Environment:
      All
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_15_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE

      Description

      One usability problem that we have for the backup/restore module of Moodle is that, our instructors often backup their courses taught on moodle in previous semesters and restore them to the current semester. However, the due dates for the activities (quizzes, assignments, etc.) would still remain as they were previously. If Moodle could automatically detects the system clock or something and prompt the user whether he/she want Moodle to change the year to current year/semester (sort of a smart approach), I think that would be great! A lot of our instructors have requested such feature. This is particularly useful when some courses have a LOT of activities that require manual date changes (for due dates..etc.) for all the activities (quiz, assignments..etc).

      This occurs mostly with the year from Fall to Spring semesters. For example, a course backed up in Fall, when restored in Spring semester it will have Fall's year on it (and all the activities due dates would remain last year).

        Gliffy Diagrams

        1. patch_moodle_17.txt
          14 kB
          Alan Thompson
        1. screenshot-1.jpg
          74 kB

          Issue Links

            Activity

            Hide
            spideywebber Alan Thompson added a comment -

            I have modified the existing 'Restore - Create New Course' process to accept parameters during the restore process, the individual modules then use the new date offset do any updates required.

            Show
            spideywebber Alan Thompson added a comment - I have modified the existing 'Restore - Create New Course' process to accept parameters during the restore process, the individual modules then use the new date offset do any updates required.
            Hide
            spideywebber Alan Thompson added a comment -

            Being new to Moodle and the OU, and having been allowed the task of creating a mechanism to enable this "Roll Forwards" process during the creation of "New Courses" whilst being Restored from existing ones.
            I am modifing the existing 'Restore - Create New Course' process to accept parameters during the restore process, the individual activity modules then using the new date offset do any updates required.

            This process currently requires a Course Backup followed by a Restore (possibly with loads of clicking, to reduce the amount of user data) and then manual changes to things like the Course Code, Title, Start Date, and changes within individual Activities which have dates applied (relative to the Courses start date).

            I have modified the existing 'Restore - Create New Course' process for Admins, to allow these parameters to be changed during the restore process, the individual activity modules then do any updates required.

            The changes are logged during the process to an HTML file created in the New Courses Files folder, for reference later. (I did look into adding this information to the existing Report Logs, however the format of the existing Log process doesn't lend itself to this "simple" recording need.

            User intervention is still required to Roll Forward courses individually, removing All User information and files.

            I have attached an example view of the Restore page in use and a minmal patch file showing just the basics required to implement the change to the Assignments module in Course created with Moodle 1.7 Head at this time.

            I am in the process of testing the changes within the other Activity modules, and hope to have the complete patch ready soon.

            This change does not address the problem of Blocks needing to be Rolled Forwards, this is something not mentioned in the original description.

            Show
            spideywebber Alan Thompson added a comment - Being new to Moodle and the OU, and having been allowed the task of creating a mechanism to enable this "Roll Forwards" process during the creation of "New Courses" whilst being Restored from existing ones. I am modifing the existing 'Restore - Create New Course' process to accept parameters during the restore process, the individual activity modules then using the new date offset do any updates required. This process currently requires a Course Backup followed by a Restore (possibly with loads of clicking, to reduce the amount of user data) and then manual changes to things like the Course Code, Title, Start Date, and changes within individual Activities which have dates applied (relative to the Courses start date). I have modified the existing 'Restore - Create New Course' process for Admins, to allow these parameters to be changed during the restore process, the individual activity modules then do any updates required. The changes are logged during the process to an HTML file created in the New Courses Files folder, for reference later. (I did look into adding this information to the existing Report Logs, however the format of the existing Log process doesn't lend itself to this "simple" recording need. User intervention is still required to Roll Forward courses individually, removing All User information and files. I have attached an example view of the Restore page in use and a minmal patch file showing just the basics required to implement the change to the Assignments module in Course created with Moodle 1.7 Head at this time. I am in the process of testing the changes within the other Activity modules, and hope to have the complete patch ready soon. This change does not address the problem of Blocks needing to be Rolled Forwards, this is something not mentioned in the original description.
            Hide
            spideywebber Alan Thompson added a comment -

            Roll Forwards Course Assignments

            Show
            spideywebber Alan Thompson added a comment - Roll Forwards Course Assignments
            Hide
            spideywebber Alan Thompson added a comment -

            Complete work on Roll Forwards MDL-5532

            • Add fields to restore form to enable changes to Short Name, Full Name and Start Date
            • Start Date offset added to Restore process
            • Created Restorelog file in Course files area
            • Activity Modules use offset to change dates
            • Activity Modules write changes to Restorelog
            Show
            spideywebber Alan Thompson added a comment - Complete work on Roll Forwards MDL-5532 Add fields to restore form to enable changes to Short Name, Full Name and Start Date Start Date offset added to Restore process Created Restorelog file in Course files area Activity Modules use offset to change dates Activity Modules write changes to Restorelog
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Great stuff Alan!! B-)

            I hope I'll be able to take a look to it in some days... although any tests from everybody will be really welcome.

            Looking to the code in CVS, just the "log mechanism" open file/send line/close file (are you closing it?) seems really repetitive. I would propose to:

            • Send logs to backup_logs table
            • Sending logs to the courseid/restorelog.html file but from one centralised function, in order to be able the destination in the future.

            Great work, anyway!

            Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Great stuff Alan!! B-) I hope I'll be able to take a look to it in some days... although any tests from everybody will be really welcome. Looking to the code in CVS, just the "log mechanism" open file/send line/close file (are you closing it?) seems really repetitive. I would propose to: Send logs to backup_logs table Sending logs to the courseid/restorelog.html file but from one centralised function, in order to be able the destination in the future. Great work, anyway! Ciao
            Hide
            spideywebber Alan Thompson added a comment -

            Thanks for the review Eloy.

            We did discuss the possibility of sending the logs to the backup_logs table here in the team, but the info we wanted to log didnt seem to lend itself easily to being inserted into the existing table, we prefer not to change tables if possible.
            We had already decided that a "simple" after Restore confidence check meets our work flow requirements, (at this time).

            The restore log file is opened and closed within the restore_execute function, which calls all of the activity modules, they just check it exists before writing to it, it was decided it should be created in the course files area for easy access by the course design teams

            The change to this facility may not meet everybodies exact needs, but the process is adaptable, and can be extended in the future.

            Show
            spideywebber Alan Thompson added a comment - Thanks for the review Eloy. We did discuss the possibility of sending the logs to the backup_logs table here in the team, but the info we wanted to log didnt seem to lend itself easily to being inserted into the existing table, we prefer not to change tables if possible. We had already decided that a "simple" after Restore confidence check meets our work flow requirements, (at this time). The restore log file is opened and closed within the restore_execute function, which calls all of the activity modules, they just check it exists before writing to it, it was decided it should be created in the course files area for easy access by the course design teams The change to this facility may not meet everybodies exact needs, but the process is adaptable, and can be extended in the future.
            Hide
            ray Ray Lawrence added a comment -

            Attempted a restore on today's CVS update. Could not proceed, get this message:

            Error checking backup file. moodle.xml not found at root level of zip file.
            An error has ocurred

            Not sure if this is related the addition of this (great ) functionallity.

            Show
            ray Ray Lawrence added a comment - Attempted a restore on today's CVS update. Could not proceed, get this message: Error checking backup file. moodle.xml not found at root level of zip file. An error has ocurred Not sure if this is related the addition of this (great ) functionallity.
            Hide
            spideywebber Alan Thompson added a comment -

            I have tested this both before and after commiting the changes, and not experienced this kind of problem.

            I went and updated my project again after recieving notification of your problem, and created a new backup file too.
            I dont experience any problems with either a pre-existing backup zip file or a new one, so cant explain the problem im afraid.

            This facility only affects the restore operation anyway, so couldnt effect changes to any zip files, either existing or new.

            Glad you like it.

            Show
            spideywebber Alan Thompson added a comment - I have tested this both before and after commiting the changes, and not experienced this kind of problem. I went and updated my project again after recieving notification of your problem, and created a new backup file too. I dont experience any problems with either a pre-existing backup zip file or a new one, so cant explain the problem im afraid. This facility only affects the restore operation anyway, so couldnt effect changes to any zip files, either existing or new. Glad you like it.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Gordon suggestion in MDL-6566 seems pretty good. Just to your consideration!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Gordon suggestion in MDL-6566 seems pretty good. Just to your consideration!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  7/Nov/06