Note:

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

Questiontype backup restore: Difference between revisions

From MoodleDocs
No edit summary
 
No edit summary
 
Line 2: Line 2:
{{Questiontype class}}
{{Questiontype class}}
==Functions related to backup and restore==
==Functions related to backup and restore==
first draw [[User:Pierre Pichet|Pierre Pichet]] 10:45, 17 March 2007 (CDT)
/// BACKUP FUNCTIONS ////////////////////////////
/// BACKUP FUNCTIONS ////////////////////////////



Latest revision as of 15:45, 17 March 2007

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;
   }