$seq->exception = null;
$seq->reachable = true;
$seq->prevact = true;
- $seq->constrainedchoice = true;
switch ($request) {
case 'start_':
if ($sco->parent != '/') {
if ($parentsco = scorm_get_parent($sco)) {
- if (!isset($parentsco->flow) || ($parentsco->flow == true)) {//I think it's parentsco
+ if (isset($parentsco->flow) && ($parentsco->flow == true)) {//I think it's parentsco
// Current activity is active !
if (scorm_seq_is('active',$sco->id,$userid)) {
if ($request == 'continue_') {
$seq->termination = 'exit';
$seq->sequencing = 'continue';
} else {
- if (isset($parentsco->forwardonly) && ($parentsco->forwardonly == false)) {
+ if (!isset($parentsco->forwardonly) || ($parentsco->forwardonly == false)) {
$seq->navigation = true;
$seq->termination = 'exit';
$seq->sequencing = 'previous';
if($countedmeasures>0){
scorm_seq_set('objectivemeasurestatus',$sco->id,$userid);
$val=$totalmeasure/$countedmeasure;
- scorm_seq_set('normalizedmeasure',$sco->id,$userid,$val);
+ scorm_seq_set('objectivenormalizedmeasure',$sco->id,$userid,$val);
}
else{
}
+function scorm_seq_objective_rollup($sco,$userid){
+
+ if($targetobjective->satisfiedbymeasure){
+ scorm_seq_objective_rollup_measure($sco,$userid);
+ }
+ else{
+ if ((scorm_seq_rollup_rule_check($sco,$userid,'incomplete'))|| (scorm_seq_rollup_rule_check($sco,$userid,'completed'))){
+ scorm_seq_objective_rollup_rules($sco,$userid);
+ }
+ else{
+
+ $rolluprules = get_record('scorm_seq_rolluprule','scoid',$sco->id,'userid',$userid);
+ foreach($rolluprules as $rolluprule){
+ $rollupruleconds = get_records('scorm_seq_rolluprulecond','rollupruleid',$rolluprule->id);
+ foreach($rollupruleconds as $rolluprulecond){
+
+ switch ($rolluprulecond->cond!='satisfied' && $rolluprulecond->cond!='completed' && $rolluprulecond->cond!='attempted'){
+
+ scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid, false);
+
+ break;
+ }
+ }
+
+
+ }
+ }
+}
+
function scorm_seq_objective_rollup_measure($sco,$userid){
$targetobjective = null;
}
}
else{
+
scorm_seq_set('objectiveprogressstatus',$sco->id,$userid,false);
}
foreach($rolluprules as $rolluprule){
-
-
foreach ($children as $child){
/*$tracked = get_records('scorm_scoes_track','scoid',$child->id,'userid',$userid);
if ($currentact->parent != '/') {//if the activity is the root and is leaf
$parent = scorm_get_parent ($currentact);
- if (isset($parent->flow) && ($parent->flow == false)) {
+ if (!isset($parent->flow) || ($parent->flow == false)) {
$seq->delivery = null;
$seq->exception = 'SB.2.7-2';
return $seq;
$currentact= $seq->currentactivity;
if ($currentact->parent != '/') {//if the activity is the root and is leaf
$parent = scorm_get_parent ($activity);
- if (isset($parent->flow) && ($parent->flow == false)) {
+ if (!isset($parent->flow) || ($parent->flow == false)) {
$seq->delivery = null;
$seq->exception = 'SB.2.8-2';
return $seq;
function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $childrenflag, $prevdirection, $seq,$userid){//returns the next activity on the tree, traversal direction, control returned to the LTS, (may) exception
$activity = scorm_get_sco ($activity);
$parent = scorm_get_parent ($activity);
- if (isset($parent->flow) && ($parent->flow == false)) {
+ if (!isset($parent->flow) || ($parent->flow == false)) {
$seq->deliverable = false;
$seq->exception = 'SB.2.2-1';
$seq->nextactivity = $activity;
else{
if (!empty($children){
$activity = scorm_get_sco($activity->id);
- if (!isset($parent->flow) || ($parent->flow == true)) {
+ if (isset($parent->flow) && ($parent->flow == true)) {
$children = scorm_get_children ($activity);
$seq->traversaldir = 'forward';
$seq->nextactivity = $children[0];
return $seq;
}
if ($constrained == null){
- if($acti->constrainedchoice){
- $constrained = $acti;//adlseq:can i write it like another property for the $seq object?
+ if($acti->constrainchoice == true){
+ $constrained = $acti;
}
}
}
return $seq;
}
$act = scorm_get_sco($act->id);
- if(scorm_seq_is('active',$act->id,$userid) && ($act->id != $comancestor->id && $act->preventactivation)){//adlseq:can i write it like another property for the $seq object?
+ if(scorm_seq_is('active',$act->id,$userid) && ($act->id != $comancestor->id && ($act->preventactivation == true))){
$seq->delivery = null;
$seq->exception = 'SB.2.9-6';
return $seq;
else{
foreach ($comtarget as $act){
$act = scorm_get_sco($act->id);
- if(scorm_seq_is('active',$act->id,$userid) && ($act->id != $comancestor->id && $act->preventactivation)){
+ if(scorm_seq_is('active',$act->id,$userid) && ($act->id != $comancestor->id && ($act->preventactivation==true))){
$seq->delivery = null;
$seq->exception = 'SB.2.9-6';
return $seq;
if($direction == 'backward'){
$parentsco = scorm_get_parent($activity);
if($parentsco!= null){
- if (!isset($parentsco->forwardonly) || ($parentsco->forwardonly == true)){
+ if (isset($parentsco->forwardonly) && ($parentsco->forwardonly == true)){
$seq->reachable = false;
$seq->exception = 'SB.2.4-2';
return $seq;