existence of this questions by the fields specified two points above).

And this is how it works.

When restoring in a new site, all the categories and questions are created,

obviously they don't exist. But, when restoring in a existing site, the checks specified above are done. So, every zipped backup file is able to restore completely one course. And avoid the duplication of information when some data exists.

After phase1, phase2 is processed, but this is like every mod backup/restore.

Will this help ?

One final note. Primary, I always restored every question, but it resulted in tons of duplicates categories and questions in the same installation, so

I did a completely new rewrite to the actual situation.

========================== END ================================

Hope it helps to know how things are done.

2) The RANDOM AND RANDOMSAMATCH question duplication is explained in the text above. It's normal. But the MULTIANSWER one isn't !! Can you conform that this type of questions become duplicated too ?

Anyway some analysis is being done this days about this issue and some changes could arrive in v.1.1 to avoid that (in RANDOM and RANDOMSAMATCH).

FINAL NOTE: I close this bug NOW. Please, David, open a new one if MULTIANSWER questions are being duplicated !!

Martin Dougiamas
added a comment - 24/Aug/03 12:29 AM From Eloy Lafuente (stronk7 at moodle.org) Saturday, 23 August 2003, 06:23 PM:
Hola again, David:
1) This is the normal behaviour of the restore utility. To be some more detailed, this text (copied from an email I sent some days ago):
========================== START ================================
This is the current behaviour of restoring categories,
questions and quizzes:
First of all I must note that the quizzes backup/restore
is done in two phases. First, all the categories and questions
data are backuped/restored (phase1). Then, quizzes, are done (phase2).
In phase1, all the data not related to quizzes is involved and in
phase2, all the data related to quizzes is involved (for detailed
info, you can see /backup/mod/quiz/backuplib.php, the first lines
Explain every phase.
Now, how phase1 works (I think this is the problem) !!
First of all, categories are restored. With this behaviours:
If the category doesn't exist (by name), it's created in
Moodle.
If the category exists (by name) and it belongs to another
course, then its publish flag is set to 1.
If the category exists (by name) and it belongs to the
same course, no action is done (the existing category
will be used later).
Now we start with the questions under every category:
If the question doesn't exists (by category, questiontext and
qtype), it is created, with all its associated data (different
in each qtype).
If the question exists (by category, questiontext and qtype),
some mappings are done (answers, primary) to use them in phase2.
One exception to this approach is that RANDOM(4) and RANDOMSAMATCH(6)
qtypes always are created (this is because, we cannot identify the
existence of this questions by the fields specified two points above).
And this is how it works.
When restoring in a new site, all the categories and questions are created,
obviously they don't exist. But, when restoring in a existing site, the checks specified above are done. So, every zipped backup file is able to restore completely one course. And avoid the duplication of information when some data exists.
After phase1, phase2 is processed, but this is like every mod backup/restore.
Will this help ?
One final note. Primary, I always restored every question, but it resulted in tons of duplicates categories and questions in the same installation, so
I did a completely new rewrite to the actual situation.
========================== END ================================
Hope it helps to know how things are done.
2) The RANDOM AND RANDOMSAMATCH question duplication is explained in the text above. It's normal. But the MULTIANSWER one isn't !! Can you conform that this type of questions become duplicated too ?
Anyway some analysis is being done this days about this issue and some changes could arrive in v.1.1 to avoid that (in RANDOM and RANDOMSAMATCH).
FINAL NOTE: I close this bug NOW. Please, David, open a new one if MULTIANSWER questions are being duplicated !!
From Eloy Lafuente (stronk7 at moodle.org) Sunday, 24 August 2003, 12:29 AM:
INFO:
====
Updated to 0.8.10 alpha.
Backup and restore of quizzes has been changed a lot.
The detection of existing questions has been based in two new unique fields (stamp and version) in quiz_questions.
Now RANDOM and RANDOMAMATCH questions are no duplicated.
Please, try it and inform here !!
TIA, Eloy.