fwrite ($bf,full_tag('OPTIONS',4,false,$scorm->options));
fwrite ($bf,full_tag('WIDTH',4,false,$scorm->width));
fwrite ($bf,full_tag('HEIGHT',4,false,$scorm->height));
- fwrite ($bf,full_tag('MD5HASH',4,false,$scorm->md5hash));
- fwrite ($bf,full_tag("MAXATTEMPT",4,false,$scorm->maxattempt));
- fwrite ($bf,full_tag("UPDATEFREQ",4,false,$scorm->updatefreq));
+ fwrite ($bf,full_tag('MD5HASH',4,false,$scorm->md5hash));
+ fwrite ($bf,full_tag("MAXATTEMPT",4,false,$scorm->maxattempt));
+ fwrite ($bf,full_tag("UPDATEFREQ",4,false,$scorm->updatefreq));
fwrite ($bf,full_tag('TIMEMODIFIED',4,false,$scorm->timemodified));
$status = backup_scorm_scoes($bf,$preferences,$scorm->id);
fwrite ($bf,full_tag('SCORMTYPE',6,false,$sco->scormtype));
fwrite ($bf,full_tag('TITLE',6,false,$sco->title));
$status = backup_scorm_scoes_data($bf,$preferences,$sco->id);
- $status = backup_scorm_seq_ruleconds($bf,$preferences,$sco->id);
- $status = backup_scorm_seq_rolluprule($bf,$preferences,$sco->id);
- $status = backup_scorm_seq_objective($bf,$preferences,$sco->id);
+ $status = backup_scorm_seq_ruleconds($bf,$preferences,$sco->id);
+ $status = backup_scorm_seq_rolluprule($bf,$preferences,$sco->id);
+ $status = backup_scorm_seq_objective($bf,$preferences,$sco->id);
//End sco
$status =fwrite ($bf,end_tag('SCO',5,true));
}
$status =fwrite ($bf,start_tag('SCO_DATA',5,true));
//Print track contents
fwrite ($bf,full_tag('ID',6,false,$sco_data->id));
- fwrite ($bf,full_tag('SCOID',6,false,$sco_data->scoid));
+ fwrite ($bf,full_tag('SCOID',6,false,$sco_data->scoid));
fwrite ($bf,full_tag('NAME',6,false,$sco_data->name));
fwrite ($bf,full_tag('VALUE',6,false,$sco_data->value));
//End sco track
fwrite ($bf,full_tag('SCOID',6,false,$sco_track->scoid));
fwrite ($bf,full_tag('ELEMENT',6,false,$sco_track->element));
fwrite ($bf,full_tag('VALUE',6,false,$sco_track->value));
- fwrite ($bf,full_tag('ATTEMPT',6,false,$sco_track->attempt));
- fwrite ($bf,full_tag('TIMEMODIFIED',6,false,$sco_track->timemodified));
+ fwrite ($bf,full_tag('ATTEMPT',6,false,$sco_track->attempt));
+ fwrite ($bf,full_tag('TIMEMODIFIED',6,false,$sco_track->timemodified));
//End sco track
$status =fwrite ($bf,end_tag('SCO_TRACK',5,true));
}
fwrite ($bf,full_tag('SCOID',6,false,$seq_rulecondition->scoid));
fwrite ($bf,full_tag('CONDITIONCOMBINATION',6,false,$seq_rulecondition->conditioncombination));
fwrite ($bf,full_tag('RULETYPE',6,false,$seq_rulecondition->ruletype));
- fwrite ($bf,full_tag('ACTION',6,false,$seq_rulecondition->action));
-
- $status = backup_scorm_seq_rulecond($bf,$preferences,$seq_rulecondition->id);
+ fwrite ($bf,full_tag('ACTION',6,false,$seq_rulecondition->action));
+
+ $status = backup_scorm_seq_rulecond($bf,$preferences,$seq_rulecondition->id);
//End sco track
$status =fwrite ($bf,end_tag('SEQ_RULECOND',5,true));
}
}
- function backup_scorm_seq_rulecond ($bf,$preferences,$ruleconditions) {
+ function backup_scorm_seq_rulecond ($bf,$preferences,$ruleconditions) {
global $CFG;
fwrite ($bf,full_tag('SCOID',6,false,$seq_rulecondition->scoid));
fwrite ($bf,full_tag('RULECONDITIONSID',6,false,$seq_rulecondition->ruleconditionsid));
fwrite ($bf,full_tag('REFRENCEDOBJECTIVE',6,false,$seq_rulecondition->refrencedobjective));
- fwrite ($bf,full_tag('MEASURETHRESHOLD',6,false,$seq_rulecondition->measurethreshold));
- fwrite ($bf,full_tag('OPERATOR',6,false,$seq_rulecondition->operator));
- fwrite ($bf,full_tag('COND',6,false,$seq_rulecondition->cond));
+ fwrite ($bf,full_tag('MEASURETHRESHOLD',6,false,$seq_rulecondition->measurethreshold));
+ fwrite ($bf,full_tag('OPERATOR',6,false,$seq_rulecondition->operator));
+ fwrite ($bf,full_tag('COND',6,false,$seq_rulecondition->cond));
//End sco track
$status =fwrite ($bf,end_tag('SEQ_RULECOND_DATA',5,true));
}
return $status;
}
- function backup_scorm_seq_rolluprule ($bf,$preferences,$sco) {
+ function backup_scorm_seq_rolluprule ($bf,$preferences,$sco) {
global $CFG;
fwrite ($bf,full_tag('ID',6,false,$seq_rolluprule->id));
fwrite ($bf,full_tag('SCOID',6,false,$seq_rolluprule->scoid));
fwrite ($bf,full_tag('CHILDACTIVITYSET',6,false,$seq_rolluprule->childactivityset));
- fwrite ($bf,full_tag('MINIMUMCOUNT',6,false,$seq_rolluprule->minimumcount));
- fwrite ($bf,full_tag('MINIMUMPERCENT',6,false,$seq_rolluprule->minimumpercent));
- fwrite ($bf,full_tag('CONDITIONCOMBINATION',6,false,$seq_rolluprule->conditioncomnination));
- fwrite ($bf,full_tag('ACTION',6,false,$seq_rolluprule->action));
- $status = backup_scorm_seq_rolluprulecond($bf,$preferences,$seq_rolluprule->id);
+ fwrite ($bf,full_tag('MINIMUMCOUNT',6,false,$seq_rolluprule->minimumcount));
+ fwrite ($bf,full_tag('MINIMUMPERCENT',6,false,$seq_rolluprule->minimumpercent));
+ fwrite ($bf,full_tag('CONDITIONCOMBINATION',6,false,$seq_rolluprule->conditioncomnination));
+ fwrite ($bf,full_tag('ACTION',6,false,$seq_rolluprule->action));
+ $status = backup_scorm_seq_rolluprulecond($bf,$preferences,$seq_rolluprule->id);
//End sco track
$status =fwrite ($bf,end_tag('SEQ_ROLLUPRULE',5,true));
}
}
- function backup_scorm_seq_rolluprulecond ($bf,$preferences,$rolluprule) {
+ function backup_scorm_seq_rolluprulecond ($bf,$preferences,$rolluprule) {
global $CFG;
fwrite ($bf,full_tag('ID',6,false,$seq_rolluprulecondition->id));
fwrite ($bf,full_tag('SCOID',6,false,$seq_rolluprulecondition->scoid));
fwrite ($bf,full_tag('ROLLUPRULEID',6,false,$seq_rolluprulecondition->rollupruleid));
- fwrite ($bf,full_tag('COND',6,false,$seq_rolluprulecondition->condition));
- fwrite ($bf,full_tag('OPERATOR',6,false,$seq_rolluprulecondition->operator));
-
+ fwrite ($bf,full_tag('COND',6,false,$seq_rolluprulecondition->condition));
+ fwrite ($bf,full_tag('OPERATOR',6,false,$seq_rolluprulecondition->operator));
+
//End sco track
$status =fwrite ($bf,end_tag('SEQ_ROLLUPRULECOND',5,true));
}
fwrite ($bf,full_tag('SCOID',6,false,$seq_objective->scoid));
fwrite ($bf,full_tag('PRIMARYOBJ',6,false,$seq_objective->primaryobj));
fwrite ($bf,full_tag('OBJECTIVEID',6,false,$seq_objective->objectiveid));
- fwrite ($bf,full_tag('MINNORMALIZEDMEASURE',6,false,$seq_objective->minnormalizedmeasure));
- fwrite ($bf,full_tag('SATISFIEDBYMEASURE',6,false,$seq_objective->objectivemeasureweight));
-
- $status = backup_scorm_seq_mapinfo($bf,$preferences,$seq_objective->id);
+ fwrite ($bf,full_tag('MINNORMALIZEDMEASURE',6,false,$seq_objective->minnormalizedmeasure));
+ fwrite ($bf,full_tag('SATISFIEDBYMEASURE',6,false,$seq_objective->objectivemeasureweight));
+
+ $status = backup_scorm_seq_mapinfo($bf,$preferences,$seq_objective->id);
//End sco track
$status =fwrite ($bf,end_tag('SEQ_OBJECTIVE',5,true));
}
return $status;
}
- function backup_scorm_seq_mapinfo ($bf,$preferences,$objectives) {
+ function backup_scorm_seq_mapinfo ($bf,$preferences,$objectives) {
global $CFG;
fwrite ($bf,full_tag('SCOID',6,false,$seq_objective->scoid));
fwrite ($bf,full_tag('OBJECTIVEID',6,false,$seq_objective->objectiveid));
fwrite ($bf,full_tag('TARGETOBJECTIVEID',6,false,$seq_objective->targetobjectiveid));
- fwrite ($bf,full_tag('READSATISFIEDSTATUS',6,false,$seq_objective->readsatisfiedstatus));
- fwrite ($bf,full_tag('READNORMALIZEDMEASURE',6,false,$seq_objective->readnormalizedmeasure));
- fwrite ($bf,full_tag('WRITESATISFIEDSTATUS',6,false,$seq_objective->writesatisfiedstatus));
- fwrite ($bf,full_tag('WRITENORMALIZEDMEASURE',6,false,$seq_objective->writenormalizedmeasure));
+ fwrite ($bf,full_tag('READSATISFIEDSTATUS',6,false,$seq_objective->readsatisfiedstatus));
+ fwrite ($bf,full_tag('READNORMALIZEDMEASURE',6,false,$seq_objective->readnormalizedmeasure));
+ fwrite ($bf,full_tag('WRITESATISFIEDSTATUS',6,false,$seq_objective->writesatisfiedstatus));
+ fwrite ($bf,full_tag('WRITENORMALIZEDMEASURE',6,false,$seq_objective->writenormalizedmeasure));
//End sco track
$status =fwrite ($bf,end_tag('SEQ_MAPINF',5,true));
}
$scorm->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
$scorm->reference = backup_todb($info['MOD']['#']['REFERENCE']['0']['#']);
$scorm->version = backup_todb($info['MOD']['#']['VERSION']['0']['#']);
- $scorm->md5hash = backup_todb($info['MOD']['#']['MD5HASH']['0']['#']);
+ $scorm->md5hash = backup_todb($info['MOD']['#']['MD5HASH']['0']['#']);
$scorm->maxgrade = backup_todb($info['MOD']['#']['MAXGRADE']['0']['#']);
if (!is_int($scorm->maxgrade)) {
$scorm->maxgrade = 0;
}
- $scorm->updatefreq = backup_todb($info['MOD']['#']['UPDATEFREQ']['0']['#']);
+ $scorm->updatefreq = backup_todb($info['MOD']['#']['UPDATEFREQ']['0']['#']);
if (!is_int($scorm->updatefreq)) {
$scorm->updatefreq = 0;
}
- $scorm->maxattempt = backup_todb($info['MOD']['#']['MAXATTEMPT']['0']['#']);
+ $scorm->maxattempt = backup_todb($info['MOD']['#']['MAXATTEMPT']['0']['#']);
if (!is_int($scorm->maxattempt)) {
$scorm->maxattempt = 0;
}
//Now check if want to restore user data and do it.
scorm_scoes_seq_objective_restore_mods ($newid,$info,$restore);
- scorm_scoes_seq_rolluprule_restore_mods ($newid,$info,$restore);
- scorm_scoes_seq_ruleconds_restore_mods ($newid,$info,$restore);
+ scorm_scoes_seq_rolluprule_restore_mods ($newid,$info,$restore);
+ scorm_scoes_seq_ruleconds_restore_mods ($newid,$info,$restore);
if (restore_userdata_selected($restore,'scorm',$oldmodid)) {
//Restore scorm_scoes
if ($status) {
//The structure is equal to the db, so insert the forum_discussions
$newid = insert_record ("scorm_seq_objective",$objective);
- if ($newid) {
+ if ($newid) {
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,"scorm_seq_objective", $oldid, $newid);
} else {
backup_flush(300);
}
- //Now restore the scorm_seq_mapinfo for each objective
+ //Now restore the scorm_seq_mapinfo for each objective
$status = scorm_seq_mapinfo_restore_mods ($sco_id,$newid,$obj_info,$restore);
- }
+ }
return $status;
}
$rolluprule->minimumrule = backup_todb($rol_info['#']['MINIMUMCOUNT']['0']['#']);
$rolluprule->minimumpercent = backup_todb($rol_info['#']['MINIMUMPERCENT']['0']['#']);
$rolluprule->conditioncombination = backup_todb($rol_info['#']['CONDITIONCOMBINATION']['0']['#']);
- $rolluprule->action = backup_todb($rol_info['#']['ACTION']['0']['#']);
+ $rolluprule->action = backup_todb($rol_info['#']['ACTION']['0']['#']);
//The structure is equal to the db, so insert the forum_discussions
$newid = insert_record ("scorm_seq_rolluprule",$rolluprule);
- if ($newid) {
+ if ($newid) {
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,"scorm_seq_rolluprule", $oldid, $newid);
} else {
backup_flush(300);
}
- //Now restore the scorm_seq_mapinfo for each objective
+ //Now restore the scorm_seq_mapinfo for each objective
$status = scorm_seq_rolluprulecond_restore_mods ($sco_id, $newid,$obj_info,$restore);
- }
+ }
return $status;
}
$rulecond->scoid = $sco_id;
$rulecond->conditioncombination = backup_todb($rul_info['#']['CONDITIONCOMBINATION']['0']['#']);
- $rulecond->minimumpercent = backup_todb($rul_info['#']['RULETYPE']['0']['#']);
- $rulecond->action = backup_todb($rul_info['#']['ACTION']['0']['#']);
+ $rulecond->minimumpercent = backup_todb($rul_info['#']['RULETYPE']['0']['#']);
+ $rulecond->action = backup_todb($rul_info['#']['ACTION']['0']['#']);
//The structure is equal to the db, so insert the forum_discussions
$newid = insert_record ("scorm_seq_ruleconds",$rulecond);
- if ($newid) {
+ if ($newid) {
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,"scorm_seq_ruleconds", $oldid, $newid);
} else {
backup_flush(300);
}
- //Now restore the scorm_seq_mapinfo for each objective
+ //Now restore the scorm_seq_mapinfo for each objective
$status = scorm_seq_rulecond_restore_mods ($sco_id, $newid,$obj_info,$restore);
- }
+ }
return $status;
}
$rulecondd->scoid = $sco_id;
$rulecondd->ruleconditions = $rulecondid;
- $rulecondd->refrencedobjective = backup_todb($ruld_info['#']['REFRENCEDOBJECTIVE']['0']['#']);
- $rulecondd->measurethreshold = backup_todb($ruld_info['#']['MEASURETHRESHOLD']['0']['#']);
- $rulecondd->operator = backup_todb($ruld_info['#']['OPERATOR']['0']['#']);
- $rulecondd->cond = backup_todb($ruld_info['#']['COND']['0']['#']);
+ $rulecondd->refrencedobjective = backup_todb($ruld_info['#']['REFRENCEDOBJECTIVE']['0']['#']);
+ $rulecondd->measurethreshold = backup_todb($ruld_info['#']['MEASURETHRESHOLD']['0']['#']);
+ $rulecondd->operator = backup_todb($ruld_info['#']['OPERATOR']['0']['#']);
+ $rulecondd->cond = backup_todb($ruld_info['#']['COND']['0']['#']);
//The structure is equal to the db, so insert the forum_discussions
$newid = insert_record ("scorm_seq_rulecond",$rulecondd);
- if ($newid) {
+ if ($newid) {
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,"scorm_seq_rulecond", $oldid, $newid);
} else {
backup_flush(300);
}
- //Now restore the scorm_seq_mapinfo for each objective
-
- }
+ //Now restore the scorm_seq_mapinfo for each objective
+
+ }
return $status;
}
$rolluprulecond->scoid = $sco_id;
$rolluprulecond->ruleconditions = $rolluprule;
- $rolluprulecond->cond = backup_todb($rulc_info['#']['COND']['0']['#']);
- $rolluprulecond->operator = backup_todb($rulc_info['#']['OPERATOR']['0']['#']);
-
-
+ $rolluprulecond->cond = backup_todb($rulc_info['#']['COND']['0']['#']);
+ $rolluprulecond->operator = backup_todb($rulc_info['#']['OPERATOR']['0']['#']);
+
+
//The structure is equal to the db, so insert the forum_discussions
$newid = insert_record ("scorm_seq_rolluprulecond",$rolluprulecond);
- if ($newid) {
+ if ($newid) {
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,"scorm_seq_rolluprulecond", $oldid, $newid);
} else {
backup_flush(300);
}
- //Now restore the scorm_seq_mapinfo for each objective
-
- }
+ //Now restore the scorm_seq_mapinfo for each objective
+
+ }
return $status;
}
$mapinfo->scoid = $sco_id;
$mapinfo->objectiveid = $ojectiveid;
- $mapinfo->targetobjectiveid = backup_todb($map_info['#']['TARGETOBJECTIVEID']['0']['#']);
- $mapinfo->readsatisfiedstatus = backup_todb($map_info['#']['READSATISFIEDSTATUS']['0']['#']);
- $mapinfo->readnormalizedmeasure = backup_todb($map_info['#']['READNORMALIZEDMEASURE']['0']['#']);
- $mapinfo->writesatisfiedstatus = backup_todb($map_info['#']['WRITESATISFIEDSTATUS']['0']['#']);
- $mapinfo->writenormalizedmeasure = backup_todb($map_info['#']['WRITENORMALIZEDMEASURE']['0']['#']);
-
+ $mapinfo->targetobjectiveid = backup_todb($map_info['#']['TARGETOBJECTIVEID']['0']['#']);
+ $mapinfo->readsatisfiedstatus = backup_todb($map_info['#']['READSATISFIEDSTATUS']['0']['#']);
+ $mapinfo->readnormalizedmeasure = backup_todb($map_info['#']['READNORMALIZEDMEASURE']['0']['#']);
+ $mapinfo->writesatisfiedstatus = backup_todb($map_info['#']['WRITESATISFIEDSTATUS']['0']['#']);
+ $mapinfo->writenormalizedmeasure = backup_todb($map_info['#']['WRITENORMALIZEDMEASURE']['0']['#']);
+
//The structure is equal to the db, so insert the forum_discussions
$newid = insert_record ("scorm_seq_mapinfo",$mapinfo);
- if ($newid) {
+ if ($newid) {
//We have the newid, update backup_ids
backup_putid($restore->backup_unique_code,"scorm_seq_mapinfo", $oldid, $newid);
} else {
$scotrack->userid = backup_todb($sub_info['#']['USERID']['0']['#']);
$scotrack->scoid = backup_todb($sub_info['#']['SCOID']['0']['#']);
$scotrack->element = backup_todb($sub_info['#']['ELEMENT']['0']['#']);
- $scotrack->attempt = backup_todb($sub_info['#']['ATTEMPT']['0']['#']);
+ $scotrack->attempt = backup_todb($sub_info['#']['ATTEMPT']['0']['#']);
$scotrack->value = backup_todb($sub_info['#']['VALUE']['0']['#']);
//We have to recode the userid field
$scotrack->scoid = $sco->new_id;
}
- $scotrack->timemodified = time();
+ $scotrack->timemodified = time();
//The structure is equal to the db, so insert the scorm_scoes_track
$newid = insert_record ("scorm_scoes_track",$scotrack);