Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Questiontype backup restore

From MoodleDocs

Functions related to backup and restore

first draw Pierre Pichet 10:45, 17 March 2007 (CDT) /// BACKUP FUNCTIONS ////////////////////////////

   /*
    * Backup the data in the question
    *
    * This is used in question/backuplib.php
    */
   function backup($bf,$preferences,$question,$level=6) {
       // The default type has nothing to back up
       return true;
   }

/// RESTORE FUNCTIONS /////////////////

   /*
    * Restores the data in the question
    *
    * This is used in question/restorelib.php
    */
   function restore($old_question_id,$new_question_id,$info,$restore) {
       // The default question type has nothing to restore
       return true;
   }
   function restore_map($old_question_id,$new_question_id,$info,$restore) {
       // There is nothing to decode
       return true;
   }
   function restore_recode_answer($state, $restore) {
       // There is nothing to decode
       return $state->answer;
   }
   //This function restores the question_rqp_states
   function restore_state($state_id,$info,$restore) {
       // The default question type does not keep its own state information
       return true;
   }