upgrading from m1.5.3+ to 1.6.1+: blank results on archived quizzes

upgrading from m1.5.3+ to 1.6.1+: blank results on archived quizzes

by Luca Arese -
Number of replies: 5

Hi to everyone,

I'm testing the upgrade from m1.5.3+ to 1.6.1+ on a replica of the production environment.

Everything runs fine, but after all, in courses where i had quizzies with answers (archived quizzes) the report on a singel quiz doesn't show the results (students archived answers). In other words, it "loose" the information about the grades, so i can see the final vote of students but can't reconstruct their quiz/answers. This problem is blocking the whole upgrade session, cause i will be killed by the teachers if something will be incomplete.

Hoping to know if there's some way to patch the situation...

Luca

Average of ratings: -
In reply to Luca Arese

Re: upgrading from m1.5.3+ to 1.6.1+: blank results on archived quizzes

by Makalo Motsamai -

Hi Luca,

What is actualy missing after the upgrade is your question bank. Try to look under the quiz to find the questions you'll notice that there's nothing.

However, you are not the only one having that problem. I've also delayed upgrading for the same reason.

I hope Joseph and the others will look into this problem and provide us with better solution.

Rgrds,

Makalo

In reply to Makalo Motsamai

Re: upgrading from m1.5.3+ to 1.6.1+: blank results on archived quizzes

by Luca Arese -

I'll retry today to simulate the upgrade, using the new release 1.6.2:

I got the same error (quiz attempts are blank) described in my previous message, but this time i'll copy the error lines during the database upgrade process:

1062: Duplicate entry '0' for key 2

            ADOConnection._Execute(ALTER TABLE mdl_quiz_attempts ADD UNIQUE INDEX uniqueid (uniqueid), false) % line  853, file: adodb.inc.php
         ADOConnection.Execute(ALTER TABLE mdl_quiz_attempts ADD UNIQUE INDEX uniqueid (uniqueid)) % line   49, file: datalib.php
      execute_sql(ALTER TABLE mdl_quiz_attempts ADD UNIQUE INDEX uniqueid (uniqueid)) % line  193, file: datalib.php
   modify_database(, ALTER TABLE prefix_quiz_attempts ADD UNIQUE INDEX uniqueid (uniqueid);) % line  900, file: mysql.php
quiz_upgrade(2005100500, Object:stdClass) % line  195, file: adminlib.php
Error

 

May be someone can understand which kind of error is...

Bye

Luca

In reply to Luca Arese

Re: upgrading from m1.5.3+ to 1.6.1+: blank results on archived quizzes

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This error relates to the the quiz_attempts table, in particular to the uniqueid column.

As the name suggests, each row of the table should have a different (unique) number in this column.

The error message is saying that before you start the upgrade, that is not true in your databse. Indeed, it is saying that two (or more) of the rows have a zero here. It aslo says that this error was triggered by line 900 of mod/quiz/db/mysql.php.

You will probably find that for most, if not all rows in you table, uniqueid and id will be the same (if uniqueid is not 0).

You can test this by doing

SELECT * from mdl_quiz_attempts WHERE uniqueid != id;

If this only returns rows where uniqueid is 0, then it is safe to run

UPDATE mdl_quiz_attempts SET uniqueid = id WHERE uniqueid = 0;

(This should already have been done by 868 of mod/quiz/db/mysql.php)

Then the upgrade might work for you.
In reply to Tim Hunt

Re: upgrading from m1.5.3+ to 1.6.1+: blank results on archived quizzes

by douglas Reith -
A somewhat related question:

Should uniqueid and id always be the same in the quiz_attempts table?
In reply to douglas Reith

Re: upgrading from m1.5.3+ to 1.6.1+: blank results on archived quizzes

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Not necessarily, but in practice it almost always is.