Moodle
  1. Moodle
  2. MDL-21045

Gradebook Categories and Settings not backing up/restoring

    Details

    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Gradebook aggregation settings and categories are lost in a 1.9.7 to 1.9.7 course backup/restore.

      Steps: Add categories to the gradebook and change aggregation methods in the gradebook course settings. Backup the course without user data. Restore the course to the same site. Gradebook categories do not come over to the new course and settings are back to their defaults.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            Lori Davies added a comment -

            Courses from 1.9.4 and 1.9.5 have the same results; the categories and settings are not restored.

            Show
            Lori Davies added a comment - Courses from 1.9.4 and 1.9.5 have the same results; the categories and settings are not restored.
            Hide
            Jan Pontia added a comment -

            Teacher role in 1.9.5 can choose to backup grade histories and restore grade histories (without users) and the gradebook structure moves to the newly restored course (Ex: for a new term course setup).

            Unable to do this with the teacher role in 1.9.7. Our faculty who design gradebooks with many items will want the ability to backup/restore their gradebook structure/design from term to term (without user data).

            It seems like an admin acct in 1.9.7 can do the backup and restore with grade histories (without users) and the gradebook structure (aggregations and such) can be restored but we'd like the teacher role to have that ability.

            Show
            Jan Pontia added a comment - Teacher role in 1.9.5 can choose to backup grade histories and restore grade histories (without users) and the gradebook structure moves to the newly restored course (Ex: for a new term course setup). Unable to do this with the teacher role in 1.9.7. Our faculty who design gradebooks with many items will want the ability to backup/restore their gradebook structure/design from term to term (without user data). It seems like an admin acct in 1.9.7 can do the backup and restore with grade histories (without users) and the gradebook structure (aggregations and such) can be restored but we'd like the teacher role to have that ability.
            Hide
            Neil Streeter added a comment -

            We're about to roll semesters and a patch for this issue would be really really really nice

            IMHO, the gradebook categories and settings should be restored even if the instructor does not have the new role ability to 'backup user data' or 'restore user data'. It appears that was the intention at least when it comes to the back up portion...

            I did a little digging through the moodle.xml file created when logged in as an instructor. on 1.9.7+

            1) The instructor role does NOT have the ability to 'backup user data'...

            2) The moodle.xml file DOES contain the category info.. for two categories in this particular testing gradebook the XML snippet looks like this...
            <GRADEBOOK>
            <GRADE_CATEGORIES>
            <GRADE_CATEGORY>
            <ID>886</ID>
            <PARENT>$@NULL@$</PARENT>
            <FULLNAME>?</FULLNAME>
            <AGGREGATION>11</AGGREGATION>
            <KEEPHIGH>0</KEEPHIGH>
            <DROPLOW>0</DROPLOW>
            <AGGREGATEONLYGRADED>0</AGGREGATEONLYGRADED>
            <AGGREGATEOUTCOMES>0</AGGREGATEOUTCOMES>
            <AGGREGATESUBCATS>0</AGGREGATESUBCATS>
            <TIMECREATED>1218783379</TIMECREATED>
            <TIMEMODIFIED>1246413828</TIMEMODIFIED>
            </GRADE_CATEGORY>
            <GRADE_CATEGORY>
            <ID>18088</ID>
            <PARENT>886</PARENT>
            <FULLNAME>Cat1</FULLNAME>
            <AGGREGATION>13</AGGREGATION>
            <KEEPHIGH>0</KEEPHIGH>
            <DROPLOW>0</DROPLOW>
            <AGGREGATEONLYGRADED>0</AGGREGATEONLYGRADED>
            <AGGREGATEOUTCOMES>0</AGGREGATEOUTCOMES>
            <AGGREGATESUBCATS>0</AGGREGATESUBCATS>
            <TIMECREATED>1261086277</TIMECREATED>
            <TIMEMODIFIED>1261086279</TIMEMODIFIED>
            </GRADE_CATEGORY>
            <GRADE_CATEGORY>
            <ID>18089</ID>
            <PARENT>886</PARENT>
            <FULLNAME>Cat2</FULLNAME>
            <AGGREGATION>13</AGGREGATION>
            <KEEPHIGH>0</KEEPHIGH>
            <DROPLOW>0</DROPLOW>
            <AGGREGATEONLYGRADED>0</AGGREGATEONLYGRADED>
            <AGGREGATEOUTCOMES>0</AGGREGATEOUTCOMES>
            <AGGREGATESUBCATS>0</AGGREGATESUBCATS>
            <TIMECREATED>1261086294</TIMECREATED>
            <TIMEMODIFIED>1261086294</TIMEMODIFIED>
            </GRADE_CATEGORY>
            </GRADE_CATEGORIES>

            3) on restore the categories are not re-created
            4) the instructor role does NOT have the 'restore user data' capability.... I also did a restore after granting the instructor the 'restore user data' capability but ended up with the same result - no categories.

            I would carefully assume therefore that the issue here lies in the restore process - I'll be looking more closely at that tomorrow.

            I'd appreciate any help I can get!

            Thanks!
            Neil

            Show
            Neil Streeter added a comment - We're about to roll semesters and a patch for this issue would be really really really nice IMHO, the gradebook categories and settings should be restored even if the instructor does not have the new role ability to 'backup user data' or 'restore user data'. It appears that was the intention at least when it comes to the back up portion... I did a little digging through the moodle.xml file created when logged in as an instructor. on 1.9.7+ 1) The instructor role does NOT have the ability to 'backup user data'... 2) The moodle.xml file DOES contain the category info.. for two categories in this particular testing gradebook the XML snippet looks like this... <GRADEBOOK> <GRADE_CATEGORIES> <GRADE_CATEGORY> <ID>886</ID> <PARENT>$@NULL@$</PARENT> <FULLNAME>?</FULLNAME> <AGGREGATION>11</AGGREGATION> <KEEPHIGH>0</KEEPHIGH> <DROPLOW>0</DROPLOW> <AGGREGATEONLYGRADED>0</AGGREGATEONLYGRADED> <AGGREGATEOUTCOMES>0</AGGREGATEOUTCOMES> <AGGREGATESUBCATS>0</AGGREGATESUBCATS> <TIMECREATED>1218783379</TIMECREATED> <TIMEMODIFIED>1246413828</TIMEMODIFIED> </GRADE_CATEGORY> <GRADE_CATEGORY> <ID>18088</ID> <PARENT>886</PARENT> <FULLNAME>Cat1</FULLNAME> <AGGREGATION>13</AGGREGATION> <KEEPHIGH>0</KEEPHIGH> <DROPLOW>0</DROPLOW> <AGGREGATEONLYGRADED>0</AGGREGATEONLYGRADED> <AGGREGATEOUTCOMES>0</AGGREGATEOUTCOMES> <AGGREGATESUBCATS>0</AGGREGATESUBCATS> <TIMECREATED>1261086277</TIMECREATED> <TIMEMODIFIED>1261086279</TIMEMODIFIED> </GRADE_CATEGORY> <GRADE_CATEGORY> <ID>18089</ID> <PARENT>886</PARENT> <FULLNAME>Cat2</FULLNAME> <AGGREGATION>13</AGGREGATION> <KEEPHIGH>0</KEEPHIGH> <DROPLOW>0</DROPLOW> <AGGREGATEONLYGRADED>0</AGGREGATEONLYGRADED> <AGGREGATEOUTCOMES>0</AGGREGATEOUTCOMES> <AGGREGATESUBCATS>0</AGGREGATESUBCATS> <TIMECREATED>1261086294</TIMECREATED> <TIMEMODIFIED>1261086294</TIMEMODIFIED> </GRADE_CATEGORY> </GRADE_CATEGORIES> 3) on restore the categories are not re-created 4) the instructor role does NOT have the 'restore user data' capability.... I also did a restore after granting the instructor the 'restore user data' capability but ended up with the same result - no categories. I would carefully assume therefore that the issue here lies in the restore process - I'll be looking more closely at that tomorrow. I'd appreciate any help I can get! Thanks! Neil
            Hide
            Michael Blake added a comment -

            Eloy, can you have a look at this please?

            Show
            Michael Blake added a comment - Eloy, can you have a look at this please?
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Should be fixed now. Problem was caused by one recent modification (by me) introduced for Moodle 1.9.7 . Now letters, outcomes, grade categories and grade items are restored properly no matter if no users are included.

            Resolving as fixed. Feel free to reopen if necessary... ciao

            Show
            Eloy Lafuente (stronk7) added a comment - Should be fixed now. Problem was caused by one recent modification (by me) introduced for Moodle 1.9.7 . Now letters, outcomes, grade categories and grade items are restored properly no matter if no users are included. Resolving as fixed. Feel free to reopen if necessary... ciao
            Hide
            Neil Streeter added a comment -

            Can you attach a patch for me or let me know what to pull from cvs?

            Many many thanks!

            Neil

            Show
            Neil Streeter added a comment - Can you attach a patch for me or let me know what to pull from cvs? Many many thanks! Neil
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Hi Neil,

            you can see the changes performed related to this bug in the "version control" tab above.

            The change performed was, simply this (assuming you are running 1.9.7): http://cvs.moodle.org/moodle/backup/restorelib.php?r1=1.283.2.90&r2=1.283.2.91

            In any case, it's not recommended to patch Moodle partially, so I'd recommend you to update to the next weekly build (next Wednesday with the MOODLE_19_WEEKLY tag in CVS) or, alternatively, update to current (right now) version (MOODLE_19_STABLE in CVS).

            I think that in this exact case, it's safe to do the individual modification because it doesn't affect anything else but please, don't follow that approach in general. Always update Moodle as a whole and if possible, using the latest WEEKLY versions.

            Ciao

            Show
            Eloy Lafuente (stronk7) added a comment - Hi Neil, you can see the changes performed related to this bug in the "version control" tab above. The change performed was, simply this (assuming you are running 1.9.7): http://cvs.moodle.org/moodle/backup/restorelib.php?r1=1.283.2.90&r2=1.283.2.91 In any case, it's not recommended to patch Moodle partially, so I'd recommend you to update to the next weekly build (next Wednesday with the MOODLE_19_WEEKLY tag in CVS) or, alternatively, update to current (right now) version (MOODLE_19_STABLE in CVS). I think that in this exact case, it's safe to do the individual modification because it doesn't affect anything else but please, don't follow that approach in general. Always update Moodle as a whole and if possible, using the latest WEEKLY versions. Ciao
            Hide
            Neil Streeter added a comment -

            Thanks Eloy - I generally do a complete merge from the weekly builds - in this case though I'll make this modification and expect a conflict on restorelib.php next time I merge

            Again huge thanks for your quick response - amazing!

            Neil

            Show
            Neil Streeter added a comment - Thanks Eloy - I generally do a complete merge from the weekly builds - in this case though I'll make this modification and expect a conflict on restorelib.php next time I merge Again huge thanks for your quick response - amazing! Neil
            Hide
            mert gokkaya added a comment -

            I tried to use a backup from 1.9.5.

            XML has the category information properly.
            Updated to the last version.
            Checked if the restore lib is up to date.

            While restoring I got an error at line 2195 and 2196 with the error indicated below. Is it my structure or something else. Seems like new instance creation is the problem.

            Creating gradebook

            • Grade items

            Notice: Trying to get property of non-object in C:\wamp\www\moodle\backup\restorelib.php on line 2195

            Show
            mert gokkaya added a comment - I tried to use a backup from 1.9.5. XML has the category information properly. Updated to the last version. Checked if the restore lib is up to date. While restoring I got an error at line 2195 and 2196 with the error indicated below. Is it my structure or something else. Seems like new instance creation is the problem. Creating gradebook Grade items Notice: Trying to get property of non-object in C:\wamp\www\moodle\backup\restorelib.php on line 2195
            Hide
            Rob Monk added a comment -

            I have upgraded our site to 1.9.7 on Jan 28th and I am still experiencing the same problem.

            I back up a course with 4 Assessment Categories and about 40 assessment items in the grade book. Backup is without user data.
            When I restore the course everything works fine except the Assessment Categories dissappear. All my assessment items are lumped together in one lot.

            Show
            Rob Monk added a comment - I have upgraded our site to 1.9.7 on Jan 28th and I am still experiencing the same problem. I back up a course with 4 Assessment Categories and about 40 assessment items in the grade book. Backup is without user data. When I restore the course everything works fine except the Assessment Categories dissappear. All my assessment items are lumped together in one lot.
            Hide
            Eloy Lafuente (stronk7) added a comment -

            Hi Rob,

            have you upgraded to Moodle 1.9.7 (the release) or to current 1.9.7+ (the current stable weekly build) ?

            The release (1.9.7) is previous to this bugfix, so you'll need current weekly build (1.9.7+) to get those categories being restored without user-data. In fact, there was a regression in this bug that was fixed later by MDL-21046 (on January 19th). So you need, definitively, one stable build after that date.

            Ciao

            PS: If you continue having problems after using the "correct" stable build, plz. Create a new bug in the tracker with all the details / versions and so on, TIA!

            Show
            Eloy Lafuente (stronk7) added a comment - Hi Rob, have you upgraded to Moodle 1.9.7 (the release) or to current 1.9.7+ (the current stable weekly build) ? The release (1.9.7) is previous to this bugfix, so you'll need current weekly build (1.9.7+) to get those categories being restored without user-data. In fact, there was a regression in this bug that was fixed later by MDL-21046 (on January 19th). So you need, definitively, one stable build after that date. Ciao PS: If you continue having problems after using the "correct" stable build, plz. Create a new bug in the tracker with all the details / versions and so on, TIA!
            Hide
            Glenys Hanson added a comment -

            I'm having the same problem with gradebook categories being lost after backup and restore in 1.9.11
            This also happens when a course is imported, that is without user data.

            Show
            Glenys Hanson added a comment - I'm having the same problem with gradebook categories being lost after backup and restore in 1.9.11 This also happens when a course is imported, that is without user data.
            Hide
            Céline Perves added a comment -

            same problem even if restore_gradebook_history is set to false
            since i absolutely need to restore without gradebook and don't have time to wait for patch on backup creation decided to make a rapid, efficient patch
            error in restorelib.php l 1830
            seems to come from backup_todb($info['GRADE_CATEGORY']'#'['NAME']['0']'#', false);
            so I decided to replace NAME by FULLNAME
            on line concerning drop_x_lowest if added a test if null transform to 0
            backup_todb($info['GRADE_CATEGORY']'#'['DROP_X_LOWEST']['0']'#', false)==null?0:backup_todb($info['GRADE_CATEGORY']'#'['DROP_X_LOWEST']['0']'#', false)==null;
            and so it turns

            Show
            Céline Perves added a comment - same problem even if restore_gradebook_history is set to false since i absolutely need to restore without gradebook and don't have time to wait for patch on backup creation decided to make a rapid, efficient patch error in restorelib.php l 1830 seems to come from backup_todb($info ['GRADE_CATEGORY'] '#' ['NAME'] ['0'] '#' , false); so I decided to replace NAME by FULLNAME on line concerning drop_x_lowest if added a test if null transform to 0 backup_todb($info ['GRADE_CATEGORY'] '#' ['DROP_X_LOWEST'] ['0'] '#' , false)==null?0:backup_todb($info ['GRADE_CATEGORY'] '#' ['DROP_X_LOWEST'] ['0'] '#' , false)==null; and so it turns

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: