From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 11 May 2006, 11:00 PM:
I took the liberty of adding the people involved so far in this issue. Hope my numbers can provide some trust for a code commit.
Last but not least thanks Julian: you save my day.
From Eloy Lafuente (stronk7 at moodle.org) Thursday, 11 May 2006, 11:54 PM:
IMO it will be really great to have attempts working on 1.5.4!
If somebody can check the patch (it's a huge one) works as expected (bug 3159)... I'm really out of time now 
Thanks Paulo!
From Eloy Lafuente (stronk7 at moodle.org) Thursday, 11 May 2006, 11:54 PM:
Adding the boss here too! 
From Gustav Delius (gwd2 at york.ac.uk) Friday, 12 May 2006, 02:27 PM:
I think it is highly unlikely that we can afford the manpower to implement this in 1.5.4. I do remember looking at the code when doing the restore for 1.6 and felt that it was not stable enough to go into Moodle 1.5. I think we have to devote our efforts to testing the restore code in 1.6 more before contemplating backporting it to 1.5.4.
From Eloy Lafuente (stronk7 at moodle.org) Friday, 12 May 2006, 05:21 PM:
Aha. That's another interesting path, backporting 1.6 restore code to 1.5.x... if the patch attached here doesn't suit your requirements for 1.5.x... nothing against it from me, of course. 
Ciao 
From Paulo Matos (paulo.matos at fct.unl.pt) Wednesday, 24 May 2006, 09:53 PM:
Well, as promissed here are some bug we found out:
- Random questions whith multichoice does not show the values on answers just a,b,c,d.
- In several places, namely while diplaying item analisys I got:
Error: Missing question options! (multichoice)
Can someone give me a hint where to look?
I put a testcase that is too big to be attached here:
http://moodle.fct.unl.pt/bug_report/
TIA. Paulo.
From Gustav Delius (gwd2 at york.ac.uk) Friday, 26 May 2006, 05:12 PM:
Paulo, thanks for your help with testing the restore code. Tim has now taken over maintenance of the question engine and I am assigning this bug to him.
From Paulo Matos (paulo.matos at fct.unl.pt) Friday, 26 May 2006, 09:58 PM:
Ok Delius! Tim, I'm willing to help to solve this issue, just too complicated to get it done without help in a reasonable amount of time. Don't hesitate in contact me. As I said before I experiencied an overall disk crash, I have a huge pressure to solve this issue.
Keep the good work guys.
Paulo.
From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 1 June 2006, 06:37 AM:
Tim, any hints on this?
From Paulo Matos (paulo.matos at fct.unl.pt) Tuesday, 6 June 2006, 02:35 AM:
I think I found the problem... options order are not recoded to the new IDs, as you can see bellow ($states[$i] for a single question)
$states->options->order is incorrect, as well as $states->seq_number...
I manage to see that the options reach the correct print_question_formulation_and_controls() function but as the order is incorrect it prints nothing....
Can now someone give me a small hint where to dig on??
Regards,
Paulo
Bellow is an smaple output of $states for a question while reviewing an attempt (mod/quiz/review.php?q=617&attempt=15581)
------------------------------------------------ STATES --------------------------------
stdClass Object
(
[question] => 9793
[0] => 251594
[id] => 251594
[1] => 15581
[attempt] => 15581
[2] => 9793
[3] => 0
[originalquestion] => 0
[4] => 2
[seq_number] => 2
[5] => random9768-20216,20213,20214,20215,20217:20217
[6] => 1141912664
[timestamp] => 1141912664
[7] => 6
[event] => 6
[8] => 1
[grade] => 1
[9] => 1
[raw_grade] => 1
[10] => 0.1
[penalty] => 0.1
[11] => 0.0
[sumpenalty] => 0.0
[responses] => Array
(
[] => 20217
)
[changed] =>
[options] => stdClass Object
(
[order] => Array
(
[0] => 20216
[1] => 20213
[2] => 20214
[3] => 20215
[4] => 20217
)
[question] => stdClass Object
(
[0] => 9768
[id] => 9768
[1] => 621
[category] => 621
[2] => 0
[parent] => 0
[3] => 13. (7.0 × 106)/(2.0 × 10-6)=
[name] => 13. (7.0 × 106)/(2.0 × 10-6)=
[4] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[questiontext] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[5] => 1
[questiontextformat] => 1
[6] =>
[image] =>
[7] => 1
[defaultgrade] => 1
[8] => 0.1
[penalty] => 0.1
[9] => 3
[qtype] => 3
[10] => 1
[length] => 1
[11] => moodle.fct.unl.pt+060305202237+vwz4EM
[stamp] => moodle.fct.unl.pt+060305202237+vwz4EM
[12] => 4
[version] => 4
[13] => 0
[hidden] => 0
[options] => stdClass Object
(
[0] => 6229
[id] => 6229
[1] => 9768
[question] => 9768
[2] => 0
[layout] => 0
[3] => 27611,27612,27613,27614,27615
[answers] => Array
(
[27611] => stdClass Object
(
[id] => 27611
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 12}$$
[answer] => $$3.5 \times 10^{ - 12}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27612] => stdClass Object
(
[id] => 27612
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 6}$$
[answer] => $$3.5 \times 10^{ - 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27613] => stdClass Object
(
[id] => 27613
[0] => 9768
[question] => 9768
[1] => 3.5
[answer] => 3.5
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27614] => stdClass Object
(
[id] => 27614
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 6}$$
[answer] => $$3.5 \times 10^{ 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27615] => stdClass Object
(
[id] => 27615
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 12}$$
[answer] => $$3.5 \times 10^{ 12}$$
[2] => 1
[fraction] => 1
[3] =>
[feedback] =>
)
[20216] =>
[20213] =>
[20214] =>
[20215] =>
[20217] =>
)
[4] => 1
[single] => 1
)
[name_prefix] => resp9793_
[maxgrade] => 1
)
)
[last_graded] => stdClass Object
(
[question] => 9793
[0] => 251594
[id] => 251594
[1] => 15581
[attempt] => 15581
[2] => 9793
[3] => 0
[originalquestion] => 0
[4] => 2
[seq_number] => 2
[5] => random9768-20216,20213,20214,20215,20217:20217
[6] => 1141912664
[timestamp] => 1141912664
[7] => 6
[event] => 6
[8] => 1
[grade] => 1
[9] => 1
[raw_grade] => 1
[10] => 0.1
[penalty] => 0.1
[11] => 0.0
[sumpenalty] => 0.0
[responses] => Array
(
[] => 20217
)
[changed] =>
[options] => stdClass Object
(
[order] => Array
(
[0] => 20216
[1] => 20213
[2] => 20214
[3] => 20215
[4] => 20217
)
[question] => stdClass Object
(
[0] => 9768
[id] => 9768
[1] => 621
[category] => 621
[2] => 0
[parent] => 0
[3] => 13. (7.0 × 106)/(2.0 × 10-6)=
[name] => 13. (7.0 × 106)/(2.0 × 10-6)=
[4] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[questiontext] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[5] => 1
[questiontextformat] => 1
[6] =>
[image] =>
[7] => 1
[defaultgrade] => 1
[8] => 0.1
[penalty] => 0.1
[9] => 3
[qtype] => 3
[10] => 1
[length] => 1
[11] => moodle.fct.unl.pt+060305202237+vwz4EM
[stamp] => moodle.fct.unl.pt+060305202237+vwz4EM
[12] => 4
[version] => 4
[13] => 0
[hidden] => 0
[options] => stdClass Object
(
[0] => 6229
[id] => 6229
[1] => 9768
[question] => 9768
[2] => 0
[layout] => 0
[3] => 27611,27612,27613,27614,27615
[answers] => Array
(
[27611] => stdClass Object
(
[id] => 27611
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 12}$$
[answer] => $$3.5 \times 10^{ - 12}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27612] => stdClass Object
(
[id] => 27612
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 6}$$
[answer] => $$3.5 \times 10^{ - 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27613] => stdClass Object
(
[id] => 27613
[0] => 9768
[question] => 9768
[1] => 3.5
[answer] => 3.5
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27614] => stdClass Object
(
[id] => 27614
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 6}$$
[answer] => $$3.5 \times 10^{ 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27615] => stdClass Object
(
[id] => 27615
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 12}$$
[answer] => $$3.5 \times 10^{ 12}$$
[2] => 1
[fraction] => 1
[3] =>
[feedback] =>
)
)
[4] => 1
[single] => 1
)
[name_prefix] => resp9793_
[maxgrade] => 1
)
)
)
)
From Tim Hunt (T.J.Hunt at open.ac.uk) Wednesday, 7 June 2006, 01:14 AM:
Paulo,
Sorry, no hints. I am still very new to this, and I suspect you now understand this part of the code better than me.
It's really great that you are investigating this, and I hope your efforts are rewarded.
From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 22 June 2006, 09:07 AM:
Hi folks!
Good news, seems that I finally get arround this one!!!
The problem with random questions was that at restore time, parent field was not recoded at all on quiz_restore_questions(), and before calling quiz_recode_state_answer_field() recursively the $wrappedquestion was not set correctly.
I tested intensively this procedure with a lot of quiz attempts, all types of questions, however I had no questions of type
random+('MATCH' or 'RANDOMSAMATCH'), but they were afected for sure.
After all this work, I realized I had to do it by hand for some quizzes because they had new attempts (oh dear murphy ...
).
I forgot to mention the number of states involved on the big restore operation, just 507149.
See the new version of restorelib.php and give it a try!
Regards,
Paulo Matos
From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 22 June 2006, 09:21 AM:
Just upload the patch for those who want to see the differences between versions. Just +10 and -1 lines of code make the difference.
If someone could take the time to merge this it would be great.
Cheers,
Paulo Matos
From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 11 May 2006, 11:00 PM:
I took the liberty of adding the people involved so far in this issue. Hope my numbers can provide some trust for a code commit.
Last but not least thanks Julian: you save my day.
From Eloy Lafuente (stronk7 at moodle.org) Thursday, 11 May 2006, 11:54 PM:
IMO it will be really great to have attempts working on 1.5.4!
If somebody can check the patch (it's a huge one) works as expected (bug 3159)... I'm really out of time now
Thanks Paulo!
From Eloy Lafuente (stronk7 at moodle.org) Thursday, 11 May 2006, 11:54 PM:
Adding the boss here too!
From Gustav Delius (gwd2 at york.ac.uk) Friday, 12 May 2006, 02:27 PM:
I think it is highly unlikely that we can afford the manpower to implement this in 1.5.4. I do remember looking at the code when doing the restore for 1.6 and felt that it was not stable enough to go into Moodle 1.5. I think we have to devote our efforts to testing the restore code in 1.6 more before contemplating backporting it to 1.5.4.
From Eloy Lafuente (stronk7 at moodle.org) Friday, 12 May 2006, 05:21 PM:
Aha. That's another interesting path, backporting 1.6 restore code to 1.5.x... if the patch attached here doesn't suit your requirements for 1.5.x... nothing against it from me, of course.
Ciao
From Paulo Matos (paulo.matos at fct.unl.pt) Wednesday, 24 May 2006, 09:53 PM:
Well, as promissed here are some bug we found out:
Error: Missing question options! (multichoice)
Can someone give me a hint where to look?
I put a testcase that is too big to be attached here:
http://moodle.fct.unl.pt/bug_report/
TIA. Paulo.
From Gustav Delius (gwd2 at york.ac.uk) Friday, 26 May 2006, 05:12 PM:
Paulo, thanks for your help with testing the restore code. Tim has now taken over maintenance of the question engine and I am assigning this bug to him.
From Paulo Matos (paulo.matos at fct.unl.pt) Friday, 26 May 2006, 09:58 PM:
Ok Delius! Tim, I'm willing to help to solve this issue, just too complicated to get it done without help in a reasonable amount of time. Don't hesitate in contact me. As I said before I experiencied an overall disk crash, I have a huge pressure to solve this issue.
Keep the good work guys.
Paulo.
From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 1 June 2006, 06:37 AM:
Tim, any hints on this?
From Paulo Matos (paulo.matos at fct.unl.pt) Tuesday, 6 June 2006, 02:35 AM:
I think I found the problem... options order are not recoded to the new IDs, as you can see bellow ($states[$i] for a single question)
$states->options->order is incorrect, as well as $states->seq_number...
I manage to see that the options reach the correct print_question_formulation_and_controls() function but as the order is incorrect it prints nothing....
Can now someone give me a small hint where to dig on??
Regards,
Paulo
Bellow is an smaple output of $states for a question while reviewing an attempt (mod/quiz/review.php?q=617&attempt=15581)
------------------------------------------------ STATES --------------------------------
stdClass Object
(
[question] => 9793
[0] => 251594
[id] => 251594
[1] => 15581
[attempt] => 15581
[2] => 9793
[3] => 0
[originalquestion] => 0
[4] => 2
[seq_number] => 2
[5] => random9768-20216,20213,20214,20215,20217:20217
[6] => 1141912664
[timestamp] => 1141912664
[7] => 6
[event] => 6
[8] => 1
[grade] => 1
[9] => 1
[raw_grade] => 1
[10] => 0.1
[penalty] => 0.1
[11] => 0.0
[sumpenalty] => 0.0
[responses] => Array
(
[] => 20217
)
[changed] =>
[options] => stdClass Object
(
[order] => Array
(
[0] => 20216
[1] => 20213
[2] => 20214
[3] => 20215
[4] => 20217
)
[question] => stdClass Object
(
[0] => 9768
[id] => 9768
[1] => 621
[category] => 621
[2] => 0
[parent] => 0
[3] => 13. (7.0 × 106)/(2.0 × 10-6)=
[name] => 13. (7.0 × 106)/(2.0 × 10-6)=
[4] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[questiontext] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[5] => 1
[questiontextformat] => 1
[6] =>
[image] =>
[7] => 1
[defaultgrade] => 1
[8] => 0.1
[penalty] => 0.1
[9] => 3
[qtype] => 3
[10] => 1
[length] => 1
[11] => moodle.fct.unl.pt+060305202237+vwz4EM
[stamp] => moodle.fct.unl.pt+060305202237+vwz4EM
[12] => 4
[version] => 4
[13] => 0
[hidden] => 0
[options] => stdClass Object
(
[0] => 6229
[id] => 6229
[1] => 9768
[question] => 9768
[2] => 0
[layout] => 0
[3] => 27611,27612,27613,27614,27615
[answers] => Array
(
[27611] => stdClass Object
(
[id] => 27611
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 12}$$
[answer] => $$3.5 \times 10^{ - 12}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27612] => stdClass Object
(
[id] => 27612
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 6}$$
[answer] => $$3.5 \times 10^{ - 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27613] => stdClass Object
(
[id] => 27613
[0] => 9768
[question] => 9768
[1] => 3.5
[answer] => 3.5
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27614] => stdClass Object
(
[id] => 27614
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 6}$$
[answer] => $$3.5 \times 10^{ 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27615] => stdClass Object
(
[id] => 27615
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 12}$$
[answer] => $$3.5 \times 10^{ 12}$$
[2] => 1
[fraction] => 1
[3] =>
[feedback] =>
)
[20216] =>
[20213] =>
[20214] =>
[20215] =>
[20217] =>
)
[4] => 1
[single] => 1
)
[name_prefix] => resp9793_
[maxgrade] => 1
)
)
[last_graded] => stdClass Object
(
[question] => 9793
[0] => 251594
[id] => 251594
[1] => 15581
[attempt] => 15581
[2] => 9793
[3] => 0
[originalquestion] => 0
[4] => 2
[seq_number] => 2
[5] => random9768-20216,20213,20214,20215,20217:20217
[6] => 1141912664
[timestamp] => 1141912664
[7] => 6
[event] => 6
[8] => 1
[grade] => 1
[9] => 1
[raw_grade] => 1
[10] => 0.1
[penalty] => 0.1
[11] => 0.0
[sumpenalty] => 0.0
[responses] => Array
(
[] => 20217
)
[changed] =>
[options] => stdClass Object
(
[order] => Array
(
[0] => 20216
[1] => 20213
[2] => 20214
[3] => 20215
[4] => 20217
)
[question] => stdClass Object
(
[0] => 9768
[id] => 9768
[1] => 621
[category] => 621
[2] => 0
[parent] => 0
[3] => 13. (7.0 × 106)/(2.0 × 10-6)=
[name] => 13. (7.0 × 106)/(2.0 × 10-6)=
[4] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[questiontext] => $$
\frac{{7.0 \times 10^6 }}
{{2.0 \times 10^{ - 6} }} =
$$
[5] => 1
[questiontextformat] => 1
[6] =>
[image] =>
[7] => 1
[defaultgrade] => 1
[8] => 0.1
[penalty] => 0.1
[9] => 3
[qtype] => 3
[10] => 1
[length] => 1
[11] => moodle.fct.unl.pt+060305202237+vwz4EM
[stamp] => moodle.fct.unl.pt+060305202237+vwz4EM
[12] => 4
[version] => 4
[13] => 0
[hidden] => 0
[options] => stdClass Object
(
[0] => 6229
[id] => 6229
[1] => 9768
[question] => 9768
[2] => 0
[layout] => 0
[3] => 27611,27612,27613,27614,27615
[answers] => Array
(
[27611] => stdClass Object
(
[id] => 27611
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 12}$$
[answer] => $$3.5 \times 10^{ - 12}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27612] => stdClass Object
(
[id] => 27612
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ - 6}$$
[answer] => $$3.5 \times 10^{ - 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27613] => stdClass Object
(
[id] => 27613
[0] => 9768
[question] => 9768
[1] => 3.5
[answer] => 3.5
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27614] => stdClass Object
(
[id] => 27614
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 6}$$
[answer] => $$3.5 \times 10^{ 6}$$
[2] => 0
[fraction] => 0
[3] =>
[feedback] =>
)
[27615] => stdClass Object
(
[id] => 27615
[0] => 9768
[question] => 9768
[1] => $$3.5 \times 10^{ 12}$$
[answer] => $$3.5 \times 10^{ 12}$$
[2] => 1
[fraction] => 1
[3] =>
[feedback] =>
)
)
[4] => 1
[single] => 1
)
[name_prefix] => resp9793_
[maxgrade] => 1
)
)
)
)
From Tim Hunt (T.J.Hunt at open.ac.uk) Wednesday, 7 June 2006, 01:14 AM:
Paulo,
Sorry, no hints. I am still very new to this, and I suspect you now understand this part of the code better than me.
It's really great that you are investigating this, and I hope your efforts are rewarded.
From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 22 June 2006, 09:07 AM:
Hi folks!
Good news, seems that I finally get arround this one!!!
The problem with random questions was that at restore time, parent field was not recoded at all on quiz_restore_questions(), and before calling quiz_recode_state_answer_field() recursively the $wrappedquestion was not set correctly.
I tested intensively this procedure with a lot of quiz attempts, all types of questions, however I had no questions of type
random+('MATCH' or 'RANDOMSAMATCH'), but they were afected for sure.
After all this work, I realized I had to do it by hand for some quizzes because they had new attempts (oh dear murphy ...
).
I forgot to mention the number of states involved on the big restore operation, just 507149.
See the new version of restorelib.php and give it a try!
Regards,
Paulo Matos
From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 22 June 2006, 09:21 AM:
Just upload the patch for those who want to see the differences between versions. Just +10 and -1 lines of code make the difference.
If someone could take the time to merge this it would be great.
Cheers,
Paulo Matos
- In several places, namely while diplaying item analisys I got:
Error: Missing question options! (multichoice) Can someone give me a hint where to look? I put a testcase that is too big to be attached here: http://moodle.fct.unl.pt/bug_report/ TIA. Paulo. From Gustav Delius (gwd2 at york.ac.uk) Friday, 26 May 2006, 05:12 PM: Paulo, thanks for your help with testing the restore code. Tim has now taken over maintenance of the question engine and I am assigning this bug to him. From Paulo Matos (paulo.matos at fct.unl.pt) Friday, 26 May 2006, 09:58 PM: Ok Delius! Tim, I'm willing to help to solve this issue, just too complicated to get it done without help in a reasonable amount of time. Don't hesitate in contact me. As I said before I experiencied an overall disk crash, I have a huge pressure to solve this issue. Keep the good work guys. Paulo. From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 1 June 2006, 06:37 AM: Tim, any hints on this? From Paulo Matos (paulo.matos at fct.unl.pt) Tuesday, 6 June 2006, 02:35 AM: I think I found the problem... options order are not recoded to the new IDs, as you can see bellow ($states[$i] for a single question) $states->options->order is incorrect, as well as $states->seq_number... I manage to see that the options reach the correct print_question_formulation_and_controls() function but as the order is incorrect it prints nothing.... Can now someone give me a small hint where to dig on?? Regards, Paulo Bellow is an smaple output of $states for a question while reviewing an attempt (mod/quiz/review.php?q=617&attempt=15581) ------------------------------------------------ STATES -------------------------------- stdClass Object ( [question] => 9793 [0] => 251594 [id] => 251594 [1] => 15581 [attempt] => 15581 [2] => 9793 [3] => 0 [originalquestion] => 0 [4] => 2 [seq_number] => 2 [5] => random9768-20216,20213,20214,20215,20217:20217 [6] => 1141912664 [timestamp] => 1141912664 [7] => 6 [event] => 6 [8] => 1 [grade] => 1 [9] => 1 [raw_grade] => 1 [10] => 0.1 [penalty] => 0.1 [11] => 0.0 [sumpenalty] => 0.0 [responses] => Array ( [] => 20217 ) [changed] => [options] => stdClass Object ( [order] => Array ( [0] => 20216 [1] => 20213 [2] => 20214 [3] => 20215 [4] => 20217 ) [question] => stdClass Object ( [0] => 9768 [id] => 9768 [1] => 621 [category] => 621 [2] => 0 [parent] => 0 [3] => 13. (7.0 × 106)/(2.0 × 10-6)= [name] => 13. (7.0 × 106)/(2.0 × 10-6)= [4] => $$ \frac{{7.0 \times 10^6 }} {{2.0 \times 10^{ - 6} }} = $$ [questiontext] => $$ \frac{{7.0 \times 10^6 }} {{2.0 \times 10^{ - 6} }} = $$ [5] => 1 [questiontextformat] => 1 [6] => [image] => [7] => 1 [defaultgrade] => 1 [8] => 0.1 [penalty] => 0.1 [9] => 3 [qtype] => 3 [10] => 1 [length] => 1 [11] => moodle.fct.unl.pt+060305202237+vwz4EM [stamp] => moodle.fct.unl.pt+060305202237+vwz4EM [12] => 4 [version] => 4 [13] => 0 [hidden] => 0 [options] => stdClass Object ( [0] => 6229 [id] => 6229 [1] => 9768 [question] => 9768 [2] => 0 [layout] => 0 [3] => 27611,27612,27613,27614,27615 [answers] => Array ( [27611] => stdClass Object ( [id] => 27611 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ - 12}$$ [answer] => $$3.5 \times 10^{ - 12}$$ [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27612] => stdClass Object ( [id] => 27612 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ - 6}$$ [answer] => $$3.5 \times 10^{ - 6}$$ [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27613] => stdClass Object ( [id] => 27613 [0] => 9768 [question] => 9768 [1] => 3.5 [answer] => 3.5 [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27614] => stdClass Object ( [id] => 27614 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ 6}$$ [answer] => $$3.5 \times 10^{ 6}$$ [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27615] => stdClass Object ( [id] => 27615 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ 12}$$ [answer] => $$3.5 \times 10^{ 12}$$ [2] => 1 [fraction] => 1 [3] => [feedback] => ) [20216] => [20213] => [20214] => [20215] => [20217] => ) [4] => 1 [single] => 1 ) [name_prefix] => resp9793_ [maxgrade] => 1 ) ) [last_graded] => stdClass Object ( [question] => 9793 [0] => 251594 [id] => 251594 [1] => 15581 [attempt] => 15581 [2] => 9793 [3] => 0 [originalquestion] => 0 [4] => 2 [seq_number] => 2 [5] => random9768-20216,20213,20214,20215,20217:20217 [6] => 1141912664 [timestamp] => 1141912664 [7] => 6 [event] => 6 [8] => 1 [grade] => 1 [9] => 1 [raw_grade] => 1 [10] => 0.1 [penalty] => 0.1 [11] => 0.0 [sumpenalty] => 0.0 [responses] => Array ( [] => 20217 ) [changed] => [options] => stdClass Object ( [order] => Array ( [0] => 20216 [1] => 20213 [2] => 20214 [3] => 20215 [4] => 20217 ) [question] => stdClass Object ( [0] => 9768 [id] => 9768 [1] => 621 [category] => 621 [2] => 0 [parent] => 0 [3] => 13. (7.0 × 106)/(2.0 × 10-6)= [name] => 13. (7.0 × 106)/(2.0 × 10-6)= [4] => $$ \frac{{7.0 \times 10^6 }} {{2.0 \times 10^{ - 6} }} = $$ [questiontext] => $$ \frac{{7.0 \times 10^6 }} {{2.0 \times 10^{ - 6} }} = $$ [5] => 1 [questiontextformat] => 1 [6] => [image] => [7] => 1 [defaultgrade] => 1 [8] => 0.1 [penalty] => 0.1 [9] => 3 [qtype] => 3 [10] => 1 [length] => 1 [11] => moodle.fct.unl.pt+060305202237+vwz4EM [stamp] => moodle.fct.unl.pt+060305202237+vwz4EM [12] => 4 [version] => 4 [13] => 0 [hidden] => 0 [options] => stdClass Object ( [0] => 6229 [id] => 6229 [1] => 9768 [question] => 9768 [2] => 0 [layout] => 0 [3] => 27611,27612,27613,27614,27615 [answers] => Array ( [27611] => stdClass Object ( [id] => 27611 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ - 12}$$ [answer] => $$3.5 \times 10^{ - 12}$$ [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27612] => stdClass Object ( [id] => 27612 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ - 6}$$ [answer] => $$3.5 \times 10^{ - 6}$$ [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27613] => stdClass Object ( [id] => 27613 [0] => 9768 [question] => 9768 [1] => 3.5 [answer] => 3.5 [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27614] => stdClass Object ( [id] => 27614 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ 6}$$ [answer] => $$3.5 \times 10^{ 6}$$ [2] => 0 [fraction] => 0 [3] => [feedback] => ) [27615] => stdClass Object ( [id] => 27615 [0] => 9768 [question] => 9768 [1] => $$3.5 \times 10^{ 12}$$ [answer] => $$3.5 \times 10^{ 12}$$ [2] => 1 [fraction] => 1 [3] => [feedback] => ) ) [4] => 1 [single] => 1 ) [name_prefix] => resp9793_ [maxgrade] => 1 ) ) ) ) From Tim Hunt (T.J.Hunt at open.ac.uk) Wednesday, 7 June 2006, 01:14 AM: Paulo, Sorry, no hints. I am still very new to this, and I suspect you now understand this part of the code better than me. It's really great that you are investigating this, and I hope your efforts are rewarded. From Paulo Matos (paulo.matos at fct.unl.pt) Thursday, 22 June 2006, 09:07 AM: Hi folks! Good news, seems that I finally get arround this one!!! The problem with random questions was that at restore time, parent field was not recoded at all on quiz_restore_questions(), and before calling quiz_recode_state_answer_field() recursively the $wrappedquestion was not set correctly. I tested intensively this procedure with a lot of quiz attempts, all types of questions, however I had no questions of type random+('MATCH' or 'RANDOMSAMATCH'), but they were afected for sure. After all this work, I realized I had to do it by hand for some quizzes because they had new attempts (oh dear murphy ...