Some work on question restore code, not complete

This commit is contained in:
gustav_delius 2006-03-13 00:18:38 +00:00
parent d348b6f2b0
commit 12fcd27da6
5 changed files with 154 additions and 3148 deletions

View file

@ -44,4 +44,30 @@
return $status;
}
//This function restores the question_essay_states
function question_essay_states_restore($state_id,$info,$restore) {
global $CFG;
$status = true;
//Get the question_essay_state
$essay_state = $info['#']['ESSAY_STATE']['0'];
if ($essay_state) {
//Now, build the ESSAY_STATES record structure
$state->stateid = $state_id;
$state->graded = backup_todb($essay_state['#']['GRADED']['0']['#']);
$state->fraction = backup_todb($essay_state['#']['FRACTION']['0']['#']);
$state->response = backup_todb($essay_state['#']['RESPONSE']['0']['#']);
//The structure is equal to the db, so insert the question_states
$newid = insert_record ("question_essay_states",$state);
}
return $status;
}
?>

View file

@ -44,4 +44,30 @@
return $status;
}
//This function restores the question_rqp_states
function question_rqp_states_restore($state_id,$info,$restore) {
global $CFG;
$status = true;
//Get the question_rqp_state
$rqp_state = $info['#']['RQP_STATE']['0'];
if ($rqp_state) {
//Now, build the RQP_STATES record structure
$state->stateid = $state_id;
$state->responses = backup_todb($rqp_state['#']['RESPONSES']['0']['#']);
$state->persistent_data = backup_todb($rqp_state['#']['PERSISTENT_DATA']['0']['#']);
$state->template_vars = backup_todb($rqp_state['#']['TEMPLATE_VARS']['0']['#']);
//The structure is equal to the db, so insert the question_states
$newid = insert_record ("question_rqp_states",$state);
}
return $status;
}
?>

File diff suppressed because it is too large Load diff