Issue Details (XML | Word | Printable)

Key: MDL-5482
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Tim Hunt
Reporter: Paulo Matos
Votes: 1
Watchers: 8
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Restoring of user attempts in quiz module (attached solution)

Created: 11/May/06 10:29 PM   Updated: 07/May/08 08:34 PM
Return to search
Component/s: Quiz
Affects Version/s: 1.5.4
Fix Version/s: 1.6.7, 1.7.5, 1.8.6, 1.9.1

File Attachments: 1. Text File moodle-1.6.2plus-5482-Restoring_of_user_attempts_in_quiz_module.patch (6 kB)
2. Text File moodle-1.6.4plus-MDL5482-Restoring_of_user_attempts_in_quiz_module.patch (6 kB)
3. Text File moodle-1.6.4plus-MDL5482-Restoring_of_user_attempts_in_quiz_module_v2.patch (8 kB)
4. Text File moodle-1.6.4plus-MDL5482-Restoring_of_user_attempts_in_quiz_module_v3.patch (8 kB)
5. Text File moodle-1.8.4plus-MDL5482-Restoring_of_user_attempts_in_quiz_module.patch (7 kB)
6. Text File restore_quiz_attempts_183+.patch.txt (8 kB)
7. Text File restore_quiz_attempts_19.patch.txt (8 kB)

Environment: All
Issue Links:
Duplicate
 
Relates
 

Participants: Martin Dougiamas, Paulo Matos and Tim Hunt
Security Level: None
Resolved date: 07/May/08
Affected Branches: MOODLE_15_STABLE
Fixed Branches: MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
* Introduction:

This issue AFAIK was discussed on MDL-3159, and reported on bugs #4054, #4139 and #4608.

At quiz changelog, appears the following entry:

2005-06-06 Monday 04:25 gustav_delius * restorelib.php: Restoring of user attempts and states disabled for now, see MDL-3159

I found a post at moodle forums, see:

http://moodle.org/mod/forum/discuss.php?d=30923

This post has a version of restorelib.php with attempts restore implemented.

I've used this modified version verifying the code against latest stable CVS version which at this time is 1.58.2.6 2006/02/14 22:55:11, for a mass restore due to an hard disk crash.

* Now, some interesting numbers involved on this work:

- 6989 users;
- 773 courses;
- 385 quiz;
- 9041 questions;
- 21025 attempts;

and 72 long hours recovering it :(.

All restored quizzes seem to be OK. For now, there were no problems detected among dozens of hand verifications. If some problem appears, I'll report them here.

Hope Gustav can integrate this code, will surely be very appreciated by moodle community.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
tjhunt committed 4 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 07/May/08 08:31 PM
MDL-5482 - Backup and restore problems for match, random and truefalse question types.

All the credit goes to Paulo Matos who carefully worked out and tested this fix, and updated the patch several times over more than a year while I very slowly got around to reviewing it and checking it in.
MODIFY question/type/truefalse/questiontype.php   Rev. 1.17.2.3    (+9 -7 lines)
MODIFY question/type/random/questiontype.php   Rev. 1.12.2.3    (+44 -1 lines)
MODIFY question/restorelib.php   Rev. 1.30.2.4    (+10 -1 lines)
MODIFY question/type/match/questiontype.php   Rev. 1.32.2.3    (+22 -8 lines)
tjhunt committed 5 files to 'Moodle CVS' on branch 'MOODLE_17_STABLE' - 07/May/08 08:31 PM
MDL-5482 - Backup and restore problems for match, random and truefalse question types.

All the credit goes to Paulo Matos who carefully worked out and tested this fix, and updated the patch several times over more than a year while I very slowly got around to reviewing it and checking it in.
MODIFY question/type/random/questiontype.php   Rev. 1.5.4.4    (+44 -1 lines)
MODIFY question/restorelib.php   Rev. 1.21.2.5    (+11 -2 lines)
MODIFY question/format/xml/format.php   Rev. 1.16.2.11    (+3 -1 lines)
MODIFY question/type/truefalse/questiontype.php   Rev. 1.7.4.1    (+9 -7 lines)
MODIFY question/type/match/questiontype.php   Rev. 1.16.4.5    (+22 -8 lines)
tjhunt committed 4 files to 'Moodle CVS' on branch 'MOODLE_18_STABLE' - 07/May/08 08:31 PM
MDL-5482 - Backup and restore problems for match, random and truefalse question types.

All the credit goes to Paulo Matos who carefully worked out and tested this fix, and updated the patch several times over more than a year while I very slowly got around to reviewing it and checking it in.
MODIFY question/restorelib.php   Rev. 1.22.2.4    (+11 -2 lines)
MODIFY question/type/truefalse/questiontype.php   Rev. 1.11.2.3    (+9 -7 lines)
MODIFY question/type/match/questiontype.php   Rev. 1.21.2.8    (+22 -8 lines)
MODIFY question/type/random/questiontype.php   Rev. 1.6.2.3    (+44 -1 lines)
tjhunt committed 5 files to 'Moodle CVS' on branch 'MOODLE_16_STABLE' - 07/May/08 08:31 PM
MDL-5482 - Backup and restore problems for match, random and truefalse question types.

All the credit goes to Paulo Matos who carefully worked out and tested this fix, and updated the patch several times over more than a year while I very slowly got around to reviewing it and checking it in.
MODIFY question/type/match/questiontype.php   Rev. 1.6.2.2    (+22 -8 lines)
MODIFY question/format/xml/format.php   Rev. 1.5.4.3    (+3 -1 lines)
MODIFY question/type/truefalse/questiontype.php   Rev. 1.2.6.2    (+9 -7 lines)
MODIFY question/type/random/questiontype.php   Rev. 1.4.6.3    (+44 -1 lines)
MODIFY question/restorelib.php   Rev. 1.13.6.2    (+10 -1 lines)
tjhunt committed 4 files to 'Moodle CVS' - 07/May/08 08:32 PM
MDL-5482 - Backup and restore problems for match, random and truefalse question types.

All the credit goes to Paulo Matos who carefully worked out and tested this fix, and updated the patch several times over more than a year while I very slowly got around to reviewing it and checking it in.
MODIFY question/type/truefalse/questiontype.php   Rev. 1.19    (+9 -7 lines)
MODIFY question/type/match/questiontype.php   Rev. 1.35    (+22 -8 lines)
MODIFY question/restorelib.php   Rev. 1.35    (+10 -1 lines)
MODIFY question/type/random/questiontype.php   Rev. 1.15    (+44 -1 lines)
tjhunt committed 3 files to 'Moodle CVS' - 07/May/08 09:34 PM
MDL-14727 - Do a database update to fix random questions with the wrong parent (there may be some of these floating around in people's databases becuase of MDL-5482.)
MODIFY lib/db/upgrade.php   Rev. 1.194    (+8 -1 lines)
MODIFY question/upgrade.php   Rev. 1.14    (+15 -0 lines)
MODIFY version.php   Rev. 1.639    (+1 -1 lines)
tjhunt committed 2 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 07/May/08 09:35 PM
MDL-14727 - Do a database update to fix random questions with the wrong parent (there may be some of these floating around in people's databases becuase of MDL-5482.)

This is a backport from HEAD. Note that I have intentionally not changed version.php. There is not a spare number, and 1.9.1 is due to be released soon. It is OK for this to wait until then.
MODIFY question/upgrade.php   Rev. 1.12.2.2    (+15 -0 lines)
MODIFY lib/db/upgrade.php   Rev. 1.154.2.31    (+8 -1 lines)
tjhunt committed 1 file to 'Moodle CVS' - 09/May/08 11:10 PM
MDL-14750 - Multianswer questions get broken by backup and restore becuase question->parent is not recoded properly in the database. This commit also fixes a regression introduced by the fix for MDL-5482.
MODIFY question/restorelib.php   Rev. 1.36    (+15 -11 lines)
tjhunt committed 1 file to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 09/May/08 11:10 PM
MDL-14750 - Multianswer questions get broken by backup and restore becuase question->parent is not recoded properly in the database. This commit also fixes a regression introduced by the fix for MDL-5482.
MODIFY question/restorelib.php   Rev. 1.30.2.5    (+15 -11 lines)