moodle 2.1 and mdl_questions_session

moodle 2.1 and mdl_questions_session

by John Wells -
Number of replies: 5

Based on http://docs.moodle.org/20/en/Upgrading_to_Moodle_2.1 it appears I may need to truncate the table mdl_questions_session before applying the 2.1 upgrade.

 

Currently, the table has 1.4 million entries.  What are the implications if I empty it entirely?  It is my understanding that it stores quiz attempts history.  If so, and our site users are at a stopping point between semesters, dropping the old data should be harmless...?  Yes/no???

 

Thanks in advance for your help. smile

Average of ratings: -
In reply to John Wells

Re: moodle 2.1 and mdl_questions_session

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Do you need the data about the old quiz attempts? If you don't need that data any more then yes, the upgrade will be much quicker if you do your housekeeping before you upgrade.

However, just truncating questions_session would be a bad idea.

The safe way to throw away the old quiz attempt data is to go into each course and use the course reset feature to delete the old quiz attempts (how many courses do you have? You might be able to automate it with a simple PHP script.)

If you want a quick-and-dirty approach, and you really want to throw away every quiz attempt in your whole system, I think you need to truncate all of

  • question_states
  • question_sessions
  • question_attempts
  • quiz_attempts
  • quiz_grades

Or, if you like, you can just upgrade it all. It will probably take a few hours.

In reply to Tim Hunt

Re: moodle 2.1 and mdl_questions_session

by William Beazley -

Tim,

Will this reset also release quizzes to be edited?  My quizzes are really for practice and I need to edit (to correct) their questions as I find erros.  Im prevented from doing that by the fact that quizzes have atempts.

BIll

In reply to William Beazley

Re: moodle 2.1 and mdl_questions_session

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you want to edit the quiz, you need to delete all the user attempts first. The easiest way to do that is to go to the quiz reports and do Select all, then Delete selected attempts.

In reply to Tim Hunt

Re: moodle 2.1 and mdl_questions_session

by John Wells -

We have 1,508 quizzes as of this morning.

When I announced the moodle 2.0 upgrade window, one of the things I made clear was that all logs would be reset and that every instructor had to finalize their courses such that all cedit had been calculated and awarded.

I can justify ditching the session history under that pronouncement, but I wanted to know if it was safe to do so in the same fashion as TRUNCATE mdl_log;.  Will TRUNCATE mdl_questions_session have any ill effects other than losing the history for all quizzes?

 

Thanks in advance for the help. smile

In reply to John Wells

Re: moodle 2.1 and mdl_questions_session

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Do you want to keep thinks like grades in the gradebook. If so, I would not recommend deleting the response data from the quiz. It would be very dangerous. Anything like re-grading would then distroy the grades in the gradebook.

Since you seem to be in the middle of a summer break, it sounds like it would not matter if your Moodle site was offline for some hours. Therefore, the safest thing would just be to upgrade everything, and don't worry about how long it takes.