Skip to content

Commit

Permalink
Fix all the PHP syntax errors in this code. I can't think of any vali…
Browse files Browse the repository at this point in the history
…d reason for checking code with that many syntax errors into CVS, especially when there are plenty of editors out there that check the syntax for you and highlight the errors. Also, can I point out that Moodle coding guidelines require spaces for indents, not tabs. (http://docs.moodle.org/en/Development:Coding)
  • Loading branch information
tjhunt committed May 1, 2007
1 parent 41eb7f3 commit b186cb9
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions mod/scorm/datamodels/sequencinglib.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ function scorm_seq_measure_rollup($sco,$userid){
$children = get_children($sco);
foreach ($children as $child){
$child = scorm_get_sco ($child);
if (!isset($child->tracked) || ($child->tracked == 1))
if (!isset($child->tracked) || ($child->tracked == 1)){
//check if we haven't done any attempt to see if this activity has been tracked
//it could be $child->tracked == true

Expand Down Expand Up @@ -591,7 +591,7 @@ function scorm_seq_objective_rollup_measure($sco,$userid){

$normalizedmeasure = get_record('scorm_scoes_track','scoid',$sco->id,'userid',$userid,'element','objectivenormalizedmeasure');

if (!$isactive || ($isactive &&//measuresatisfactionif )){//This condition is really odd. It's in the SeqNav.pdf on page 193, line 3.1.2.1
if (!$isactive || ($isactive /*&&// measuresatisfactionif*/ )){//This condition is really odd. It's in the SeqNav.pdf on page 193, line 3.1.2.1
if($normalizedmeasure->value >= $targetobjective->minnormalizedmeasure){
scorm_seq_set('objectiveprogressstatus',$sco->id,$userid);
scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid);
Expand Down Expand Up @@ -675,7 +675,7 @@ function scorm_seq_rollup_rule_check ($sco,$userid,$action){
$child = scorm_get_sco ($child);
if (!isset($child->tracked) || ($child->tracked == 1)){

if(scorm_seq_check_child ($child,$action,$userid){
if(scorm_seq_check_child ($child,$action,$userid)){

$rollupruleconds = get_records('scorm_seq_rolluprulecond','rollupruleid',$rolluprule->id);
$evaluate = scorm_seq_evaluate_rollupcond($child,$rolluprule->conditioncombination,$rollupruleconds,$userid);
Expand Down Expand Up @@ -938,23 +938,23 @@ function scorm_seq_check_child ($sco, $action, $userid){
$included = false;
$r = get_record('scorm_scoes_track','scoid',$sco->id,'userid',$userid,'element','activityattemptcount');
if ($action == 'satisfied' || $action == 'notsatisfied'){
if (!scorm_seq_is('rollupobjectivesatisfied',$sco->id,$userid){
if (!scorm_seq_is('rollupobjectivesatisfied',$sco->id,$userid)){
$included = true;
if (($action == 'satisfied' //&& adlseqRequiredforSatisfied == 'ifNotSuspended') || ($action == 'notsatisfied' && adlseqRequiredforNotSatisfied == 'ifNotSuspended')){
if (($action == 'satisfied' /*&& adlseqRequiredforSatisfied == 'ifNotSuspended') || ($action == 'notsatisfied' && adlseqRequiredforNotSatisfied == 'ifNotSuspended'*/)){

if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || ((($r->value)>0)&& !scorm_seq_is('suspended',$sco->id,$userid))){
$included = false;
}

}
else{
if (($action == 'satisfied' //&& adlseqRequiredforSatisfied == 'ifAttempted') || ($action == 'notsatisfied' && adlseqRequiredforNotSatisfied == 'ifAttempted')){
if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || (($r->value) == 0)){{
if (($action == 'satisfied' /*&& adlseqRequiredforSatisfied == 'ifAttempted') || ($action == 'notsatisfied' && adlseqRequiredforNotSatisfied == 'ifAttempted'*/)){
if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || (($r->value) == 0)){
$included = false;
}
}
else{
if (($action == 'satisfied' //&& adlseqRequiredforSatisfied == 'ifNotSkipped') || ($action == 'notsatisfied' && adlseqRequiredforNotSatisfied == 'ifNotSkipped')){
if (($action == 'satisfied' /*&& adlseqRequiredforSatisfied == 'ifNotSkipped') || ($action == 'notsatisfied' && adlseqRequiredforNotSatisfied == 'ifNotSkipped'*/)){
$rulch = scorm_seq_rules_check($sco, 'skip');
if ($rulch != null){
$included = false;
Expand All @@ -965,10 +965,10 @@ function scorm_seq_check_child ($sco, $action, $userid){
}
}
if ($action == 'completed' || $action == 'incomplete'){
if (!scorm_seq_is('rollupprogresscompletion',$sco->id,$userid){
if (!scorm_seq_is('rollupprogresscompletion',$sco->id,$userid)){
$included = true;

if (($action == 'completed' //&& adlseqRequiredForCompleted == 'ifNotSuspended') || ($action == 'incomplete' && adlseqRequiredForIncomplete == 'ifNotSuspended')){
if (($action == 'completed' /*&& adlseqRequiredForCompleted == 'ifNotSuspended') || ($action == 'incomplete' && adlseqRequiredForIncomplete == 'ifNotSuspended'*/)){

if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || ( (($r->value)>0)&& !scorm_seq_is('suspended',$sco->id,$userid))){
$included = false;
Expand All @@ -977,15 +977,15 @@ function scorm_seq_check_child ($sco, $action, $userid){
}
else{

if (($action == 'completed' //&& adlseqRequiredForCompleted == 'ifAttempted') || ($action == 'incomplete' && adlseqRequiredForIncomplete == 'ifAttempted')){
if (($action == 'completed' /*&& adlseqRequiredForCompleted == 'ifAttempted') || ($action == 'incomplete' && adlseqRequiredForIncomplete == 'ifAttempted'*/)){

if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || (($r->value)==0)){
$included = false;
}

}
else{
if (($action == 'completed' //&& adlseqRequiredforSatisfied == 'ifNotSkipped') || ($action == 'incomplete' && adlseqRequiredforNotSatisfied == 'ifNotSkipped')){
if (($action == 'completed' /*&& adlseqRequiredforSatisfied == 'ifNotSkipped') || ($action == 'incomplete' && adlseqRequiredforNotSatisfied == 'ifNotSkipped'*/)){
$rulch = scorm_seq_rules_check($sco, 'skip');
if ($rulch != null){
$included = false;
Expand Down Expand Up @@ -1076,7 +1076,7 @@ function scorm_seq_start_sequencing($scoid,$userid,$seq){
else{
$ancestors = scorm_get_ancestors($sco);
$ancestorsroot = array_reverse($ancestors);
$res = scorm_seq_flow($ancestorsroot[0],'forward',$seq,true$userid);
$res = scorm_seq_flow($ancestorsroot[0],'forward',$seq,true,$userid);
if($res){
return $res;
}
Expand Down Expand Up @@ -1398,7 +1398,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev
}
}
else{
if (!empty($children){
if (!empty($children)){
$activity = scorm_get_sco($activity->id);
if (!isset($parent->flow) || ($parent->flow == true)) {
$children = scorm_get_children ($activity);
Expand All @@ -1420,7 +1420,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev
$seq->traversaldir = null;
$seq->nextactivity = null;
$seq->exception = 'SB.2.1-2';
$return $seq;
return $seq;
}
}

Expand Down Expand Up @@ -1521,7 +1521,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if ($sco == null){
$seq->delivery = null;
$seq->exception = 'SB.2.9-1';
$return $seq;
return $seq;
}

$ancestors = scorm_get_ancestors($sco);
Expand All @@ -1536,15 +1536,15 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if ($position !== false){
$seq->delivery = null;
$seq->exception = 'SB.2.9-2';
$return $seq;
return $seq;
}
}

if (scorm_seq_rules_check($activity,'hidefromchoice' != null){
if (scorm_seq_rules_check($activity,'hidefromchoice' != null)){

$seq->delivery = null;
$seq->exception = 'SB.2.9-3';
$return $seq;
return $seq;

}

Expand All @@ -1555,7 +1555,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if ( !get_record('scorm_scoes_track','scoid',$parentid->id,'userid',$userid,'element','sequencingcontrolchoice')){
$seq->delivery = null;
$seq->exception = 'SB.2.9-4';
$return $seq;
return $seq;
}
}

Expand All @@ -1574,15 +1574,15 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
$sib = scorm_get_siblings($seq->currentactivity);
$pos = array_search($sib, $sco);

if (pos !=== false){
if (pos !== false){

$siblings = array_slice($sib, 0, $pos-1);

if (empty($siblings)){

$seq->delivery = null;
$seq->exception = 'SB.2.9-5';
$return $seq;
return $seq;

}

Expand Down Expand Up @@ -1615,7 +1615,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if (empty($comtarget)){
$seq->delivery = null;
$seq->exception = 'SB.2.9-5';
$return $seq;
return $seq;
}
foreach ($comtarget as $act){
$seq = scorm_seq_choice_activity_traversal($act,$userid,$seq,'forward');
Expand All @@ -1627,7 +1627,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if(scorm_seq_is('active',$act->id,$userid) && ($act->id != $comancestor->id && $seq->prevact)){//adlseq:can i write it like another property for the $seq object?
$seq->delivery = null;
$seq->exception = 'SB.2.9-6';
$return $seq;
return $seq;
}
}
break;
Expand All @@ -1643,7 +1643,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if (empty($curtarget)){
$seq->delivery = null;
$seq->exception = 'SB.2.9-5';
$return $seq;
return $seq;
}
$i=0;
foreach ($curtarget as $activ){
Expand All @@ -1652,7 +1652,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if ( !get_record('scorm_scoes_track','scoid',$activ->id,'userid',$userid,'element','sequencingcontrolchoiceexit')){
$seq->delivery = null;
$seq->exception = 'SB.2.9-7';
$return $seq;
return $seq;
}
}
}
Expand All @@ -1666,15 +1666,15 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){
if(empty($curcommon)){
$seq->delivery = null;
$seq->exception = 'SB.2.9-5';
$return $seq;
return $seq;
}

$constrained = null;
foreach ($curcommon as $acti){
if ( !get_record('scorm_scoes_track','scoid',$activ->id,'userid',$userid,'element','sequencingcontrolchoiceexit')){
$seq->delivery = null;
$seq->exception = 'SB.2.9-7';
$return $seq;
return $seq;
}
if ($constrained == null){
if($seq->constrainedchoice){
Expand Down

0 comments on commit b186cb9

Please sign in to comment.