2009-11-01 15:24:58 +00:00
< ? php
2011-06-30 14:59:08 +12:00
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
2007-01-16 14:03:15 +00:00
function scorm_seq_exit_action_rules ( $seq , $userid ) {
$sco = $seq -> currentactivity ;
$ancestors = scorm_get_ancestors ( $sco );
$exittarget = null ;
2012-06-21 23:12:34 +05:30
foreach ( array_reverse ( $ancestors ) as $ancestor ) {
if ( scorm_seq_rules_check ( $ancestor , 'exit' ) != null ) {
$exittarget = $ancestor ;
break ;
}
}
if ( $exittarget != null ) {
$commons = array_slice ( $ancestors , 0 , scorm_find_common_ancestor ( $ancestors , $exittarget ));
2009-03-23 09:53:02 +00:00
2012-06-21 23:12:34 +05:30
/// Terminate Descendent Attempts Process
if ( $commons ) {
foreach ( $commons as $ancestor ) {
2009-03-23 09:53:02 +00:00
2012-06-21 23:12:34 +05:30
scorm_seq_end_attempt ( $ancestor , $userid , $seq -> attempt );
$seq -> currentactivity = $ancestor ;
}
}
}
return $seq ;
}
2009-03-23 09:53:02 +00:00
2012-06-21 23:12:34 +05:30
function scorm_seq_post_cond_rules ( $seq , $userid ) {
$sco = $seq -> currentactivity ;
if ( ! $seq -> suspended ) {
if ( $action = scorm_seq_rules_check ( $sco , 'post' ) != null ) {
switch ( $action ) {
case 'retry' :
case 'continue' :
case 'previous' :
$seq -> sequencing = $action ;
2009-03-23 09:53:02 +00:00
break ;
2012-06-21 23:12:34 +05:30
case 'exitparent' :
case 'exitall' :
$seq -> termination = $action ;
2009-03-23 09:53:02 +00:00
break ;
2012-06-21 23:12:34 +05:30
case 'retryall' :
$seq -> termination = 'exitall' ;
$seq -> sequencing = 'retry' ;
2009-03-23 09:53:02 +00:00
break ;
}
}
2012-06-21 23:12:34 +05:30
}
return $seq ;
2007-04-27 12:20:26 +00:00
}
function scorm_seq_evaluate_rollupcond ( $sco , $conditioncombination , $rollupruleconds , $userid ){
2009-03-23 09:53:02 +00:00
$bag = Array ();
2007-04-27 12:20:26 +00:00
$con = " " ;
2009-03-23 09:53:02 +00:00
$val = false ;
$unk = false ;
2007-04-27 12:20:26 +00:00
foreach ( $rollupruleconds as $rolluprulecond ){
2010-11-16 00:19:41 +00:00
$condit = scorm_evaluate_condition ( $rolluprulecond , $sco , $userid );
2009-03-23 09:53:02 +00:00
2010-11-16 00:56:24 +00:00
if ( $rolluprulecond -> operator == 'not' ){ // If operator is not, negate the condition
if ( $rolluprulecond -> cond != 'unknown' ){
2009-03-23 09:53:02 +00:00
if ( $condit ){
$condit = false ;
}
else {
$condit = true ;
}
}
else {
$condit = 'unknown' ;
}
array_push ( $childrenbag , $condit );
}
}
if ( empty ( $bag )){
return 'unknown' ;
}
else {
$i = 0 ;
foreach ( $bag as $b ){
2010-11-16 00:56:24 +00:00
if ( $rolluprulecond -> conditioncombination == 'all' ){
2009-03-23 09:53:02 +00:00
$val = true ;
if ( $b == 'unknown' ){
$unk = true ;
}
if ( $b === false ){
return false ;
}
}
else {
2007-04-27 12:20:26 +00:00
$val = false ;
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
if ( $b == 'unknown' ){
$unk = true ;
}
if ( $b === true ){
return true ;
}
}
}
}
if ( $unk ){
return 'unknown' ;
}
return $val ;
2007-04-27 12:20:26 +00:00
}
function scorm_seq_check_child ( $sco , $action , $userid ){
2008-06-05 10:02:26 +00:00
global $DB ;
2009-03-23 09:53:02 +00:00
$included = false ;
$sco = scorm_get_sco ( $sco -> id );
$r = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $sco -> id , 'userid' => $userid , 'element' => 'activityattemptcount' ));
if ( $action == 'satisfied' || $action == 'notsatisfied' ){
if ( ! $sco -> rollupobjectivesatisfied ){
$included = true ;
if (( $action == 'satisfied' && $sco -> requiredforsatisfied == 'ifnotsuspended' ) || ( $action == 'notsatisfied' && $sco -> requiredfornotsatisfied == 'ifnotsuspended' )){
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
if ( ! scorm_seq_is ( 'activityprogressstatus' , $sco -> id , $userid ) || ((( $r -> value ) > 0 ) && ! scorm_seq_is ( 'suspended' , $sco -> id , $userid ))){
$included = false ;
}
}
else {
if (( $action == 'satisfied' && $sco -> requiredforsatisfied == 'ifattempted' ) || ( $action == 'notsatisfied' && $sco -> requiredfornotsatisfied == 'ifattempted' )){
if ( ! scorm_seq_is ( 'activityprogressstatus' , $sco -> id , $userid ) || (( $r -> value ) == 0 )){
$included = false ;
}
}
else {
if (( $action == 'satisfied' && $sco -> requiredforsatisfied == 'ifnotskipped' ) || ( $action == 'notsatisfied' && $sco -> requiredfornotsatisfied == 'ifnotskipped' )){
$rulch = scorm_seq_rules_check ( $sco , 'skip' );
if ( $rulch != null ){
$included = false ;
}
}
2007-04-27 12:20:26 +00:00
}
2009-03-23 09:53:02 +00:00
}
2007-04-27 12:20:26 +00:00
}
2009-03-23 09:53:02 +00:00
}
2007-04-27 12:20:26 +00:00
if ( $action == 'completed' || $action == 'incomplete' ){
2009-03-23 09:53:02 +00:00
if ( ! $sco -> rollupprogresscompletion ){
$included = true ;
2007-04-27 12:20:26 +00:00
2007-05-04 11:17:15 +00:00
if (( $action == 'completed' && $sco -> requiredforcompleted == 'ifnotsuspended' ) || ( $action == 'incomplete' && $sco -> requiredforincomplete == 'ifnotsuspended' )){
2007-04-27 12:20:26 +00:00
2009-03-23 09:53:02 +00:00
if ( ! scorm_seq_is ( 'activityprogressstatus' , $sco -> id , $userid ) || ( (( $r -> value ) > 0 ) && ! scorm_seq_is ( 'suspended' , $sco -> id , $userid ))){
$included = false ;
}
}
else {
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
if (( $action == 'completed' && $sco -> requiredforcompleted == 'ifattempted' ) || ( $action == 'incomplete' && $sco -> requiredforincomplete == 'ifattempted' )){
if ( ! scorm_seq_is ( 'activityprogressstatus' , $sco -> id , $userid ) || (( $r -> value ) == 0 )){
$included = false ;
}
}
else {
if (( $action == 'completed' && $sco -> requiredforsatisfied == 'ifnotskipped' ) || ( $action == 'incomplete' && $sco -> requiredfornotsatisfied == 'ifnotskipped' )){
$rulch = scorm_seq_rules_check ( $sco , 'skip' );
if ( $rulch != null ){
$included = false ;
}
}
}
}
}
}
2007-04-27 12:20:26 +00:00
return $included ;
}
function scorm_seq_sequencing ( $scoid , $userid , $seq ) {
switch ( $seq -> sequencing ) {
case 'start' :
2010-09-18 13:48:01 +00:00
$seq = scorm_seq_start_sequencing ( $scoid , $userid , $seq ); //We'll see the parameters we have to send, this should update delivery and end
2009-03-23 09:53:02 +00:00
$seq -> sequencing = true ;
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
break ;
2009-11-01 15:24:58 +00:00
2007-04-27 12:20:26 +00:00
case 'resumeall' :
2010-11-16 00:21:59 +00:00
$seq = scorm_seq_resume_all_sequencing ( $scoid , $userid , $seq ); //We'll see the parameters we have to send, this should update delivery and end
2009-03-23 09:53:02 +00:00
$seq -> sequencing = true ;
2009-11-01 15:24:58 +00:00
2007-04-27 12:20:26 +00:00
break ;
case 'exit' :
2010-09-18 13:48:01 +00:00
$seq = scorm_seq_exit_sequencing ( $scoid , $userid , $seq ); //We'll see the parameters we have to send, this should update delivery and end
2009-03-23 09:53:02 +00:00
$seq -> sequencing = true ;
2007-04-27 12:20:26 +00:00
2009-11-01 15:24:58 +00:00
2007-04-27 12:20:26 +00:00
break ;
case 'retry' :
2010-09-18 13:48:01 +00:00
$seq = scorm_seq_retry_sequencing ( $scoid , $userid , $seq ); //We'll see the parameters we have to send, this should update delivery and end
2007-04-27 12:20:26 +00:00
$seq -> sequencing = true ;
2009-11-01 15:24:58 +00:00
2007-04-27 12:20:26 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'previous' :
2010-09-18 13:48:01 +00:00
$seq = scorm_seq_previous_sequencing ( $scoid , $userid , $seq ); // We'll see the parameters we have to send, this should update delivery and end
2009-03-23 09:53:02 +00:00
$seq -> sequencing = true ;
2007-04-27 12:20:26 +00:00
2009-11-01 15:24:58 +00:00
2007-04-27 12:20:26 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'choice' :
2010-09-18 13:48:01 +00:00
$seq = scorm_seq_choice_sequencing ( $scoid , $userid , $seq ); // We'll see the parameters we have to send, this should update delivery and end
2009-11-01 15:24:58 +00:00
$seq -> sequencing = true ;
2009-03-23 09:53:02 +00:00
break ;
2007-04-27 12:20:26 +00:00
}
2009-03-23 09:53:02 +00:00
if ( $seq -> exception != null ){
$seq -> sequencing = false ;
return $seq ;
}
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
$seq -> sequencing = true ;
2007-04-27 12:20:26 +00:00
return $seq ;
}
function scorm_seq_start_sequencing ( $scoid , $userid , $seq ){
2008-06-05 10:02:26 +00:00
global $DB ;
2009-03-23 09:53:02 +00:00
if ( ! empty ( $seq -> currentactivity )) {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.5-1' ;
return $seq ;
}
$sco = $DB -> get_record ( 'scorm_scoes' , array ( 'scoid' => $scoid , 'userid' => $userid ));
if (( $sco -> parent == '/' ) && scorm_is_leaf ( $sco )) { //if the activity is the root and is leaf
$seq -> delivery = $sco ;
}
else {
$ancestors = scorm_get_ancestors ( $sco );
$ancestorsroot = array_reverse ( $ancestors );
$res = scorm_seq_flow ( $ancestorsroot [ 0 ], 'forward' , $seq , true , $userid );
if ( $res ){
return $res ;
}
else {
//return end and exception
}
}
2007-04-27 12:20:26 +00:00
}
function scorm_seq_resume_all_sequencing ( $scoid , $userid , $seq ){
2008-06-05 10:02:26 +00:00
global $DB ;
2009-03-23 09:53:02 +00:00
if ( ! empty ( $seq -> currentactivity )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.6-1' ;
return $seq ;
}
$track = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $scoid , 'userid' => $userid , 'element' => 'suspendedactivity' ));
2007-04-27 12:20:26 +00:00
if ( ! $track ) {
2009-03-23 09:53:02 +00:00
$seq -> delivery = null ;
$seq -> exception = 'SB.2.6-2' ;
return $seq ;
}
$seq -> delivery = $DB -> get_record ( 'scorm_scoes' , array ( 'scoid' => $scoid , 'userid' => $userid )); //we assign the sco to the delivery
2009-11-01 15:24:58 +00:00
2007-04-27 12:20:26 +00:00
}
function scorm_seq_continue_sequencing ( $scoid , $userid , $seq ){
2009-03-23 09:53:02 +00:00
if ( empty ( $seq -> currentactivity )) {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.7-1' ;
return $seq ;
}
$currentact = $seq -> currentactivity ;
if ( $currentact -> parent != '/' ) { //if the activity is the root and is leaf
$parent = scorm_get_parent ( $currentact );
if ( ! isset ( $parent -> flow ) || ( $parent -> flow == false )) {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.7-2' ;
return $seq ;
}
$res = scorm_seq_flow ( $currentact , 'forward' , $seq , false , $userid );
if ( $res ){
return $res ;
}
else {
//return end and exception
}
}
}
function scorm_seq_previous_sequencing ( $scoid , $userid , $seq ){
if ( empty ( $seq -> currentactivity )) {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.8-1' ;
return $seq ;
}
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
$currentact = $seq -> currentactivity ;
if ( $currentact -> parent != '/' ) { //if the activity is the root and is leaf
2010-11-16 00:56:24 +00:00
$parent = scorm_get_parent ( $currentact );
2009-03-23 09:53:02 +00:00
if ( ! isset ( $parent -> flow ) || ( $parent -> flow == false )) {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.8-2' ;
return $seq ;
}
$res = scorm_seq_flow ( $currentact , 'backward' , $seq , false , $userid );
if ( $res ){
return $res ;
}
else {
//return end and exception
}
}
2007-04-27 12:20:26 +00:00
}
function scorm_seq_exit_sequencing ( $scoid , $userid , $seq ){
2009-03-23 09:53:02 +00:00
if ( empty ( $seq -> currentactivity )) {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.11-1' ;
return $seq ;
}
if ( $seq -> active ){
$seq -> endsession = false ;
$seq -> exception = 'SB.2.11-2' ;
return $seq ;
}
$currentact = $seq -> currentactivity ;
if ( $currentact -> parent == '/' ){
$seq -> endsession = true ;
return $seq ;
}
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
$seq -> endsession = false ;
return $seq ;
2007-04-27 12:20:26 +00:00
}
function scorm_seq_retry_sequencing ( $scoid , $userid , $seq ){
2009-03-23 09:53:02 +00:00
if ( empty ( $seq -> currentactivity )) {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.10-1' ;
return $seq ;
}
if ( $seq -> active || $seq -> suspended ){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.10-2' ;
return $seq ;
}
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
if ( ! scorm_is_leaf ( $seq -> currentactivity )){
$res = scorm_seq_flow ( $seq -> currentactivity , 'forward' , $seq , true , $userid );
if ( $res != null ){
return $res ;
//return deliver
}
else {
$seq -> delivery = null ;
$seq -> exception = 'SB.2.10-3' ;
return $seq ;
}
}
else {
$seq -> delivery = $seq -> currentactivity ;
return $seq ;
}
2007-04-27 12:20:26 +00:00
}
2007-04-30 12:46:08 +00:00
function scorm_seq_choice_sequencing ( $sco , $userid , $seq ){
2009-03-23 09:53:02 +00:00
$avchildren = Array ();
$comancestor = null ;
$traverse = null ;
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( $sco == null ){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-1' ;
return $seq ;
}
2007-04-30 12:46:08 +00:00
$ancestors = scorm_get_ancestors ( $sco );
$arrpath = array_reverse ( $ancestors );
2009-03-23 09:53:02 +00:00
array_push ( $arrpath , $sco ); //path from the root to the target
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
foreach ( $arrpath as $activity ){
2007-04-30 12:46:08 +00:00
if ( $activity -> parent != '/' ) {
2009-03-23 09:53:02 +00:00
$avchildren = scorm_get_available_children ( scorm_get_parent ( $activity ));
$position = array_search ( $avchildren , $activity );
2007-04-30 12:46:08 +00:00
if ( $position !== false ){
2009-03-23 09:53:02 +00:00
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-2' ;
return $seq ;
}
}
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( scorm_seq_rules_check ( $activity , 'hidefromchoice' != null )){
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-3' ;
return $seq ;
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
}
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
}
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( $sco -> parent != '/' ) {
$parent = scorm_sco_get_parent ( $sco );
if ( isset ( $parent -> choice ) && ( $parent -> choice == false )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-4' ;
return $seq ;
}
}
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( $seq -> currentactivity != null ){
2007-04-30 12:46:08 +00:00
$commonpos = scorm_find_common_ancestor ( $ancestors , $seq -> currentactivity );
2009-03-23 09:53:02 +00:00
$comancestor = $arrpath [ $commonpos ];
}
else {
$comancestor = $arrpath [ 0 ];
}
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( $seq -> currentactivity === $sco ) {
2007-04-30 12:46:08 +00:00
break ;
2009-03-23 09:53:02 +00:00
}
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
$sib = scorm_get_siblings ( $seq -> currentactivity );
$pos = array_search ( $sib , $sco );
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( $pos !== false ){
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
$siblings = array_slice ( $sib , 0 , $pos - 1 );
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( empty ( $siblings )){
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-5' ;
return $seq ;
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
}
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
$children = scorm_get_children ( scorm_get_parent ( $sco ));
$pos1 = array_search ( $children , $sco );
$pos2 = array_search ( $seq -> currentactivity , $sco );
if ( $pos1 > $pos2 ){
$traverse = 'forward' ;
}
else {
$traverse = 'backward' ;
}
foreach ( $siblings as $sibling ){
$seq = scorm_seq_choice_activity_traversal ( $sibling , $userid , $seq , $traverse );
if ( ! $seq -> reachable ){
$seq -> delivery = null ;
return $seq ;
}
}
break ;
}
2007-04-30 12:46:08 +00:00
if ( $seq -> currentactivity == null || $seq -> currentactivity == $comancestor ){
2009-03-23 09:53:02 +00:00
$commonpos = scorm_find_common_ancestor ( $ancestors , $seq -> currentactivity );
$comtarget = array_slice ( $ancestors , 1 , $commonpos - 1 ); //path from the common ancestor to the target activity
$comtarget = array_reverse ( $comtarget );
if ( empty ( $comtarget )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-5' ;
return $seq ;
}
foreach ( $comtarget as $act ){
$seq = scorm_seq_choice_activity_traversal ( $act , $userid , $seq , 'forward' );
if ( ! $seq -> reachable ){
$seq -> delivery = null ;
return $seq ;
}
2007-05-04 11:17:15 +00:00
$act = scorm_get_sco ( $acti -> id );
2009-03-23 09:53:02 +00:00
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?
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-6' ;
return $seq ;
}
}
break ;
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
}
2007-04-30 12:46:08 +00:00
2009-03-23 09:53:02 +00:00
if ( $comancestor -> id == $sco -> id ){
2007-04-30 12:46:08 +00:00
$ancestorscurrent = scorm_get_ancestors ( $seq -> currentactivity );
2009-03-23 09:53:02 +00:00
$possco = array_search ( $ancestorscurrent , $sco );
$curtarget = array_slice ( $ancestorscurrent , 0 , $possco ); //path from the current activity to the target
if ( empty ( $curtarget )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-5' ;
return $seq ;
}
2007-04-30 12:46:08 +00:00
$i = 0 ;
2009-03-23 09:53:02 +00:00
foreach ( $curtarget as $activ ){
$i ++ ;
if ( $i != sizeof ( $curtarget )){
if ( isset ( $activ -> choiceexit ) && ( $activ -> choiceexit == false )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-7' ;
return $seq ;
}
}
}
break ;
}
if ( array_search ( $ancestors , $comancestor ) !== false ){
$ancestorscurrent = scorm_get_ancestors ( $seq -> currentactivity );
$commonpos = scorm_find_common_ancestor ( $ancestors , $sco );
$curcommon = array_slice ( $ancestorscurrent , 0 , $commonpos - 1 );
if ( empty ( $curcommon )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-5' ;
return $seq ;
}
$constrained = null ;
foreach ( $curcommon as $acti ){
$acti = scorm_get_sco ( $acti -> id );
if ( isset ( $acti -> choiceexit ) && ( $acti -> choiceexit == false )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-7' ;
return $seq ;
}
if ( $constrained == null ){
if ( $acti -> constrainchoice == true ){
$constrained = $acti ;
}
}
}
if ( $constrained != null ){
2007-04-30 12:46:08 +00:00
$fwdir = scorm_get_preorder ( $constrained );
2009-03-23 09:53:02 +00:00
if ( array_search ( $fwdir , $sco ) !== false ){
$traverse = 'forward' ;
}
else {
$traverse = 'backward' ;
}
$seq = scorm_seq_choice_flow ( $constrained , $traverse , $seq );
$actconsider = $seq -> identifiedactivity ;
$avdescendents = Array ();
$avdescendents = scorm_get_available_descendents ( $actconsider );
if ( array_search ( $avdescendents , $sco ) !== false && $sco -> id != $actconsider -> id && $constrained -> id != $sco -> id ){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-8' ;
return $seq ;
}
2007-05-03 12:55:22 +00:00
2007-04-30 12:46:08 +00:00
//CONTINUE 11.5.5
2009-03-23 09:53:02 +00:00
}
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
$commonpos = scorm_find_common_ancestor ( $ancestors , $seq -> currentactivity );
$comtarget = array_slice ( $ancestors , 1 , $commonpos - 1 ); //path from the common ancestor to the target activity
$comtarget = array_reverse ( $comtarget );
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
if ( empty ( $comtarget )){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-5' ;
return $seq ;
}
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
$fwdir = scorm_get_preorder ( $seq -> currentactivity );
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
if ( array_search ( $fwdir , $sco ) !== false ){
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
foreach ( $comtarget as $act ){
$seq = scorm_seq_choice_activity_traversal ( $act , $userid , $seq , 'forward' );
if ( ! $seq -> reachable ){
$seq -> delivery = null ;
return $seq ;
}
2007-05-04 11:17:15 +00:00
$act = scorm_get_sco ( $act -> id );
2009-03-23 09:53:02 +00:00
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 == true ))){
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-6' ;
return $seq ;
}
}
}
2009-11-01 15:24:58 +00:00
break ;
2009-03-23 09:53:02 +00:00
}
if ( scorm_is_leaf ( $sco )){
$seq -> delivery = $sco ;
$seq -> exception = 'SB.2.9-6' ;
return $seq ;
}
2007-04-30 12:46:08 +00:00
2007-05-03 12:55:22 +00:00
$seq = scorm_seq_flow ( $sco , 'forward' , $seq , true , $userid );
if ( $seq -> deliverable == false ){
2009-03-23 09:53:02 +00:00
scorm_terminate_descendent_attempts ( $comancestor , $userid , $seq );
scorm_seq_end_attempt ( $comancestor , $userid , $seq -> attempt );
$seq -> currentactivity = $sco ;
$seq -> delivery = null ;
$seq -> exception = 'SB.2.9-9' ;
return $seq ;
}
else {
return $seq ;
}
2009-11-01 15:24:58 +00:00
2007-04-27 12:20:26 +00:00
}
2007-05-03 12:55:22 +00:00
function scorm_seq_choice_flow ( $constrained , $traverse , $seq ){
2009-03-23 09:53:02 +00:00
$seq = scorm_seq_choice_flow_tree ( $constrained , $traverse , $seq );
if ( $seq -> identifiedactivity == null ){
2007-05-03 12:55:22 +00:00
$seq -> identifiedactivity = $constrained ;
2009-03-23 09:53:02 +00:00
return $seq ;
}
else {
return $seq ;
}
2007-05-03 12:55:22 +00:00
}
function scorm_seq_choice_flow_tree ( $constrained , $traverse , $seq ){
2009-03-23 09:53:02 +00:00
$islast = false ;
$parent = scorm_get_parent ( $constrained );
if ( $traverse == 'forward' ){
$preord = scorm_get_preorder ( $constrained );
if ( sizeof ( $preorder ) == 0 || ( sizeof ( $preorder ) == 0 && $preorder [ 0 ] -> id = $constrained -> id )){ // TODO: undefined
$islast = true ; //the function is the last activity available
}
if ( $constrained -> parent == '/' || $islast ){
$seq -> nextactivity = null ;
return $seq ;
}
$avchildren = scorm_get_available_children ( $parent ); //available children
if ( $avchildren [ sizeof ( $avchildren ) - 1 ] -> id == $constrained -> id ){
$seq = scorm_seq_choice_flow_tree ( $parent , 'forward' , $seq );
return $seq ;
}
else {
$i = 0 ;
while ( $i < sizeof ( $avchildren )){
if ( $avchildren [ $i ] -> id == $constrained -> id ){
$seq -> nextactivity = $avchildren [ $i + 1 ];
return $seq ;
}
else {
$i ++ ;
}
}
}
}
if ( $traverse == 'backward' ){
if ( $constrained -> parent == '/' ){
$seq -> nextactivity = null ;
return $seq ;
}
$avchildren = scorm_get_available_children ( $parent ); //available children
if ( $avchildren [ 0 ] -> id == $constrained -> id ){
$seq = scorm_seq_choice_flow_tree ( $parent , 'backward' , $seq );
return $seq ;
}
else {
$i = sizeof ( $avchildren ) - 1 ;
while ( $i >= 0 ){
if ( $avchildren [ $i ] -> id == $constrained -> id ){
$seq -> nextactivity = $avchildren [ $i - 1 ];
return $seq ;
}
else {
$i -- ;
}
}
}
}
2007-05-03 12:55:22 +00:00
}
function scorm_seq_choice_activity_traversal ( $activity , $userid , $seq , $direction ){
2009-03-23 09:53:02 +00:00
if ( $direction == 'forward' ){
$act = scorm_seq_rules_check ( $activity , 'stopforwardtraversal' );
if ( $act != null ){
$seq -> reachable = false ;
$seq -> exception = 'SB.2.4-1' ;
return $seq ;
}
$seq -> reachable = false ;
return $seq ;
}
if ( $direction == 'backward' ){
$parentsco = scorm_get_parent ( $activity );
if ( $parentsco != null ){
if ( isset ( $parentsco -> forwardonly ) && ( $parentsco -> forwardonly == true )){
$seq -> reachable = false ;
$seq -> exception = 'SB.2.4-2' ;
return $seq ;
}
else {
$seq -> reachable = false ;
$seq -> exception = 'SB.2.4-3' ;
return $seq ;
}
}
}
$seq -> reachable = true ;
return $seq ;
2007-05-03 12:55:22 +00:00
}
//Delivery Request Process
function scorm_sequencing_delivery ( $scoid , $userid , $seq ){
2009-03-23 09:53:02 +00:00
if ( ! scorm_is_leaf ( $seq -> delivery )){
$seq -> deliveryvalid = false ;
$seq -> exception = 'DB.1.1-1' ;
return $seq ;
}
$ancestors = scorm_get_ancestors ( $seq -> delivery );
2007-05-03 12:55:22 +00:00
$arrpath = array_reverse ( $ancestors );
2009-03-23 09:53:02 +00:00
array_push ( $arrpath , $seq -> delivery ); //path from the root to the target
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
if ( empty ( $arrpath )){
$seq -> deliveryvalid = false ;
$seq -> exception = 'DB.1.1-2' ;
return $seq ;
}
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
foreach ( $arrpath as $activity ){
if ( scorm_check_activity ( $activity , $userid )){
$seq -> deliveryvalid = false ;
$seq -> exception = 'DB.1.1-3' ;
return $seq ;
}
}
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
$seq -> deliveryvalid = true ;
return $seq ;
2007-05-03 12:55:22 +00:00
}
function scorm_content_delivery_environment ( $seq , $userid ){
2008-06-05 10:02:26 +00:00
global $DB ;
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
$act = $seq -> currentactivity ;
if ( scorm_seq_is ( 'active' , $act -> id , $userid )){
$seq -> exception = 'DB.2-1' ;
return $seq ;
}
$track = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $act -> id , 'userid' => $userid , 'element' => 'suspendedactivity' ));
if ( $track != null ){
2010-11-16 01:03:56 +00:00
$seq = scorm_clear_suspended_activity ( $seq -> delivery , $seq , $userid );
2009-03-23 09:53:02 +00:00
}
$seq = scorm_terminate_descendent_attempts ( $seq -> delivery , $userid , $seq );
$ancestors = scorm_get_ancestors ( $seq -> delivery );
2007-05-03 12:55:22 +00:00
$arrpath = array_reverse ( $ancestors );
2009-03-23 09:53:02 +00:00
array_push ( $arrpath , $seq -> delivery );
foreach ( $arrpath as $activity ){
if ( ! scorm_seq_is ( 'active' , $activity -> id , $userid )){
if ( ! isset ( $activity -> tracked ) || ( $activity -> tracked == 1 )){
if ( ! scorm_seq_is ( 'suspended' , $activity -> id , $userid )){
$r = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $activity -> id , 'userid' => $userid , 'element' => 'activityattemptcount' ));
$r -> value = ( $r -> value ) + 1 ;
$DB -> update_record ( 'scorm_scoes_track' , $r );
if ( $r -> value == 1 ){
scorm_seq_set ( 'activityprogressstatus' , $activity -> id , $userid , 'true' );
}
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'objectiveprogressstatus' , 'false' );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'objectivesatisfiedstatus' , 'false' );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'objectivemeasurestatus' , 'false' );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'objectivenormalizedmeasure' , 0.0 );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'attemptprogressstatus' , 'false' );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'attemptcompletionstatus' , 'false' );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'attemptabsoluteduration' , 0.0 );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'attemptexperiencedduration' , 0.0 );
scorm_insert_track ( $userid , $activity -> scorm , $activity -> id , 0 , 'attemptcompletionamount' , 0.0 );
}
}
2007-05-03 12:55:22 +00:00
scorm_seq_set ( 'active' , $activity -> id , $userid , 'true' );
2009-03-23 09:53:02 +00:00
}
}
$seq -> delivery = $seq -> currentactivity ;
scorm_seq_set ( 'suspendedactivity' , $activity -> id , $userid , 'false' );
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
//ONCE THE DELIVERY BEGINS (How should I check that?)
2007-05-03 12:55:22 +00:00
if ( isset ( $activity -> tracked ) || ( $activity -> tracked == 0 )){
2009-11-01 15:24:58 +00:00
//How should I track the info and what should I do to not record the information for the activity during delivery?
2009-03-23 09:53:02 +00:00
$atabsdur = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $activity -> id , 'userid' => $userid , 'element' => 'attemptabsoluteduration' ));
$atexpdur = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $activity -> id , 'userid' => $userid , 'element' => 'attemptexperiencedduration' ));
}
return $seq ;
2007-05-03 12:55:22 +00:00
2009-11-01 15:24:58 +00:00
2007-05-03 12:55:22 +00:00
}
2010-11-16 01:03:56 +00:00
function scorm_clear_suspended_activity ( $act , $seq , $userid ){
2008-06-05 10:02:26 +00:00
global $DB ;
2009-03-23 09:53:02 +00:00
$currentact = $seq -> currentactivity ;
$track = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $currentact -> id , 'userid' => $userid , 'element' => 'suspendedactivity' )); // TODO: undefined
if ( $track != null ){
$ancestors = scorm_get_ancestors ( $act );
2007-05-03 12:55:22 +00:00
$commonpos = scorm_find_common_ancestor ( $ancestors , $currentact );
if ( $commonpos !== false ) {
if ( $activitypath = array_slice ( $ancestors , 0 , $commonpos )) {
2009-03-23 09:53:02 +00:00
if ( ! empty ( $activitypath )){
2007-05-03 12:55:22 +00:00
foreach ( $activitypath as $activity ) {
2009-03-23 09:53:02 +00:00
if ( scorm_is_leaf ( $activity )){
scorm_seq_set ( 'suspended' , $activity -> id , $userid , false );
}
else {
$children = scorm_get_children ( $activity );
2009-11-01 15:24:58 +00:00
$bool = false ;
2009-03-23 09:53:02 +00:00
foreach ( $children as $child ){
if ( scorm_seq_is ( 'suspended' , $child -> id , $userid )){
$bool = true ;
}
}
2007-05-03 12:55:22 +00:00
if ( ! $bool ){
2009-03-23 09:53:02 +00:00
scorm_seq_set ( 'suspended' , $activity -> id , $userid , false );
}
}
}
}
}
}
scorm_seq_set ( 'suspendedactivity' , $act -> id , $userid , false );
}
2007-05-03 12:55:22 +00:00
}
function scorm_select_children_process ( $scoid , $userid ){
2008-06-05 10:02:26 +00:00
global $DB ;
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
$sco = scorm_get_sco ( $scoid );
2007-05-03 12:55:22 +00:00
if ( ! scorm_is_leaf ( $sco )){
2009-03-23 09:53:02 +00:00
if ( ! scorm_seq_is ( 'suspended' , $scoid , $userid ) && ! scorm_seq_is ( 'active' , $scoid , $userid )){
$r = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $scoid , 'userid' => $userid , 'element' => 'selectiontiming' ));
2007-05-03 12:55:22 +00:00
switch ( $r -> value ) {
case 'oneachnewattempt' :
2009-03-23 09:53:02 +00:00
case 'never' :
2007-05-03 12:55:22 +00:00
break ;
2009-11-01 15:24:58 +00:00
2007-05-03 12:55:22 +00:00
case 'once' :
if ( ! scorm_seq_is ( 'activityprogressstatus' , $scoid , $userid )){
2009-03-23 09:53:02 +00:00
if ( scorm_seq_is ( 'selectioncountsstatus' , $scoid , $userid )){
$childlist = '' ;
$res = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $scoid , 'userid' => $userid , 'element' => 'selectioncount' ));
$i = ( $res -> value ) - 1 ;
$children = scorm_get_children ( $sco );
while ( $i >= 0 ){
$pos = array_rand ( $children );
array_push ( $childlist , $children [ $pos ]);
array_splice ( $children , $pos , 1 );
$i -- ;
}
sort ( $childlist );
$clist = serialize ( $childlist );
scorm_seq_set ( 'availablechildren' , $scoid , $userid , false );
scorm_seq_set ( 'availablechildren' , $scoid , $userid , $clist );
}
}
2007-05-03 12:55:22 +00:00
break ;
2009-11-01 15:24:58 +00:00
2007-05-03 12:55:22 +00:00
}
2009-03-23 09:53:02 +00:00
}
}
2007-05-03 12:55:22 +00:00
}
function scorm_randomize_children_process ( $scoid , $userid ){
2008-06-05 10:02:26 +00:00
global $DB ;
2007-05-03 12:55:22 +00:00
2009-03-23 09:53:02 +00:00
$sco = scorm_get_sco ( $scoid );
2007-05-03 12:55:22 +00:00
if ( ! scorm_is_leaf ( $sco )){
2009-03-23 09:53:02 +00:00
if ( ! scorm_seq_is ( 'suspended' , $scoid , $userid ) && ! scorm_seq_is ( 'active' , $scoid , $userid )){
$r = $DB -> get_record ( 'scorm_scoes_track' , array ( 'scoid' => $scoid , 'userid' => $userid , 'element' => 'randomizationtiming' ));
2007-05-03 12:55:22 +00:00
switch ( $r -> value ) {
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
case 'never' :
2007-05-03 12:55:22 +00:00
break ;
2009-11-01 15:24:58 +00:00
2007-05-03 12:55:22 +00:00
case 'oneachnewattempt' :
case 'once' :
if ( ! scorm_seq_is ( 'activityprogressstatus' , $scoid , $userid )){
2009-03-23 09:53:02 +00:00
if ( scorm_seq_is ( 'randomizechildren' , $scoid , $userid )){
$childlist = array ();
$res = scorm_get_available_children ( $sco );
$i = sizeof ( $res ) - 1 ;
$children = $res -> value ;
while ( $i >= 0 ){
$pos = array_rand ( $children );
array_push ( $childlist , $children [ $pos ]);
array_splice ( $children , $pos , 1 );
$i -- ;
}
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
$clist = serialize ( $childlist );
scorm_seq_set ( 'availablechildren' , $scoid , $userid , false );
scorm_seq_set ( 'availablechildren' , $scoid , $userid , $clist );
}
}
2007-05-03 12:55:22 +00:00
break ;
2009-11-01 15:24:58 +00:00
2007-05-03 12:55:22 +00:00
}
2009-03-23 09:53:02 +00:00
}
}
2007-05-03 12:55:22 +00:00
}
2007-05-04 11:17:15 +00:00
function scorm_terminate_descendent_attempts ( $activity , $userid , $seq ){
2009-03-23 09:53:02 +00:00
$ancestors = scorm_get_ancestors ( $seq -> currentactivity );
2007-05-03 12:55:22 +00:00
$commonpos = scorm_find_common_ancestor ( $ancestors , $activity );
if ( $commonpos !== false ) {
if ( $activitypath = array_slice ( $ancestors , 1 , $commonpos - 2 )) {
2009-03-23 09:53:02 +00:00
if ( ! empty ( $activitypath )){
2007-05-03 12:55:22 +00:00
foreach ( $activitypath as $sco ) {
2009-03-23 09:53:02 +00:00
scorm_seq_end_attempt ( $sco , $userid , $seq -> attempt );
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
}
}
}
2009-11-01 15:24:58 +00:00
}
2007-05-03 12:55:22 +00:00
}
2007-05-07 12:55:31 +00:00
function scorm_sequencing_exception ( $seq ){
2009-08-18 05:16:50 +00:00
global $OUTPUT ;
2007-05-07 12:55:31 +00:00
if ( $seq -> exception != null ){
2009-03-23 09:53:02 +00:00
switch ( $seq -> exception ){
2007-05-07 12:55:31 +00:00
2009-03-23 09:53:02 +00:00
case 'NB.2.1-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has already begun " );
2007-05-08 07:25:20 +00:00
break ;
case 'NB.2.1-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has not begun " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-3' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Suspended activity is not defined " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-4' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Flow Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-5' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Flow or Forward only Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-6' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " No activity is previous to the root " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-7' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Unsupported Navigation Request " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-8' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Choice Exit Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-9' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " No activities to consider " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-10' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Choice Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-11' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Target Activity does not exist " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-12' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Current Activity already terminated " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'NB.2.1-13' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Undefined Navigation Request " );
2007-05-08 07:25:20 +00:00
break ;
2007-05-07 12:55:31 +00:00
2009-03-23 09:53:02 +00:00
case 'TB.2.3-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Current Activity already terminated " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'TB.2.3-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Current Activity already terminated " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'TB.2.3-4' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Current Activity already terminated " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'TB.2.3-5' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Nothing to suspend; No active activities " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'TB.2.3-6' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Nothing to abandon; No active activities " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.1-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Last activity in the tree " );
2007-05-08 07:25:20 +00:00
break ;
case 'SB.2.1-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Cluster has no available children " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.1-3' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " No activity is previous to the root " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.1-4' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Forward Only Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.2-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Flow Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.2-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Activity unavailable " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.3-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Forward Traversal Blocked " );
2007-05-08 07:25:20 +00:00
break ;
case 'SB.2.3-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Forward Only Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.3-3' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " No activity is previous to the root " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.5-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has already begun " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.6-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has already begun " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.6-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " No Suspended activity is defined " );
2007-05-08 07:25:20 +00:00
break ;
case 'SB.2.7-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has not begun " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.7-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Flow Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.8-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has not begun " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.8-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Flow Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " No target for Choice " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Target Activity does not exist or is unavailable " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-3' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Target Activity hidden from choice " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-4' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Choice Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-5' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " No activities to consider " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-6' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Unable to activate target; target is not a child of the Current Activity " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-7' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Choice Exit Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-8' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Unable to choose target activity - constrained choice " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.9-9' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Choice Request Prevented by Flow-only Activity " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.10-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has not begun " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.10-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Current Activity is active or suspended " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.10-3' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Flow Sequencing Control Model Violation " );
2007-05-08 07:25:20 +00:00
break ;
2009-11-01 15:24:58 +00:00
2007-05-08 07:25:20 +00:00
case 'SB.2.11-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Sequencing session has not begun " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.11-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Current Activity has not been terminated " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'SB.2.12-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Undefined Sequencing Request " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'DB.1.1-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Cannot deliver a non-leaf activity " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'DB.1.1-2' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Nothing to deliver " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'DB.1.1-3' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Activity unavailable " );
2007-05-08 07:25:20 +00:00
break ;
2009-03-23 09:53:02 +00:00
case 'DB.2-1' :
2009-08-18 05:16:50 +00:00
echo $OUTPUT -> notification ( " Identified activity is already active " );
2007-05-08 07:25:20 +00:00
break ;
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
}
2009-11-01 15:24:58 +00:00
2009-03-23 09:53:02 +00:00
}
2007-05-07 12:55:31 +00:00
}