Below is How our programmer resolved this problem.
Hi! Chad, To answer your question I have narrowed the restore problems down to a couple of issues. First considering all quiz's and questions are in the database and not missing the following code hack seems to afford the restore procedure a better chance of restoring an archived course and it contents. Affects file: ./question/restorelib.php Code Line 649-656 //We have to recode the answer field //It depends of the question type !! //We get the question first if (!$question = get_record("question","id",$state->question)) { echo 'The record for question '.$state->question.' is missing!
'; echo 'Check database table _question for id='.$state->question.'
'; continue; // Don't let this stop us from our course restore. I have also recently been working with another issue which happens only when one attempts to restore a quiz which is actually missing questions in the questions table. With the restore library the main issue is quizzes in general which always seem to break the restore if everything is not just peachy perfect. I have experimented with changes to function question_make_default_categories($contexts) where a condition exists that $context->contextlevel is actually null which will throw the restore error "This is an unknown context () in print_context_name!" which is generated from lib/accesslib.php function print_context_name. The trick is here is to always insure the $context->contextlevel is not null but rather checked and set to a value during the restore process.