Recode qtypes during restore of old backups.

This commit is contained in:
gustav_delius
2006-03-22 10:32:29 +00:00
parent 9b908126b9
commit ea889e7744
+8
View File
@@ -192,6 +192,14 @@
$question->version = backup_todb($que_info['#']['VERSION']['0']['#']);
$question->hidden = backup_todb($que_info['#']['HIDDEN']['0']['#']);
if ($restore->backup_version < 2006032200) {
// The qtype was an integer that now needs to be converted to the name
$qtypenames = array(1=>'shortanswer',2=>'truefalse',3=>'multichoice',4=>'random',5=>'match',
6=>'randomsamatch',7=>'description',8=>'numerical',9=>'multianswer',10=>'calculated',
11=>'rqp',12=>'essay');
$question->qtype = $qtypenames[$question->qtype];
}
////We have to recode the parent field
// This should work alright because we ordered the questions appropriately during backup so that
// questions that can be parents are restored first