< Previous | Contents | Next >
Sequencing Behavior Pseudo Code
This appendix includes an updated version of all of the IMS SS 1.0 pseudo code [1]. A SCORM-compliant LMS shall implement the sequencing behaviors as described in the following pseudo code. Content developers should assume the use of Sequencing Definition Model elements and ADL namespace sequencing extensions shall exhibit the behaviors detailed in this pseudo code during run-time.
Pseudo Code Index
Overall Sequencing Process [OP.1] C-3
Navigation Request Process [NB.2.1] ........................................................................................................ C-5
Sequencing Exit Action Rules Subprocess [TB.2.1] ................................................................................ C-12
Sequencing Post Condition Rules Subprocess [TB.2.2] ........................................................................... C-13
Termination Request Process [TB.2.3]..................................................................................................... C-14
Measure Rollup Process [RB.1.1 a].......................................................................................................... C-18
Completion Measure Rollup Process [RB.1.1 b]...................................................................................... C-20
Objective Rollup Using Measure Process [RB.1.2 a]............................................................................... C-21
Objective Rollup Using Rules Process [RB.1.2 b] ................................................................................... C-23
Activity Progress Rollup Using Measure Process [RB.1.3 a]................................................................... C-24
Activity Progress Rollup Using Rules Process [RB.1.3 b] ....................................................................... C-25
Rollup Rule Check Subprocess [RB.1.4].................................................................................................. C-26
Evaluate Rollup Conditions Subprocess [RB.1.4.1] ................................................................................. C-28
Check Child for Rollup Subprocess [RB.1.4.2]........................................................................................ C-29
Overall Rollup Process [RB.1.5] .............................................................................................................. C-31
Select Children Process [SR.1]................................................................................................................. C-32
Randomize Children Process [SR.2] ........................................................................................................ C-33
Flow Tree Traversal Subprocess [SB.2.1] ................................................................................................ C-34
Flow Activity Traversal Subprocess [SB.2.2] .......................................................................................... C-37
Flow Subprocess [SB.2.3] ........................................................................................................................ C-39
Choice Activity Traversal Subprocess [SB.2.4] ....................................................................................... C-40
Start Sequencing Request Process [SB.2.5].............................................................................................. C-41
Resume All Sequencing Request Process [SB.2.6] .................................................................................. C-42
Continue Sequencing Request Process [SB.2.7]....................................................................................... C-43
Previous Sequencing Request Process [SB.2.8] ....................................................................................... C-44
Choice Sequencing Request Process [SB.2.9].......................................................................................... C-45
Choice Flow Subprocess [SB.2.9.1] ......................................................................................................... C-51
Choice Flow Tree Traversal Subprocess [SB.2.9.2]................................................................................. C-52
Retry Sequencing Request Process [SB.2.10] .......................................................................................... C-53
Exit Sequencing Request Process [SB.2.11] ............................................................................................ C-54
Sequencing Request Process [SB.2.12] .................................................................................................... C-55
Jump Sequencing Request Process [SB.2.13]........................................................................................... C-58
Delivery Request Process [DB.1.1] .......................................................................................................... C-59
Content Delivery Environment Process [DB.2]........................................................................................ C-60
Clear Suspended Activity Subprocess [DB.2.1] ....................................................................................... C-62
Limit Conditions Check Process [UP.1]................................................................................................... C-63
Sequencing Rules Check Process [UP.2] ................................................................................................. C-65
Sequencing Rule Check Subprocess [UP.2.1] .......................................................................................... C-66
Terminate Descendent Attempts Process [UP.3]...................................................................................... C-67
End Attempt Process [UP.4]..................................................................................................................... C-68
Check Activity Process [UP.5] ................................................................................................................. C-70
Reference: Content Delivery Environment Process DB.2; Delivery Request Process DB.1.3; Navigation Request Process NB.2.1; Sequencing Request Process SB.2.12; Termination Request Process TB.2.3 | ||
1. | Loop - Wait for a navigation request | |
1.1. | Apply the Navigation Request Process to the navigation request | |
1.2. | If the Navigation Request Process returned navigation request Not Valid Then | |
1.2.1. | Handle the navigation request exception | Behavior not specified. |
1.2.2. | Continue Loop - wait for the next navigation request | |
End If | ||
1.3. | If there is a termination request Then | If the current activity is active, end the attempt on the current activity. |
1.3.1. | Apply the Termination Request Process to the termination request | |
1.3.2. | If the Termination Request Process returned termination request Not Valid Then | |
1.3.2.1. | Handle the termination request exception | Behavior not specified. |
1.3.2.2. | Continue Loop - wait for the next navigation request | |
End If | ||
1.3.3. | If Termination Request Process returned a sequencing request Then | |
1.3.3.1. | Replace any pending sequencing request by the sequencing request returned by the Termination Request Process | There can only be one pending sequencing request. Use the one returned by the termination request process, if it exists. |
End If | ||
End If | ||
1.4. | If there is a sequencing request Then | |
1.4.1. | Apply the Sequencing Request Process to the sequencing request | |
1.4.2. | If the Sequencing Request Process returned sequencing request Not Valid Then | |
1.4.2.1. | Handle the sequencing request exception | Behavior not specified. |
1.4.2.2. | Continue Loop - wait for the next navigation request | |
End If | ||
1.4.3. | If the Sequencing Request Process returned a request to end the sequencing session Then | |
1.4.3.1. | Exit Overall Sequencing Process - the sequencing session has terminated; return control to LTS | Exiting from the root of the activity tree ends the sequencing session; return control to the LTS. |
End If | ||
1.4.4. | If the Sequencing Request Process did not identify an activity for delivery Then | |
1.4.4.1. | Continue Loop - wait for the next navigation request |
Overall Sequencing Process [OP.1] | ||
End If | ||
1.4.5. | delivery request is for the activity identified by the Sequencing Request Process | |
End If | ||
1.5. | If there is a delivery request Then | |
1.5.1. | Apply the Delivery Request Process to the delivery request | |
1.5.2. | If the Delivery Request Process returned delivery request Not Valid Then | |
1.5.2.1. | Handle the delivery request exception | Behavior not specified. |
1.5.2.2. | Continue Loop - wait for the next navigation request | |
End If | ||
1.5.3. | Apply the Content Delivery Environment Process to the delivery request | |
End If | ||
2. | End Loop - wait for the next navigation request |
pseudo code for overall sequencing process
Navigation Request Process [NB.2.1] For a navigation request and possibly a specified activity, returns the validity of the navigation request; may return a termination request, a sequencing request, and/or a target activity; may return an exception code: | ||
Reference: Current Activity AM.1.2; Sequencing Control Choice SM.1; Sequencing Control Choice Exit SM.1; Sequencing Control Flow SM.1; Sequencing Control Forward Only SM.1; Available Children AM.1.1; Suspended Activity AM.1.2 | ||
1. | Case: navigation request is Start | |
1.1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has not already begun. |
1.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: n/a; Sequencing Request: Start; Target Activity: n/a; Exception: n/a) | |
1.2. | Else | |
1.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-1) | |
End If | ||
End Case | ||
2. | Case: navigation request is Resume All | |
2.1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has not already begun. |
2.1.1. | If the Suspended Activity is Defined Then | Make sure the previous sequencing session ended with a suspend all request. |
2.1.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: n/a; Sequencing Request: Resume All; Target Activity: n/a; Exception: n/a) | |
2.1.2. | Else | |
2.1.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-3) | |
End If | ||
2.2. | Else | |
2.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-1) | |
End If | ||
End Case | ||
3. | Case: navigation request is Continue | |
3.1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has already begun. |
3.1.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-2) | |
End If | ||
3.2. | If the Current Activity is not the root of the activity tree And the | Validate that a |
Navigation Request Process [NB.2.1] For a navigation request and possibly a specified activity, returns the validity of the navigation request; may return a termination request, a sequencing request, and/or a target activity; may return an exception code: | ||
Sequencing Control Flow for the parent of the Current Activity is True Then | ‘flow’ sequencing request can be processed from the current activity. | |
3.2.1. | If the Activity is Active for the Current Activity is True Then | If the current activity has not been terminated, terminate the current the activity. |
3.2.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Exit; Sequencing Request: Continue; Target Activity: n/a; Exception: n/a) | |
3.2.2. | Else | |
3.2.2.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: n/a; Sequencing Request: Continue; Target Activity: n/a; Exception: n/a) | |
End If | ||
3.3. | Else | |
3.3.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-4) | Flow is not enabled or the current activity is the root of the activity tree. |
End If | ||
End Case | ||
4. | Case: navigation request is Previous | |
4.1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has already begun. |
4.1.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-2) | |
End If | ||
4.2. | If the Current Activity is not the root of the activity tree Then | There is no activity logically ‘previous’ to the root of the activity tree. |
4.2.1. | If the Sequencing Control Flow for the parent of the Current Activity is True And the Sequencing Control Forward Only for the parent of the Current Activity is False Then | Validate that a ‘flow’ sequencing request can be processed from the current activity. |
4.2.1.1. | If the Activity is Active for the Current Activity is True Then | If the current activity has not been terminated, terminate the current the activity. |
4.2.1.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Exit; Sequencing Request: Previous; Target Activity: n/a; Exception: n/a) | |
4.2.1.2. | Else |
Navigation Request Process [NB.2.1] For a navigation request and possibly a specified activity, returns the validity of the navigation request; may return a termination request, a sequencing request, and/or a target activity; may return an exception code: | ||
4.2.1.2.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: n/a; Sequencing Request: Previous; Target Activity: n/a; Exception: n/a) | |
End If | ||
4.2.2. | Else | |
4.2.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-5) | Violates control mode. |
End If | ||
4.3. | Else | |
4.3.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-6) | Cannot move backward from the root of the activity tree. |
End If | ||
End Case | ||
5. | Case: navigation request is Forward | Behavior not defined. |
5.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-7) | |
End Case | ||
6. | Case: navigation request is Backward | Behavior not defined. |
6.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-7) | |
End Case | ||
7. | Case: navigation request is Choice | |
7.1. | If the activity specified by the Choice navigation request exists within the activity tree Then | Make sure the target activity exists in the activity tree. |
7.1.1. | If the activity specified by the Choice navigation request is the root of the activity tree Or the Sequencing Control Choice for the parent of the activity specified by the Choice navigation request is True Then | Validate that a ‘choice’ sequencing request can be processed on the target activity. |
7.1.1.1. | If the Current Activity is Not Defined Then | Attempt to start the sequencing session through choice. |
7.1.1.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: n/a; Sequencing Request: Choice; Target Activity: the activity specified by the Choice navigation request; Exception: n/a) | |
End If | ||
7.1.1.2. | If the activity specified by the Choice navigation request is Not a sibling of the Current Activity Then | . |
Navigation Request Process [NB.2.1] For a navigation request and possibly a specified activity, returns the validity of the navigation request; may return a termination request, a sequencing request, and/or a target activity; may return an exception code: | ||
7.1.1.2.1. | Find the common ancestor of the Current Activity and the activity specified by the Choice navigation request | |
7.1.1.2.2. | Form the activity path as the ordered series of activities from the Current Activity to the common ancestor. | The common ancestor will not terminate as a result of processing the choice sequencing request, unless the common ancestor is the Current Activity – the current activity should always be included in the activity path. |
7.1.1.2.3. | If the activity path is Not Empty Then | |
7.1.1.2.3.1. | For each activity in the activity path | Make sure that ‘choosing’ the target will not force an active activity to terminate, if that activity does not allow choice to terminate it. |
7.1.1.2.3.1.1. | If Activity is Active for the activity is True And the Sequencing Control Choice Exit for the activity is False Then | |
7.1.1.2.3.1.1.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-8) | Violates control mode. |
End If | ||
End For | ||
7.1.1.2.4. | Else | |
7.1.1.2.4.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-9) | |
End If | ||
End If | ||
7.1.1.3. | If Activity is Active for the Current Activity is True And the Sequencing Control Choice Exit for the Current Activity is False Then | The Choice target is a sibling to the Current Activity, check if the Current Activity is allowed to exit. |
7.1.1.3.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception NB.2.1-8) | Violates control mode. |
Navigation Request Process [NB.2.1] For a navigation request and possibly a specified activity, returns the validity of the navigation request; may return a termination request, a sequencing request, and/or a target activity; may return an exception code: | ||
End If | ||
7.1.1.4. | If the Activity is Active for the Current Activity is True Then | If the current activity has not been terminated, terminate the current the activity. |
7.1.1.4.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Exit; Sequencing Request: Choice; Target Activity: the activity specified by the Choice navigation request; Exception: n/a) | |
7.1.1.5. | Else | |
7.1.1.5.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: n/a; Sequencing Request: Choice; Target Activity: the activity specified by the Choice navigation request; Exception: n/a) | |
End If | ||
7.1.2. | Else | |
7.1.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Termination Request: n/a; Sequencing Request: n/a; Target Activity: n/a; Exception: NB.2.1-10) | Violates control mode. |
End If | ||
7.2. | Else | |
7.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-11) | Target activity does not exist. |
End If | ||
End Case | ||
8. | Case: navigation request is Exit | |
8.1. | If the Current Activity is Defined Then | Make sure the sequencing session has already begun. |
8.1.1. | If the Activity is Active for the Current Activity is True Then | Make sure the current activity has not already been terminated. |
8.1.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Exit; Sequencing Request: Exit; Target Activity: n/a) ; Exception: n/a) | |
8.1.2. | Else | |
8.1.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-12) | Activity has already terminated. |
End If | ||
8.2. | Else | |
8.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-2) | |
End If | ||
End Case |
Navigation Request Process [NB.2.1] For a navigation request and possibly a specified activity, returns the validity of the navigation request; may return a termination request, a sequencing request, and/or a target activity; may return an exception code: | ||
9. | Case: navigation request is Exit All | |
9.1. | If the Current Activity is Defined Then | If the sequencing session has already begun, unconditionally terminate all active activities. |
9.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Exit All; Sequencing Request: Exit; Target Activity: n/a; Exception: n/a) | |
9.2. | Else | |
9.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-2) | |
End If | ||
End Case | ||
10. | Case: navigation request is Abandon | |
10.1. | If the Current Activity is Defined Then | Make sure the sequencing session has already begun. |
10.1.1. | If the Activity is Active for the Current Activity is True Then | Make sure the current activity has not already been terminated. |
10.1.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Abandon; Sequencing Request: Exit; Target Activity: n/a; Exception: n/a) | |
10.1.2. | Else | |
10.1.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-12) | |
End If | ||
10.2. | Else | |
10.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-2) | |
End If | ||
End Case | ||
11. | Case: navigation request is Abandon All | |
11.1. | If the Current Activity is Defined Then | If the sequencing session has already begun, unconditionally abandon all active activities. |
11.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Abandon All; Sequencing Request: Exit; Target Activity: n/a; Exception: n/a) | |
11.2. | Else | |
11.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; |
Navigation Request Process [NB.2.1] For a navigation request and possibly a specified activity, returns the validity of the navigation request; may return a termination request, a sequencing request, and/or a target activity; may return an exception code: | ||
Target Activity: n/a; Exception: NB.2.1-2) | ||
End If | ||
End Case | ||
12. | Case: navigation request is Suspend All | |
12.1. | If the Current Activity is Defined Then | If the sequencing session has already begun. |
12.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Suspend All; Sequencing Request: Exit; Target Activity: n/a; Exception: n/a) | |
12.2. | Else | |
12.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-2) | |
End If | ||
End Case | ||
13. | Case: navigation request is Jump | |
13.1. | If the activity specified by the Jump navigation request exists within the activity tree And Available Children for the parent of the activity contains the activity Then | Make sure the target activity exists in the activity tree and is available |
13.1.1. | Exit Navigation Request Process (Navigation Request: Valid; Termination Request: Exit; Sequencing Request: Jump; Target Activity: the activity specified by the Jump navigation request; Exception: n/a) | |
13.2. | Else | |
13.2.1. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-11) | Target activity does not exist. |
End If | ||
End Case | ||
14. | Exit Navigation Request Process (Navigation Request: Not Valid; Sequencing Request: n/a; Termination Request: n/a; Target Activity: n/a; Exception: NB.2.1-13) | Undefined navigation request. |
pseudo code for navigation request process
Sequencing Exit Action Rules Subprocess [TB.2.1] For the Current Activity; may change the Current Activity: | ||
Reference: Current Activity AM.1.2; End Attempt Process UP.4; Sequencing Rules Check Process UP.2; Sequencing Rule Description SM.2; Terminate Descendent Attempts Process UP.3 | ||
1. | Form the activity path as the ordered series of activities from the root of the activity tree to the parent of the Current Activity, inclusive | |
2. | Initialize exit target to Undefined | |
3. | For each activity in the activity path | Evaluate all exit rules along the active path, starting at the root of the activity tree. |
3.1. | Apply the Sequencing Rules Check Process to the activity and the set of Exit actions | |
3.2. | If the Sequencing Rules Check Process does not return Nil Then | |
3.2.1. | Set the exit target to the activity | Stop at the first activity that has an exit rule evaluating to true. |
3.2.2. | Break For | |
End If | ||
End For | ||
4. | If exit target is Not Undefined Then | |
4.1. | Apply the Terminate Descendent Attempts Process to the exit target | End the current attempt on all active descendents. |
4.2. | Apply the End Attempt Process to the exit target | End the current attempt on the ‘exiting’ activity. |
4.3. | Set the Current Activity to the exit target | Move the current activity to the activity that identified for termination. |
End If | ||
5. | Exit Sequencing Exit Action Rules Subprocess |
pseudo code for sequencing exit action rules subprocess
Sequencing Post Condition Rules Subprocess [TB.2.2] For the Current Activity; may return a termination request and a sequencing request: | ||
Reference: Activity is Suspended AM.1.1; Current Activity AM.1.2; Sequencing Rules Check Process UP.2; Sequencing Rule Description SM.2 | ||
1. | If Activity is Suspended for the Current Activity is True Then | Do not apply post condition rules to a suspended activity. |
1.1. | Exit Sequencing Post Condition Rules Subprocess | |
End If | ||
2. | Apply the Sequencing Rules Check Process to the Current Activity and the set of Post Condition actions | Apply the post condition rules to the current activity. |
3. | If the Sequencing Rules Check Process does not return Nil Then | |
3.1. | If the Sequencing Rules Check Process returned Retry, Continue, Or Previous Then | |
3.1.1. | Exit Sequencing Post Condition Rules Subprocess (Termination Request: n/a; Sequencing Request: the value returned by the Sequencing Rules Check Process) | Attempt to override any pending sequencing request with this one. |
End If | ||
3.2. | If the Sequencing Rules Check Process returned Exit Parent Or Exit All Then | |
3.2.1. | Exit Sequencing Post Condition Rules Subprocess (Termination Request: the value returned by the Sequencing Rules Check Process Sequencing Request: n/a;) | Terminate the appropriate activity(ies). |
End If | ||
3.3. | If the Sequencing Rules Check Process returned Retry All Then | |
3.3.1. | Exit Sequencing Post Condition Rules Subprocess (Termination Request: Exit All; Sequencing Request: Retry) | Terminate all active activities and move the current activity to the root of the activity tree; then perform an ‘in-process’ start. |
End If | ||
End If | ||
4. | Exit Sequencing Post Condition Rules Subprocess (Termination Request: n/a; Sequencing Request: n/a;) |
pseudo code for sequencing post condition rules subprocess
Termination Request Process [TB.2.3] For a termination request, ends the current attempt on the Current Activity; returns the validity of the termination request; may return a sequencing request; may return an exception code: | ||
Reference: Activity is Active AM.1.1; Activity is Suspended AM.1.1; Current Activity AM.1.2; End Attempt Process UP.4; Sequencing Exit Action Rules Subprocess TB.2.1; Sequencing Post Condition Rules Subprocess TB.2.2; Terminate Descendent Attempts Process UP.3 | ||
1. | If the Current Activity is Not Defined Then | If the sequencing session has not begun, there is nothing to terminate. |
1.1. | Exit Termination Request Process (Termination Request: Not Valid; Sequencing Request: n/a; Exception: TB.2.3-1) | |
End If | ||
2. | If (the termination request is Exit Or Abandon) And Activity is Active for the Current Activity is False Then | If the current activity has already been terminated, there is nothing to terminate. |
2.1. | Exit Termination Request Process (Termination Request: Not Valid; Sequencing Request: n/a; Exception: TB.2.3-2) | |
End If | ||
3. | Case: termination request is Exit | |
3.1. | Apply the End Attempt Process to the Current Activity | Ensure the state of the current activity is up to date. |
3.2. | Apply the Sequencing Exit Action Rules Subprocess to the Current Activity | Check if any of the current activity’s ancestors need to terminate. |
3.3. | Repeat | |
3.3.1. | Set the processed exit to False | |
3.3.2. | Apply the Sequencing Post Condition Rules Subprocess to the Current Activity | |
3.3.3. | If the Sequencing Post Condition Rule Subprocess returned a termination request of Exit All Then | |
3.3.3.1. | Change the termination request to Exit All | |
3.3.3.2. | Break to the next Case | Process an Exit All Termination Request. |
End If | ||
3.3.4. | If the Sequencing Post Condition Rule Subprocess returned a termination request of Exit Parent Then | If we exit the parent of the current activity, move the current activity to the parent of the current activity. |
3.3.4.1. | If the Current Activity is Not the root of the activity tree Then | The root of the activity tree does not have a parent to exit. |
Termination Request Process [TB.2.3] For a termination request, ends the current attempt on the Current Activity; returns the validity of the termination request; may return a sequencing request; may return an exception code: | ||
3.3.4.1.1. | Set the Current Activity to the parent of the Current Activity | |
3.3.4.1.2. | Apply the End Attempt Process to the Current Activity | |
3.3.4.1.3. | Set processed exit to True | Need to evaluate post conditions on the new current activity. |
3.3.4.2. | Else | |
3.3.4.2.1. | Exit Termination Request Process (Termination Request: Not Valid; Sequencing Request: n/a; Exception: TB.2.3-4) | |
End If | ||
3.3.5. | Else | |
3.3.5.1. | If the Current Activity is the Root of the Activity Tree And the sequencing request returned by the Sequencing Post Condition Rule Subprocess is Not Retry Then | If the attempt on the root of the Activity Tree is ending without a Retry, the Sequencing Session also ends. |
3.3.5.1.1. | Exit Termination Request Process (Termination Request: Valid; Sequencing Request: Exit; Exception: n/a) | |
End If | ||
End If | ||
3.4. | Until processed exit is False | |
3.5. | Exit Termination Request Process (Termination Request: Valid; Sequencing Request: is the sequencing request returned by the Sequencing Post Condition Rule Subprocess, if one exists, otherwise n/a; Exception: n/a) | |
End Case | ||
4. | Case: termination request is Exit All | |
4.1. | If Activity is Active for the Current Activity is True Then | Has the completion subprocess and rollup been applied to the current activity yet? |
4.1.1. | Apply the End Attempt Process to the Current Activity | |
End If | ||
4.2. | Apply the Terminate Descendent Attempts Process to the root of the activity tree | |
4.3. | Apply the End Attempt Process to the root of the activity tree | |
4.4. | Set the Current Activity to the root of the activity tree | Move the current activity to the root of the activity tree. |
4.5. | Exit Termination Request Process (Termination Request: Valid; Sequencing Request: Exit; Exception: n/a) | Inform the sequencer that the sequencing session has ended. |
End Case | ||
5. | Case: termination request is Suspend All |
Termination Request Process [TB.2.3] For a termination request, ends the current attempt on the Current Activity; returns the validity of the termination request; may return a sequencing request; may return an exception code: | ||
5.1. | If (the Activity is Active for the Current Activity is True) Or (the Activity is Suspended for the Current Activity is True) Then | If the current activity is active or already suspended, suspend it and all of its descendents. |
5.1.1. | Apply the Overall Rollup Process to the activity | Ensure that any status change to this activity is propagated through the entire activity tree. |
5.1.2. | Set the Suspended Activity to the Current Activity | |
5.2. | Else | |
5.2.1. | If the Current Activity is not the root of the activity tree Then | Make sure the current activity is not the root of the activity tree. |
5.2.1.1. | Set the Suspended Activity to the parent of the Current Activity | |
5.2.2. | Else | |
5.2.2.1. | Exit Termination Request Process (Termination Request: Not Valid; Sequencing Request: n/a; Exception: TB.2.3-3) | Nothing to suspend. |
End If | ||
End If | ||
5.3. | Form the activity path as the ordered series of all activities from the Suspended Activity to the root of the activity tree, inclusive | |
5.4. | If the activity path is Empty Then | |
5.4.1. | Exit Termination Request Process (Termination Request: Not Valid; Sequencing Request: n/a; Exception: TB.2.3-5) | Nothing to suspend. |
End If | ||
5.5. | For each activity in the activity path | |
5.5.1. | Set Activity is Active for the activity to False | |
5.5.2. | Set Activity is Suspended for the activity to True | |
End For | ||
5.6. | Set the Current Activity to the root of the activity tree | Move the current activity to the root of the activity tree. |
5.7. | Exit Termination Request Process (Termination Request: Valid; Sequencing Request: Exit; Exception: n/a) | Inform the sequencer that the sequencing session has ended. |
End Case | ||
6. | Case: termination request is Abandon | |
6.1. | Set Activity is Active for the Current Activity to False | |
6.2. | Exit Termination Request Process (Termination Request: Valid; Sequencing Request: n/a; Exception: n/a) | |
End Case | ||
7. | Case: termination request is Abandon All | |
7.1. | Form the activity path as the ordered series of all activities from the Current Activity to the root of the activity tree, inclusive | |
7.2. | If the activity path is Empty Then |
Termination Request Process [TB.2.3] For a termination request, ends the current attempt on the Current Activity; returns the validity of the termination request; may return a sequencing request; may return an exception code: | ||
7.2.1. | Exit Termination Request Process (Termination Request: Not Valid; Sequencing Request: n/a; Exception: TB.2.3-6) | Nothing to abandon. |
End If | ||
7.3. | For each activity in the activity path | |
7.3.1. | Set Activity is Active for the activity to False | |
End For | ||
7.4. | Set the Current Activity to the root of the activity tree | Move the current activity to the root of the activity tree. |
7.5. | Exit Termination Request Process (Termination Request: Valid; Sequencing Request: Exit; Exception: n/a) | Inform the sequencer that the sequencing session has ended. |
End Case | ||
8. | Exit Termination Request Process (Termination Request: Not Valid; Sequencing Request: n/a; Exception: TB.2.3-7) | Undefined termination request. |
pseudo code for termination request process
Measure Rollup Process [RB.1.1 a] For an activity; may change the Objective Information for the activity: | ||
Reference: Objective Contributes to Rollup SM.6; Objective Description SM.6; Objective Measure Status TM.1.1; Objective Normalized Measure TM.1.1; Rollup Objective Measure Weight SM.8; Tracked SM.11 | ||
1. | Set the total weighted measure to Zero (0.0) | |
2. | Set valid data to False | |
3. | Set the counted measures to Zero (0.0) | |
4. | Set the target objective to Undefined | |
5. | For each objective associated with the activity | |
5.1. | If Objective Contributes to Rollup for the objective is True Then | Find the target objective for the rolled-up measure. |
5.1.1. | Set the target objective to the objective | |
5.1.2. | Break For | |
End If | ||
End For | ||
6. | If target objective is Defined Then | |
6.1. | For each child of the activity | |
6.1.1. | If Tracked for the child is True Then | Only include tracked children. |
6.1.1.1. | Set rolled-up objective to Undefined | |
6.1.1.2. | For each objective associated with the child | |
6.1.1.2.1. | If Objective Contributes to Rollup for the objective is True Then | |
6.1.1.2.1.1. | Set rolled-up objective to the objective | |
6.1.1.2.1.2. | Break For | |
End If | ||
End For | ||
6.1.1.3. | If rolled-up objective is Defined Then | |
6.1.1.3.1. | Increment counted measures by the Rollup Objective Measure Weight for the child | |
6.1.1.3.2. | If the Objective Measure Status for the rolled-up objective is True Then | |
6.1.1.3.2.1. | Add the product of Objective Normalized Measure for the rolled-up objective multiplied by the Rollup Objective Measure Weight for the child to the total weighted measure | |
6.1.1.3.2.2 | Set valid data to True | |
End If | ||
6.1.1.4. | Else | |
6.1.1.4.1. | Exit Measure Rollup Process | One of the children does not include a rolled-up objective. |
End If | ||
End If | ||
End For | ||
6.2. | If valid data is False Then | |
6.2.1. | Set the Objective Measure Status for the target objective to False | No tracking state rolled-up, cannot determine the rolled-up measure. |
Measure Rollup Process [RB.1.1 a] For an activity; may change the Objective Information for the activity: | ||
6.3 | Else | |
6.3.1 | If counted measures is greater than (>) Zero (0.0) Then | Set the rolled-up measure for the target objective. |
6.3.1.1 | Set the Objective Measure Status for the target objective to True | |
6.3.1.2. | Set the Objective Normalized Measure for the target objective to the total weighted measure divided by counted measures | |
6.3.2. | Else | |
6.3.2.1 | Set the Objective Measure Status for the target objective to False | No children contributed weight. |
End If | ||
End If | ||
End If | ||
7. | Exit Measure Rollup Process | No objective contributes to rollup, so we cannot set anything. |
pseudo code for measure rollup process
Completion Measure Rollup Process [RB.1.1 b] For an activity; may change the Objective Information for the activity: | ||
Reference: Attempt Completion Amount Status TM.1.1; Attempt Completion Amount TM.1.1; Tracked SM.11; adlcp:minProgressMeasure; adlcp:progressWeight | ||
1. | Set the total weighted measure to Zero (0.0) | |
2. | Set valid data to False | |
3. | Set the counted measures to Zero (0.0) | |
4. | For each child of the activity | |
4.1. | If Tracked for the child is True Then | Only include tracked children. |
4.1.1. | Increment counted measures by the adlcp:progressWeight for the child | The child is included, account for it in the weighted average |
4.1.2. | If the Attempt Completion Amount Status is True Then | |
4.1.2.1. | Add the product of Attempt Completion Amount multiplied by the adlcp:progressWeight to the total weighted measure | Only include progress that has been reported or previously rolled- up |
4.1.2.2. | Set valid data to True | |
End If | ||
End If | ||
End For | ||
5. | If valid data is False Then | |
5.1. | Set the Attempt Completion Amount Status to False | No progress state rolled-up, cannot determine the rolled-up progress. |
5.2. | Else | |
5.2.1. | If counted measures is greater than (>) Zero (0.0) Then | Set the rolled-up progress. |
5.2.1.1. | Set the Attempt Completion Amount Status to True | |
5.2.1.2. | Set the Attempt Completion Amount to the total weighted measure divided by counted measures | |
5.2.2. | Else | |
5.2.2.1. | Set the Attempt Completion Amount Status for the target objective to False | No children contributed weight. |
End If | ||
6. | Exit Completion Measure Rollup Process |
pseudo code for completion measure rollup process
Objective Rollup Using Measure Process [RB.1.2 a] For an activity; may change the Objective Information for the activity: | ||
Reference: Objective Contributes to Rollup SM.6; Objective Description SM.6; Objective Satisfied by Measure SM.6; Objective Measure Status TM.1.1; Objective Normalized Measure TM.1.1; Objective Progress Status TM.1.1; Objective Satisfied Status TM.1.1; Activity is Active AM.1.1; adlseq:measureSatisfactionIfActive SCORM SN. | ||
1. | Set the target objective to Undefined | |
2. | For each objective associated with the activity | |
2.1. | If Objective Contributes to Rollup for the objective is True Then | Identify the objective that may be altered based on the activity’s children’s rolled- up measure. |
2.1.1. | Set the target objective to the objective | |
2.1.2. | Break For | |
End If | ||
End For | ||
3. | If target objective is Defined Then | |
3.1. | If Objective Satisfied by Measure for the target objective is True Then | If the objective is satisfied by measure, test the rolled-up measure against the defined threshold. |
3.1.1. | If the Objective Measure Status for the target objective is False Then | No Measure known, so objective status is unreliable. |
3.1.1.1. | Set the Objective Progress Status for the target objective to False | |
3.1.2. | Else | |
3.1.2.1. | If Activity is Active for the activity is False Or (Activity is Active for the activity is True And adlseq:measureSatisfactionIfActive for the activity is True ) Then | |
3.1.2.1.1. | If the Objective Normalized Measure for the target objective is greater than or equal (>=) to the Objective Minimum Satisfied Normalized Measure for the target objective Then | |
3.1.2.1.1.1. | Set the Objective Progress Status for the target objective to True | |
3.1.2.1.1.2. | Set the Objective Satisfied Status for the target objective to True | |
3.1.2.1.2. | Else | |
3.1.2.1.2.1. | Set the Objective Progress Status for the target objective to True | |
3.1.2.1.2.2. | Set the Objective Satisfied Status for the target objective to False | |
End If | ||
3.1.2.2. | Else |
Objective Rollup Using Measure Process [RB.1.2 a] For an activity; may change the Objective Information for the activity: | ||
3.1.2.2.1. | Set the Objective Progress Status for the target objective to False | Incomplete information, do not evaluate objective status. |
End If | ||
End If | ||
End If | ||
3.2. | Exit Objective Rollup Using Measure Process | |
4. | Else | |
4.1. | Exit Objective Rollup Using Measure Process | No objective contributes to rollup, so we cannot set anything. |
End If |
pseudo code for objective rollup using measure process
Objective Rollup Using Rules Process [RB.1.2 b] For an activity; may change the Objective Information for the activity: | ||
Reference: Section: Objective Contributes to Rollup SM.6; Objective Description SM.6; Objective Progress Status TM.1.1; Objective Satisfied Status TM.1.1; Rollup Rule Check Subprocess RB.1.4; Rollup Action SM.5; Rollup Condition SM.5; Rollup Action SM.5; Rollup Child Activity Set SM.5 | ||
1. | If the activity does not include Rollup Rules with the Not Satisfied rollup action And the activity does not include Rollup Rules with the Satisfied rollup action Then | If no objective rollup rules are defined, use the default rollup rules. |
1.1. | Apply a Rollup Rule to the activity with a Rollup Child Activity Set of All; a Rollup Condition of Satisfied; and a Rollup Action of Satisfied | Define the default satisfied rule |
1.2. | Apply a Rollup Rule to the activity with a Rollup Child Activity Set of All; a Rollup Condition of Objective Status Known; and a Rollup Action of Not Satisfied | Define the default not satisfied rule |
End If | ||
2. | Set the target objective to Undefined | |
3. | For each objective associated with the activity | |
3.1. | If Objective Contributes to Rollup for the objective is True Then | Identify the objective that may be altered based on the activity’s children’s rolled-up status. |
3.1.1. | Set the target objective to the objective | |
3.1.2. | Break For | |
End If | ||
End For | ||
4. | If target objective is Defined Then | |
4.1. | Apply the Rollup Rule Check Subprocess to the activity and the Not Satisfied rollup action | Process all Not Satisfied rules first. |
4.2. | If the Rollup Rule Check Subprocess returned True Then | |
4.2.1. | Set the Objective Progress Status for the target objective to True | |
4.2.2. | Set the Objective Satisfied Status for the target objective to False | |
End If | ||
4.3. | Apply the Rollup Rule Check Subprocess to the activity and the Satisfied rollup action | Process all Satisfied rules last. |
4.4. | If the Rollup Rule Check Subprocess returned True Then | |
4.4.1. | Set the Objective Progress Status for the target objective to True | |
4.4.2. | Set the Objective Satisfied Status for the target objective to True | |
End If | ||
4.5. | Exit Objective Rollup Using Rules Process | |
5. | Else | |
5.1. | Exit Objective Rollup Using Rules Process | No objective contributes to rollup, so we cannot set anything. |
End If |
pseudo code for objective rollup using rules process
Activity Progress Rollup Using Measure Process [RB.1.3 a] For an activity; may change the Attempt Information for the activity: | ||
Reference: Attempt Completion Status TM.1.2.2; Attempt Progress Status TM.1.2.2; Attempt Completion Amount Status TM.1.1; Attempt Completion Amount TM.1.1; adlcp:completedbyMeaseure SCORM CAM; adlcp:minProgressMeasure SCORM CAM | ||
1. | Set Attempt Progress Status to False | |
2. | Set Attempt Completion Status to False | |
3. | If adlcp:completedbyMeasure for the target activity is True Then | If the completion is determined by measure, test the rolled-up progress against the defined threshold. |
3.1. | If the Attempt Completion Amount Status is False Then | No progress amount known, so the status is unreliable. |
3.1.1. | Set the Attempt Completion Status to False | |
3.2. | Else | |
3.2.1. | If the Attempt Completion Amount is greater than or equal (>=) to the adlcp:minProgressMeasure Then | |
3.2.1.1. | Set the Attempt Progress Status True | |
3.2.1.2. | Set the Attempt Completion Status to True | |
3.2.2. | Else | |
3.2.2.1. | Set the Attempt Progress Status True | |
3.2.2.2. | Set the Attempt Completion Status to False | |
End If | ||
4. | Else | |
4.1. | Set the Attempt Progress Status False | Incomplete information, do not evaluate completion status. |
End If | ||
5. | Exit Activity Progress Rollup Using Measure Process |
pseudo code for activity progress rollup using measure process
Activity Progress Rollup Using Rules Process [RB.1.3 b] For an activity; may change the Attempt Information for the activity: | ||
Reference: Attempt Completion Status TM.1.2.2; Attempt Progress Status TM.1.2.2; Rollup Rule Check Subprocess RB.1.4; Rollup Action SM.5; Rollup Condition SM.5; Rollup Action SM.5; Rollup Child Activity Set SM.5 | ||
1. | If the activity does not include Rollup Rules with the Incomplete rollup action And the activity does not include Rollup Rules with the Completed rollup action Then | If no progress rollup rules are defined, use the default rollup rules. |
1.1. | Apply a Rollup Rule to the activity with a Rollup Child Activity Set of All; a Rollup Condition of Completed; and a Rollup Action of Completed | Define the default completed rule |
1.2. | Apply a Rollup Rule to the activity with a Rollup Child Activity Set of All; a Rollup Condition of Activity Progress Known; and a Rollup Action of Incomplete | Define the default not incomplete rule |
End If | ||
2. | Apply the Rollup Rule Check Subprocess to the activity and the Incomplete rollup action | Process all Incomplete rules first. |
3. | If the Rollup Rule Check Subprocess returned True Then | |
3.1. | Set the Attempt Progress Status for the activity to True | |
3.2. | Set the Attempt Completion Status for the activity to False | |
End If | ||
4. | Apply the Rollup Rule Check Subprocess to the activity and the Completed rollup action | Process all Completed rules last. |
5. | If the Rollup Rule Check Subprocess returned True Then | |
5.1. | Set the Attempt Progress Status for the activity to True | |
5.2. | Set the Attempt Completion Status for the activity to True | |
End If | ||
6. | Exit Activity Progress Rollup Process |
pseudo code for activity progress rollup using rules process
Rollup Rule Check Subprocess [RB.1.4] For an activity and a Rollup Action; returns True if the action applies: | ||
Reference: Check Child for Rollup Subprocess RB.1.4.2; Evaluate Rollup Conditions Subprocess RB.1.4.1; Rollup Action SM.5; Rollup Child Activity Set SM.5; Rollup Minimum Count SM.5; Rollup Minimum Percent SM.5; Rollup Rule Description SM.5; Tracked SM.11; Tracking Model TM | ||
1. | If the activity includes Rollup Rules with the specified Rollup Action Then | Make sure the activity has rules to evaluate. |
1.1. | Initialize rules list by selecting the set of Rollup Rules for the activity that have the specified Rollup Action, maintaining original rule ordering | |
1.2. | For each rule in the rules list | |
1.2.1. | Initialize contributing children bag as an empty collection | |
1.2.2. | For each child of the activity | |
1.2.2.1. | If Tracked for the child is True Then | |
1.2.2.1.1. | Apply Check Child for Rollup Subprocess to the child and the Rollup Action | Make sure this child contributes to the status of its parent. |
1.2.2.1.2. | If Check Child for Rollup Subprocess returned True Then | |
1.2.2.1.2.1. | Apply the Evaluate Rollup Conditions Subprocess to the child, the Condition Combination, and the Rollup Conditions for the rule | Evaluate the rollup conditions on the child activity. |
1.2.2.1.2.2. | If Evaluate Rollup Conditions Subprocess returned Unknown Then | Account for a possible “unknown” condition evaluation. |
1.2.2.1.2.2.1. | Add an Unknown value to the contributing children bag | |
1.2.2.1.2.3. | Else | |
1.2.2.1.2.3.1. | If Evaluate Rollup Conditions Subprocess returned True Then | |
1.2.2.1.2.3.1.1. | Add a True value to the contributing children bag | |
1.2.2.1.2.3.2. | Else | |
1.2.2.1.2.3.2.1. | Add a False value to the contributing children bag | |
End If | ||
End If | ||
End If | ||
End If | ||
End For | ||
1.2.3. | Initialize status change to False | Determine if the appropriate children contributed to rollup; if they did, the status of the activity should be changed. |
Rollup Rule Check Subprocess [RB.1.4] For an activity and a Rollup Action; returns True if the action applies: | ||
1.2.4. | Case: the contributing children bag is empty | |
1.2.4.1. | Break | No action; do not change status unless some child contributed to rollup |
End Case | ||
1.2.5. | Case: the Rollup Child Activity Set is All | |
1.2.5.1. | If the contributing children bag does not contain a value of False Or Unknown Then | |
1.2.5.1.1. | Set status change to True | |
End If | ||
End Case | ||
1.2.6. | Case: the Rollup Child Activity Set is Any | |
1.2.6.1. | If the contributing children bag contains a value of True Then | |
1.2.6.1.1. | Set status change to True | |
End If | ||
End Case | ||
1.2.7. | Case: the Rollup Child Activity Set is None | |
1.2.7.1. | If the contributing children bag does not contain a value of True Or Unknown Then | |
1.2.7.1.1. | Set status change to True | |
End If | ||
End Case | ||
1.2.8. | Case: the Rollup Child Activity Set is At Least Count | |
1.2.8.1. | If the count of True values contained in the contributing children bag equals or exceeds the Rollup Minimum Count of the rule Then | |
1.2.8.1.1. | Set status change to True | |
End If | ||
End Case | ||
1.2.9. | Case: the Rollup Child Activity Set is At Least Percent | |
1.2.9.1. | If the percentage (normalized between 0..1, inclusive) of True values contained in the contributing children bag equals or exceeds the Rollup Minimum Percent of the rule Then | |
1.2.9.1.1. | Set status change to True | |
End If | ||
End Case | ||
1.2.10. | If status change is True Then | |
1.2.10.1. | Exit RollupRule Check Subprocess (Evaluation: True) | Stop at the first rule that evaluates to true - perform the associated action. |
End If | ||
End For | ||
End If | ||
2. | Exit Rollup Rule Check Subprocess (Evaluation: False) | No rules evaluated to true - do not perform any action. |
pseudo code for rollup rule check subprocess
Evaluate Rollup Conditions Subprocess [RB.1.4.1] For an activity, a Condition Combination, and a set of Rollup Conditions; returns True if the condition(s) evaluate to True, False if the condition(s) evaluate to False, and Unknown if the condition(s) cannot be evaluated: | ||
Reference: Section: Condition Combination SM.5; Rollup Condition SM.5; Rollup Condition Operator SM.5; Tracking Model TM | ||
1. | Initialize rollup condition bag as an Empty collection | This is used to keep track of the evaluation of the rule’s conditions. |
2. | For each Rollup Condition in the set of Rollup Conditions | |
2.1. | Evaluate the rollup condition by applying the appropriate tracking information for the activity to the Rollup Condition | Evaluate each condition against the activity’s tracking information. This evaluation may result in “unknown”. |
2.2. | If the Rollup Condition Operator for the Rollup Condition is Not Then | Negating “unknown” results in “unknown”. |
2.2.1. | Negate the rollup condition | |
End If | ||
2.3. | Add the value of the rollup condition to the rollup condition bag | Add the evaluation of this condition to the set of evaluated conditions. |
End For | ||
3. | If the rollup condition bag is Empty Then | If there are no defined conditions for the rule, we cannot determine if the rule applies. |
3.1. | Exit Evaluate Rollup Conditions Subprocess (Evaluation: Unknown) | |
End If | ||
4. | Apply the Condition Combination to the rollup condition bag to produce a single combined rule evaluation | ‘And’ or ‘Or’ the set of evaluated conditions, based on the rollup rule definition. |
5. | Exit Evaluate Rollup Conditions Subprocess (Evaluation: the value of combined rule evaluation) |
pseudo code for evaluate rollup conditions subprocess
Check Child for Rollup Subprocess [RB.1.4.2] For an activity and a Rollup Action; returns True if the activity is included in rollup: | ||
Reference: Rollup Action SM.5; Rollup Objective Satisfied SM.8; Rollup Progress Completion SM.8; Activity Attempt Count TM.1.2.1; Sequencing Rules Check Process UP.2; adlseq:requiredForSatisfied SCORM SN; adlseq:requiredForNotSatisfied SCORM SN; adlseq:requiredForCompleted SCORM SN; adlseq:requiredForIncomplete SCORM SN | ||
1. | Set included to False | |
2. | If the Rollup Action is Satisfied Or Not Satisfied Then | |
2.1. | If the Rollup Objective Satisfied value for the activity is True Then | Test the objective rollup control. |
2.1.1. | Set included to True | Default Behavior – adlseq:requiredFor[ xxx] == always. |
2.1.2. | If (the Rollup Action is Satisfied And adlseq:requiredForSatisfied is ifNotSuspended) Or (the Rollup Action is Not Satisfied And adlseq:requiredForNotSatisfied is ifNotSuspended) Then | |
2.1.2.1. | If Activity Progress Status for the activity is False Or (Activity Attempt Count for the activity is greater than (>) Zero (0) And Activity is Suspended for the activity is True) Then | |
2.1.2.1.1. | Set included to False | |
End If | ||
2.1.3. | Else | |
2.1.3.1. | If (the Rollup Action is Satisfied And adlseq:requiredForSatisfied is ifAttempted) Or (the Rollup Action is Not Satisfied And adlseq:requiredForNotSatisfied is ifAttempted) Then | |
2.1.3.1.1. | If Activity Progress Status for the activity is False Or Activity Attempt Count for the activity is Zero (0) Then | |
2.1.3.1.1.1. | Set included to False | |
End If | ||
2.1.3.2. | Else | |
2.1.3.2.1. | If (the Rollup Action is Satisfied And adlseq:requiredForSatisfied is ifNotSkipped) Or (the Rollup Action is Not Satisfied And adlseq:requiredForNotSatisfied is ifNotSkipped) Then | |
2.1.3.2.1.1. | Apply the Sequencing Rules Check Process to the activity and its Skip sequencing rules | |
2.1.3.2.1.2. | If the Sequencing Rules Check Process does not return Nil Then | |
2.1.3.2.1.2.1. | Set included to False | |
End If | ||
End If | ||
End If | ||
End If | ||
End If | ||
End If | ||
3. | If the Rollup Action is Completed Or Incomplete Then | |
3.1. | If the Rollup Progress Completion value for the activity is True Then | Test the progress rollup control. |
3.1.1. | Set included to True | Default Behavior – adlseq:requiredFor[ xxx] == always. |
Check Child for Rollup Subprocess [RB.1.4.2] For an activity and a Rollup Action; returns True if the activity is included in rollup: | ||
3.1.2. | If (the Rollup Action is Completed And adlseq:requiredForCompleted is ifNotSuspended) Or (the Rollup Action is Incomplete And adlseq:requiredForIncomplete is ifNotSuspended) Then | |
3.1.2.1. | If Activity Progress Status for the activity is False Or (Activity Attempt Count for the activity is greater than (>) Zero (0) And Activity is Suspended for the activity is True) Then | |
3.1.2.1.1. | Set included to False | |
End If | ||
3.1.3. | Else | |
3.1.3.1. | If (the Rollup Action is Completed And adlseq:requiredForCompleted is ifAttempted) Or (the Rollup Action is Incomplete And adlseq:requiredForIncomplete is ifAttempted) Then | |
3.1.3.1.1. | If Activity Progress Status for the activity is False Or Activity Attempt Count for the activity is Zero (0) Then | |
3.1.3.1.1.1. | Set included to False | |
End If | ||
3.1.3.2. | Else | |
3.1.3.2.1. | If (the Rollup Action is Completed And adlseq:requiredForCompleted is ifNotSkipped) Or (the Rollup Action is Incomplete And adlseq:requiredForIncomplete is ifNotSkipped) Then | |
3.1.3.2.1.1. | Apply the Sequencing Rules Check Process to the activity and its Skip sequencing rules | |
3.1.3.2.1.2. | If the Sequencing Rules Check Process does not return Nil Then | |
3.1.3.2.1.2.1. | Set included to False | |
End If | ||
End If | ||
End If | ||
End If | ||
End If | ||
End If | ||
4. | Exit Check Child for Rollup Subprocess (Child is Included in Rollup: included) |
pseudo code for check child for rollup subprocess
Overall Rollup Process [RB.1.5] For an activity; may change the tracking information for the activity and its ancestors: | ||
Reference: Activity Progress Rollup Process RB.1.3; Measure Rollup Process RB.1.1a; Completion Measure Rollup Process RB.1.1b; Objective Rollup Process RB.1.2; Tracked SM.11; Tracking Model TM | ||
1. | Form the activity path as the ordered series of activities from the root of the activity tree to the activity, inclusive, in reverse order. | |
2. | If the activity path is Empty Then | |
2.1. | Exit Overall Rollup Process | Nothing to rollup. |
End If | ||
3. | For each activity in the activity path | |
3.1. | If the activity has children Then | Only apply Measure Rollup to non-leaf activities. |
3.1.1. | Apply the Measure Rollup Process to the activity | Rollup the activity’s measure. |
3.1.2. | Apply the Completion Measure Rollup Process to the activity | Rollup the activity’s progress measure. |
End If | ||
3.2. | Apply the appropriate Objective Rollup Process to the activity | |
3.3. | Apply the appropriate Activity Progress Rollup Process to the activity | |
End For | ||
4. | Exit Overall Rollup Process |
pseudo code for overall rollup process
Select Children Process [SR.1] For an activity; may change the Available Children for the activity: | ||
Reference: Activity is Active AM.1.1; Activity is Suspended AM.1.1; Available Children AM.1.1; Activity Progress Status TM.1.2.1; Selection Count SM.9; Selection Count Status SM.9; Selection Timing SM.9 | ||
1. | If the activity does not have children Then | Cannot apply selection to a leaf activity. |
1.1. | Exit Select Children Process | |
End If | ||
2. | If Activity is Suspended for the activity is True Or the Activity is Active for the activity is True Then | Cannot apply selection to a suspended or active activity. |
2.1. | Exit Select Children Process | |
End If | ||
3. | Case: the Selection Timing for the activity is Never | |
3.1. | Exit Select Children Process | |
End Case | ||
4. | Case: the Selection Timing for the activity is Once | |
4.1. | If the Activity Progress Status for the activity is False Then | If the activity has not been attempted yet. |
4.1.1. | If the Selection Count Status for the activity is True Then | |
4.1.1.1. | Initialize child list as an Empty ordered list | |
4.1.1.2. | Iterate Selection Count, for the activity, times | |
4.1.1.2.1. | Randomly select (without replacement) an activity from the children of the activity | |
4.1.1.2.2. | Add the selected activity to the child list, retaining the original (from the activity) relative order of activities | |
End Iterate | ||
4.1.1.3. | Set Available Children for the activity to the child list | |
End If | ||
End If | ||
4.2. | Exit Select Children Process | |
End Case | ||
5. | Case: the Selection Timing for the activity is On Each New Attempt | |
5.1. | Exit Select Children Process | Undefined behavior. |
End Case | ||
6. | Exit Select Children Process | Undefined timing attribute. |
pseudo code for select children process
Randomize Children Process [SR.2] For an activity; may change the Available Children for the activity: | ||
Reference: Activity is Active AM.1.1; Activity is Suspended AM.1.1; Available Children AM.1.1; Activity Progress Status TM.1.2.1; Randomize Children SM.10; Randomization Timing SM.10 | ||
1. | If the activity does not have children Then | Cannot apply randomization to a leaf activity. |
1.1. | Exit Randomize Children Process | |
End If | ||
2. | If Activity is Suspended for the activity is True Or the Activity is Active for the activity is True Then | Cannot apply randomization to a suspended or active activity. |
2.1. | Exit Randomize Children Process | |
End If | ||
3. | Case: the Randomization Timing for the activity is Never | |
3.1. | Exit Randomize Children Process | |
End Case | ||
4. | Case: the Randomization Timing for the activity is Once | |
4.1. | If the Activity Progress Status for the activity is False Then | If the activity has not been attempted yet. |
4.1.1. | If Randomize Children for the activity is True Then | |
4.1.1.1. | Randomly reorder the activities contained in Available Children for the activity | |
End If | ||
End If | ||
4.2. | Exit Randomize Children Process | |
End Case | ||
5. | Case: the Randomization Timing for the activity is On Each New Attempt | |
5.1. | If Randomize Children for the activity is True Then | |
5.1.1. | Randomly reorder the activities contained in Available Children for the activity | |
End If | ||
5.2. | Exit Randomize Children Process | |
End Case | ||
6. | Exit Randomize Children Process | Undefined timing attribute. |
pseudo code for randomize children process
Flow Tree Traversal Subprocess [SB.2.1] For an activity, a traversal direction, a consider children flag, and a previous traversal direction; returns the ‘next’ activity in directed traversal of the activity tree, may return the traversal direction, may indicate control be returned to the LTS; and may return an exception code: | ||
Reference: Available Children AM.1.1; Sequencing Control Forward Only SM.1; Terminate Descendent Attempts Process UP.3; Sequencing Rules Check Process UP.2 | ||
1. | Set reversed direction to False | |
2. | If (previous traversal direction is Defined And is Backward) And the activity is the last activity in the activity’s parent’s list of Available Children Then | Test if we have skipped all of the children in a forward only cluster moving backward. |
2.1. | traversal direction is Backward | |
2.2. | activity is the first activity in the activity’s parent’s list of Available Children | |
2.3. | Set reversed direction to True | |
End If | ||
3. | If the traversal direction is Forward Then | |
3.1. | If the activity is the last available activity in a forward preorder tree traversal of the activity tree Or (the activity is the Root of the Activity Tree And consider children is False) Then | Walking off the tree causes the sequencing session to end |
3.1.1. | Apply the Terminate Descendent Attempt Process to the root of the activity tree | |
3.1.2. | Exit Flow Tree Traversal Subprocess (Next Activity: n/a; End Sequencing Session: True; Exception: n/a) | |
End If | ||
3.2. | If the activity is a leaf Or consider children is False Then | |
3.2.1. | If the activity is the last activity in the activity’s parent’s list of Available Children Then | |
3.2.1.1. | Apply the Flow Tree Traversal Subprocess to the activity’s parent in the Forward direction and a previous traversal direction of n/a with consider children equal to False | Recursion - Move to the activity’s parent’s next forward sibling. |
3.2.1.2. | Exit Flow Tree Traversal Subprocess (Return the results of the recursive Flow Tree Traversal Subprocess) | Return the result of the recursion. |
3.2.2. | Else | |
3.2.2.1. | Traverse the tree, forward preorder, one activity to the next activity, in the activity’s parent’s list of Available Children | |
3.2.2.2. | Exit Flow Tree Traversal Subprocess (Next Activity: the activity identified by the traversal; Traversal Direction: traversal direction; Exception: n/a) | |
End If | ||
3.3. | Else | Entering a cluster – Forward. |
3.3.1. | If the activity’s list of Available Children is Not Empty Then | Make sure this activity has a child activity. |
3.3.1.1. | Exit Flow Tree Traversal Subprocess (Next Activity: the first activity in the activity’s list of Available Children; Traversal Direction: traversal direction; Exception: n/a ) | |
3.3.2.. | Else |
Flow Tree Traversal Subprocess [SB.2.1] For an activity, a traversal direction, a consider children flag, and a previous traversal direction; returns the ‘next’ activity in directed traversal of the activity tree, may return the traversal direction, may indicate control be returned to the LTS; and may return an exception code: | ||
3.3.2.1. | Exit Flow Tree Traversal Subprocess (Next Activity Nil; Traversal Direction: n/a; Exception: SB.2.1-2) | |
End If | ||
End If | ||
End If | ||
4. | If the traversal direction is Backward Then | |
4.1. | If the activity is the root activity of the tree Then | Cannot walk off the root of the activity tree. |
4.1.1. | Exit Flow Tree Traversal Subprocess (Next Activity: Nil; Traversal Direction: n/a; Exception: SB.2.1-3) | |
End If | ||
4.2. | If the activity is a leaf Or consider children is False Then | |
4.2.1. | If reversed direction is False Then | Only test ‘forward only’ if we are not going to leave this forward only cluster. |
4.2.1.1. | If Sequencing Control Forward Only for the parent of the activity is True Then | Test the control mode before traversing. |
4.2.1.1.1. | Exit Flow Tree Traversal Subprocess (Next Activity: Nil; Traversal Direction: n/a; Exception: SB.2.1-4) | |
End If | ||
End If | ||
4.2.2. | If the activity is the first activity in the activity’s parent’s list of Available Children Then | |
4.2.2.1. | Apply the Flow Tree Traversal Subprocess to the activity’s parent in the Backward direction and a previous traversal direction of n/a with consider children equal to False | Recursion - Move to the activity’s parent’s next backward sibling. |
4.2.2.2. | Exit Flow Tree Traversal Subprocess (Return the results of the recursive Flow Tree Traversal Subprocess) | Return the result of the recursion. |
4.2.3. | Else | |
4.2.3.1. | Traverse the tree, reverse preorder, one activity to the previous activity, from the activity’s parent’s list of Available Children | |
4.2.3.2. | Exit Flow Tree Traversal Subprocess (Next Activity: the activity identified by the traversal; Traversal Direction: traversal direction; Exception: n/a) | |
End If | ||
4.3. | Else | Entering a cluster – Backward. |
4.3.1. | If the activity’s list of Available Children is Not Empty Then | Make sure this activity has a child activity. |
4.3.1.1. | If Sequencing Control Forward Only for the activity is True Then | |
4.3.1.1.1. | Exit Flow Tree Traversal Subprocess (Next Activity: the first activity in the activity’s list of Available Children; | Start at the beginning of a |
Flow Tree Traversal Subprocess [SB.2.1] For an activity, a traversal direction, a consider children flag, and a previous traversal direction; returns the ‘next’ activity in directed traversal of the activity tree, may return the traversal direction, may indicate control be returned to the LTS; and may return an exception code: | ||
Traversal Direction: Forward; Exception: n/a) | forward only cluster. | |
4.3.1.2. | Else | |
4.3.1.2.1. | Exit Flow Tree Traversal Subprocess (Next Activity: the last activity in the activity’s list of Available Children; Traversal Direction: Backward; Exception: n/a) | Start at the end of the cluster if we are backing into it. |
End If | ||
4.3.2. | Else | |
4.3.2.1. | Exit Flow Tree Traversal Subprocess (Next Activity: Nil; Traversal Direction: n/a; Exception: SB.2.1-2) | |
End If | ||
End If | ||
End If |
pseudo code for flow tree traversal subprocess
Flow Activity Traversal Subprocess [SB.2.2] For an activity, a traversal direction, and a previous traversal direction; returns the ‘next’ activity in a directed traversal of the activity tree and True if the activity can be delivered; may indicate control be returned to the LTS; may return an exception code: | ||
Reference: Check Activity Process UP.5; Flow Activity Traversal Subprocess SB.2.2; Flow Tree Traversal Subprocess SB.2.1; Sequencing Control Flow SM.1; Sequencing Rules Check Process UP.2 | ||
1. | If Sequencing Control Flow for the parent of the activity is False Then | Confirm that ‘flow’ is enabled. |
1.1. | Exit Flow Activity Traversal Subprocess (Deliverable: False; Next Activity: the activity; Exception: SB.2.2-1) | |
End If | ||
2. | Apply the Sequencing Rules Check Process to the activity and its Skipped sequencing rules | |
3. | If the Sequencing Rules Check Process does not return Nil Then | Activity is skipped, try to go to the ‘next’ activity. |
3.1. | Apply the Flow Tree Traversal Subprocess to the activity in the traversal direction and the previous traversal direction with consider children equal to False | |
3.2. | If the Flow Tree Traversal Subprocess does not identify an activity Then | |
3.2.1. | Exit Flow Activity Traversal Subprocess (Deliverable: False; Next Activity: the activity; End Sequencing Session: as identified by the Flow Tree Traversal Subprocess; Exception: exception identified by the Flow Tree Traversal Subprocess) | |
3.3. | Else | |
3.3.1. | If the previous traversal direction is Backward And the Traversal Direction returned by the Flow Tree Traversal Subprocess is Backward Then | Make sure the recursive call considers the correct direction. |
3.3.1.1. | Apply the Flow Activity Traversal Subprocess to the activity identified by the Flow Tree Traversal Subprocess in the traversal direction and a previous traversal direction of n/a | Recursive call – make sure the ‘next’ activity is OK. |
3.3.2. | Else | |
3.3.2.1. | Apply the Flow Activity Traversal Subprocess to the activity identified by the Flow Tree Traversal Subprocess in the traversal direction and a previous traversal direction of previous traversal direction | Recursive call – make sure the ‘next’ activity is OK. |
End If | ||
3.3.3. | Exit Flow Activity Traversal Subprocess - (Return the results of the recursive Flow Activity Traversal Subprocess) | Possible exit from recursion. |
End If | ||
End If | ||
4. | Apply the Check Activity Process to the activity | Make sure the activity is allowed. |
5. | If the Check Activity Process returns True Then | |
5.1. | Exit Flow Activity Traversal Subprocess (Deliverable: False; Next Activity: the activity; Exception: SB.2.2-2) | |
End If |
Flow Activity Traversal Subprocess [SB.2.2] For an activity, a traversal direction, and a previous traversal direction; returns the ‘next’ activity in a directed traversal of the activity tree and True if the activity can be delivered; may indicate control be returned to the LTS; may return an exception code: | ||
6. | If the activity is not a leaf node in the activity tree Then | Cannot deliver a non-leaf activity; enter the cluster looking for a leaf. |
6.1. | Apply the Flow Tree Traversal Subprocess to the activity in the traversal direction and a previous traversal direction of n/a with consider children equal to True | |
6.2. | If the Flow Tree Traversal Subprocess does not identify an activity Then | |
6.2.1. | Exit Flow Activity Traversal Subprocess (Deliverable: False; Next Activity: the activity; End Sequencing Session: as identified by the Flow Tree Traversal Subprocess; Exception: exception identified by the Flow Tree Traversal Subprocess) | |
6.3. | Else | |
6.3.1. | If the traversal direction is Backward And the traversal direction returned by the Flow Tree Traversal Subprocess is Forward Then | Check if we are flowing backward through a forward only cluster - must move forward instead. |
6.3.1.1. | Apply the Flow Activity Traversal Subprocess to the activity identified by the Flow Tree Traversal Subprocess in the Forward direction with the previous traversal direction of Backward | Recursive call – Make sure the identified activity is OK. |
6.3.2. | Else | |
6.3.2.1. | Apply the Flow Activity Traversal Subprocess to the activity identified by the Flow Tree Traversal Subprocess in the traversal direction and a previous traversal direction of n/a | Recursive call – Make sure the identified activity is OK. |
End If | ||
6.3.3. | Exit Flow Activity Traversal Subprocess - (Return the results of the recursive Flow Activity Traversal Subprocess) | Possible exit from recursion. |
End If | ||
End If | ||
7. | Exit Flow Activity Traversal Subprocess (Deliverable: True; Next Activity: the activity; Exception: n/a ) | Found a leaf. |
pseudo code for flow activity traversal subprocess
For an activity, a traversal direction, and a consider children flag; indicates if the flow was successful and at what activity the flow stopped; may indicate control be returned to the LTS; may return an exception code: | ||
Reference: Flow Activity Traversal Subprocess SB.2.2; Flow Tree Traversal Subprocess SB.2.1 | ||
1. | The candidate activity is the activity | The candidate activity is where we start ‘flowing’ from. |
2. | Apply the Flow Tree Traversal Subprocess to the candidate activity in the traversal direction and a previous traversal direction of n/a with consider children equal to the consider children flag | Attempt to move away from the starting activity, one activity in the specified direction. |
3. | If the Flow Tree Traversal Subprocess does not identify an activity Then | No activity to move to. |
3.1. | Exit Flow Subprocess (Identified Activity: candidate activity; Deliverable: False; End Sequencing Session: as identified by the Flow Tree Traversal Subprocess; Exception: exception identified by the Flow Tree Traversal Subprocess) | |
4. | Else | |
4.1. | candidate activity is the activity identified by the Flow Tree Traversal Subprocess | |
4.2. | Apply the Flow Activity Traversal Subprocess to the candidate activity in the traversal direction and a previous traversal direction of n/a | Validate the candidate activity and traverse until a valid leaf is encountered. |
4.3. | Exit Flow Subprocess (Identified Activity: the activity identified by the Flow Activity Traversal Subprocess; Deliverable: as identified by the Flow Activity Traversal Subprocess; End Sequencing Session: value identified by the Flow Activity Traversal Subprocess; Exception: exception identified by the Flow Activity Traversal Subprocess) | |
End If |
pseudo code for flow subprocess
Choice Activity Traversal Subprocess [SB.2.4] For an activity and a traversal direction; returns True if the activity can be reached; may return an exception code: | ||
Reference: Sequencing Control Forward Only SM.1; Sequencing Rules Check Process UP.2 | ||
1. | If the traversal direction is Forward Then | |
1.1. | Apply the Sequencing Rules Check Process to the activity and the Stop Forward Traversal sequencing rules | |
1.2. | If the Sequencing Rules Check Process does not return Nil Then | |
1.2.1. | Exit Choice Activity Traversal Subprocess (Reachable: False; Exception: SB.2.4-1) | |
End If | ||
1.3. | Exit Choice Activity Traversal Subprocess (Reachable: True; Exception: n/a ) | |
End If | ||
2. | If the traversal direction is Backward Then | |
2.1. | If the activity has a parent Then | |
2.1.1. | If Sequencing Control Forward Only for the parent of the activity is True Then | |
2.1.1.1. | Exit Choice Activity Traversal Subprocess (Reachable: False; Exception: SB.2.4-2) | |
End If | ||
2.2. | Else | |
2.2.1. | Exit Choice Activity Traversal Subprocess (Reachable: False; Exception: SB.2.4-3) | Cannot walk backward from the root of the activity tree. |
End If | ||
2.3. | Exit Choice Activity Traversal Subprocess (Reachable: True; Exception: n/a ) | |
End If |
pseudo code for choice activity traversal subprocess
Start Sequencing Request Process [SB.2.5] May return a delivery request; may indicate control be returned to the LTS; may return an exception code: | ||
Reference: Current Activity AM.1.2; Flow Subprocess SB.2.3 | ||
1. | If the Current Activity is Defined Then | Make sure the sequencing session has not already begun. |
1.1. | Exit Start Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.5-1) | Nothing to deliver. |
End If | ||
2. | If the root of the activity tree is a leaf Then | Before starting, make sure the activity tree contains more than one activity. |
2.1. | Exit Start Sequencing Request Process (Delivery Request: the root of the activity tree; Exception: n/a) | Only one activity, it must be a leaf. |
3. | Else | |
3.1. | Apply the Flow Subprocess to the root of the activity tree in the Forward direction with consider children equal to True | Attempt to flow into the activity tree. |
3.2. | If the Flow Subprocess returns False Then | |
3.2.1. | Exit Start Sequencing Request Process (Delivery Request: n/a; End Sequencing Session: as identified by the Flow Subprocess; Exception: the exception identified by the Flow Subprocess) | Nothing to deliver. |
3.3. | Else | |
3.3.1. | Exit Start Sequencing Request Process (Delivery Request: the activity identified by the Flow Subprocess; Exception: n/a) | |
End If | ||
End If |
pseudo code for start sequencing request process
Resume All Sequencing Request Process [SB.2.6] May return a delivery request; may return an exception code: | ||
Reference: Current Activity AM.1.2; Suspended Activity AM.1.2 | ||
1. | If the Current Activity is Defined Then | Make sure the sequencing session has not already begun. |
1.1. | Exit Resume All Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.6-1) | Nothing to deliver. |
End If | ||
2. | If the Suspended Activity is Not Defined Then | Make sure there is something to resume. |
2.1. | Exit Resume All Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.6-2) | Nothing to deliver. |
End If | ||
3. | Exit Resume All Sequencing Request Process (Delivery Request: the activity identified by the Suspended Activity; Exception: n/a) |
pseudo code for resume all sequencing request process
Continue Sequencing Request Process [SB.2.7] May return a delivery request; may indicate control be returned to the LTS; may return an exception code: | ||
Reference: Current Activity AM.1.2; Flow Subprocess SB.2.3 | ||
1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has already begun. |
1.1. | Exit Continue Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.7-1) | Nothing to deliver. |
End If | ||
2. | If the Current Activity is not the root activity of the activity tree Then | |
2.1. | If Sequencing Control Flow for the parent of the Current Activity is False Then | Confirm a ‘flow’ traversal is allowed from the activity. |
2.1.1. | Exit Continue Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.7-2 ) | |
End If | ||
End If | ||
3. | Apply the Flow Subprocess to the Current Activity in the Forward direction with consider children equal to False | Flow in a forward direction to the next allowed activity. |
4. | If the Flow Subprocess returns False Then | |
4.1. | Exit Continue Sequencing Request Process (Delivery Request: n/a; End Sequencing Session: as identified by the Flow Subprocess; Exception: the exception identified by the Flow Subprocess) | Nothing to deliver. |
5. | Else | |
5.1. | Exit Continue Sequencing Request Process (Delivery Request: the activity identified by the Flow Subprocess; Exception: n/a ) | |
End If |
pseudo code for continue sequencing request process
Previous Sequencing Request Process [SB.2.8] May return a delivery request; may return an exception code: | ||
Reference: Current Activity AM.1.2; Flow Subprocess SB.2.3 | ||
1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has already begun. |
1.1. | Exit Previous Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.8-1 ) | Nothing to deliver. |
End If | ||
2. | If the Current Activity is not the root activity of the activity tree Then | |
2.1. | If Sequencing Control Flow for the parent of the Current Activity is False Then | Confirm a ‘flow’ traversal is allowed from the activity. |
2.1.1. | Exit Previous Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.8-2 ) | |
End If | ||
End If | ||
3. | Apply the Flow Subprocess to the Current Activity in the Backward direction with consider children equal to False | Flow in a backward direction to the next allowed activity. |
4. | If the Flow Subprocess returns False Then | |
4.1. | Exit Previous Sequencing Request Process (Delivery Request: n/a; Exception: the exception identified by the Flow Subprocess) | Nothing to deliver. |
5. | Else | |
5.1. | Exit Previous Sequencing Request Process (Delivery Request: the activity identified by the Flow Subprocess; Exception: n/a ) | |
End If |
pseudo code for previous sequencing request process
Choice Sequencing Request Process [SB.2.9] For a target activity; may return a delivery request; may change the Current Activity; may return an exception code: | ||
Reference: Activity is Active AM.1.1; Activity is Suspended AM.1.1; Available Children AM.1.1; Check Activity Process UP.5; Choice Flow Subprocess SB.2.9.1, Choice Activity Traversal Subprocess SB.2.4; Current Activity AM.1.2; End Attempt Process UP.4; Flow Subprocess SB.2.3; Sequencing Control Mode Choice SM.1; Sequencing Control Choice Exit SM.1; Sequencing Rules Check Process UP.2; Terminate Descendent Attempts Process UP.3; adlseq:constrainedChoice SCORM SN; adlseq:preventActivation SCORM SN | ||
1. | If there is no target activity Then | There must be a target activity for choice. |
1.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-1) | Nothing to deliver. |
End If | ||
2. | Form the activity path as the ordered series of activities from root of the activity tree to the target activity, inclusive | |
3. | For each activity in the activity path | |
3.1. | If the activity is Not the root of the activity tree Then | |
3.1.1. | If the Available Children for the parent of the activity does not contain the activity Then | The activity is currently not available. |
3.1.1.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-2) | Nothing to deliver. |
End If | ||
End If | ||
3.2. | Apply the Sequencing Rules Check Process to the activity and the Hide from Choice sequencing rules | Cannot choose something that is hidden. |
3.3. | If the Sequencing Rules Check Process does not return Nil Then | |
3.3.1 | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-3) | Nothing to deliver. |
End If | Cannot choose something that is hidden. | |
End For | ||
4. | If the target activity is not the root of the activity tree Then | |
4.1. | If the Sequencing Control Mode Choice for the parent of the target activity is False Then | Confirm that control mode allow ‘choice’ of the target. |
4.1.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-4) | Nothing to deliver. |
End If | ||
End If | ||
5. | If the Current Activity is Defined Then | Has the sequencing session already begun? |
5.1. | Find the common ancestor of the Current Activity and the target activity | |
6. | Else |
Choice Sequencing Request Process [SB.2.9] For a target activity; may return a delivery request; may change the Current Activity; may return an exception code: | ||
6.1. | Set common ancestor is the root of the activity tree | No, choosing the target will start the sequencing session. |
End If | ||
7. | Case: Current Activity and target activity are identical | Case #1 - select the current activity. |
7.1. | Break All Cases | Nothing to do in this case. |
End Case | ||
8. | Case: Current Activity and the target activity are siblings | Case #2 - same cluster; move toward the target activity. |
8.1. | Form the activity list as the ordered sequence of activities from the Current Activity to the target activity, exclusive of the target activity | We are attempting to walk toward the target activity. Once we reach the target activity, we don’t need to test it. |
8.2. | If the activity list is Empty Then | Nothing to choose. |
8.2.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-5) | Nothing to deliver. |
End If | ||
8.3. | If the target activity occurs after the Current Activity in preorder traversal of the activity tree Then | |
8.3.1. | traverse is Forward | |
8.4. | Else | |
8.4.1. | traverse is Backward | |
End If | ||
8.5. | For each activity on the activity list | |
8.5.1. | Apply the Choice Activity Traversal Subprocess to the activity in the traverse direction | |
8.5.2. | If the Choice Activity Traversal Subprocess returns False Then | |
8.5.2.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: the exception identified by the Choice Activity Traversal Subprocess) | Nothing to deliver. |
End If | ||
End For | ||
8.6. | Break All Cases | |
End Case | ||
9. | Case: Current Activity and common ancestor are the same Or Current Activity is Not Defined | Case #3 - path to the target is forward in the activity tree. |
9.1. | Form the activity path as the ordered series of activities from the common ancestor to the target activity, exclusive of the target activity | |
9.2. | If the activity path is Empty Then |
Choice Sequencing Request Process [SB.2.9] For a target activity; may return a delivery request; may change the Current Activity; may return an exception code: | ||
9.2.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-5) | Nothing to deliver. |
End If | ||
9.3. | For each activity on the activity path | |
9.3.1. | Apply the Choice Activity Traversal Subprocess to the activity in the Forward direction | |
9.3.2. | If the Choice Activity Traversal Subprocess returns False Then | |
9.3.2.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: the exception identified by the Choice Activity Traversal Subprocess) | Nothing to deliver. |
End If | ||
9.3.3. | If Activity is Active for the activity is False And (the activity is Not the common ancestor And adlseq:preventActivation for the activity is True) Then | If the activity being considered is not already active, make sure we are allowed to activate it. |
9.3.3.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-6) | Nothing to deliver. |
End If | ||
End For | ||
9.4. | Break All Cases | |
End Case | ||
10. | Case: Target activity is the common ancestor of the Current Activity | Case #4 - path to the target is backward in the activity tree. |
10.1. | Form the activity path as the ordered series of activities from the Current Activity to the target activity, inclusive | |
10.2. | If the activity path is Empty Then | |
10.2.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-5) | Nothing to deliver. |
End If | ||
10.3. | For each activity on the activity path | |
10.3.1. | If the activity is not the last activity in the activity path Then | |
10.3.1.1. | If the Sequencing Control Choice Exit for the activity is False Then | Make sure an activity that should not exit will exit if the target is delivered. |
10.3.1.1.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-7) | Nothing to deliver. |
End If | ||
End If | ||
End For | ||
10.4. | Break All Cases | |
End Case | ||
11. | Case: Target activity is forward from the common ancestor activity | Case #5 - target is a descendent activity of the |
Choice Sequencing Request Process [SB.2.9] For a target activity; may return a delivery request; may change the Current Activity; may return an exception code: | ||
common ancestor. | ||
11.1. | Form the activity path as the ordered series of activities from the Current Activity to the common ancestor, excluding the common ancestor | |
11.2. | If the activity path is Empty Then | |
11.2.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-5) | Nothing to deliver. |
End If | ||
11.3. | Set constrained activity to Undefined | |
11.4. | For each activity on the activity path | Walk up the tree to the common ancestor. |
11.4.1. | If the Sequencing Control Choice Exit for the activity is False Then | Make sure an activity that should not exit will exit if the target is delivered. |
11.4.1.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-7) | Nothing to deliver. |
End If | ||
11.4.2. | If constrained activity is Undefined Then | Find the closest constrained activity to the current activity. |
11.4.2.1. | If adlseq:constrainedChoice for the activity is True Then | |
11.4.2.1.1. | Set constrained activity to activity | |
End If | ||
End If | ||
End For | ||
11.5. | If constrained activity is Defined Then | |
11.5.1. | If the target activity is Forward in the activity tree relative to the constrained activity Then | |
11.5.1.1. | traverse is Forward | ‘Flow’ in a forward direction to see what activity comes next. |
11.5.2. | Else | |
11.5.2.1. | traverse is Backward | ‘Flow’ in a backward direction to see what activity comes next. |
End If | ||
11.5.3. | Apply the Choice Flow Subprocess to the constrained activity in the traverse direction | |
11.5.4. | Set activity to consider to the activity identified by the Choice Flow Subprocess | |
11.5.5. | If the target activity is Not an available descendent of the activity to consider And the target activity is Not the activity to consider And the target activity is Not the constrained activity Then | Make sure the target activity is within the set of |
Choice Sequencing Request Process [SB.2.9] For a target activity; may return a delivery request; may change the Current Activity; may return an exception code: | ||
‘flow’ constrained choices. | ||
11.5.5.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-8) | |
End If | ||
End If | ||
11.6. | Form the activity path as the ordered series of activities from the common ancestor to the target activity, exclusive of the target activity | |
11.7. | If the activity path is Empty Then | |
11.7.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-5) | Nothing to deliver. |
End If | ||
11.8. | If the target activity is forward in the activity tree relative to the Current Activity Then | Walk toward the target activity. |
11.8.1. | For each activity on the activity path | |
11.8.1.1. | Apply the Choice Activity Traversal Subprocess to the activity in the Forward direction | |
11.8.1.2. | If the Choice Activity Traversal Subprocess returns False Then | |
11.8.1.2.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: the exception identified by the Choice Activity Traversal Subprocess) | Nothing to deliver. |
End If | ||
11.8.1.3. | If Activity is Active for the activity is False And (the activity is Not the common ancestor And adlseq:preventActivation for the activity is True) Then | If the activity being considered is not already active, make sure we are allowed to activate it. |
11.8.1.3.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-6) | Nothing to deliver. |
End If | ||
End For | ||
11.9. | Else | |
11.9.1. | Append the target activity to the activity path | |
11.9.2. | For each activity on the activity path | |
11.9.2.1. | If Activity is Active for the activity is False And (the activity is Not the common ancestor And adlseq:preventActivation for the activity is True) Then | If the activity being considered is not already active, make sure we are allowed to activate it. |
11.9.2.1.1. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-6) | Nothing to deliver. |
End If | ||
End For | ||
End If | ||
11.10. | Break All Cases | |
End Case | ||
12. | If the target activity is a leaf activity Then | |
12.1. | Exit Choice Sequencing Request Process (Delivery Request: the target |
Choice Sequencing Request Process [SB.2.9] For a target activity; may return a delivery request; may change the Current Activity; may return an exception code: | ||
activity; Exception: n/a) | ||
End If | ||
13. | Apply the Flow Subprocess to the target activity in the Forward direction with consider children equal to True | The identified activity is a cluster. Enter the cluster and attempt to find a descendent leaf to deliver. |
14. | If the Flow Subprocess returns False Then | Nothing to deliver, but we succeeded in reaching the target activity - move the current activity. |
14.1. | Apply the Terminate Descendent Attempts Process to the common ancestor | |
14.2. | Apply the End Attempt Process to the common ancestor | |
14.3. | Set the Current Activity to the target activity | |
14.4. | Exit Choice Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.9-9) | Nothing to deliver. |
15. | Else | |
15.1. | Exit Choice Sequencing Request Process (Delivery Request: for the activity identified by the Flow Subprocess; Exception: n/a) | |
End If |
Pseudo code for choice sequencing request process
Choice Flow Subprocess [SB.2.9.1] For an activity and a traversal direction; indicates at what activity the flow stopped: | ||
Reference: Choice Flow Tree Traversal Subprocess SB.2.9.2 | ||
1. | Apply the Choice Flow Tree Traversal Subprocess to the activity in the | Attempt to move |
traversal direction | away from the | |
activity, ‘one’ | ||
activity in the | ||
specified direction. | ||
2. | If the Choice Flow Tree Traversal Subprocess returned Nil Then | |
2.1. | Exit Choice Flow Subprocess (Identified Activity the activity) | |
3. | Else | |
3.1. | Exit Choice Flow Subprocess (Identified Activity the activity identified by the Choice Flow Tree Traversal Subprocess) | |
End If |
pseudo code for choice flow subprocess
Choice Flow Tree Traversal Subprocess [SB.2.9.2] For an activity, a traversal direction; returns the ‘next’ activity in directed traversal of the activity tree: | ||
Reference: Available Children AM.1.1, Choice Flow Tree Traversal Subprocess SB.2.9.2 | ||
1. | If the traversal direction is Forward Then | |
1.1. | If the activity is the last available activity in a forward preorder tree traversal of the activity tree Or the activity is the Root of the Activity Tree Then | Cannot walk off the activity tree. |
1.1.1. | Exit Choice Flow Tree Traversal Subprocess (Next Activity: Nil) | |
End If | ||
1.2. | If the activity is the last activity in the activity’s parent’s list of Available Children Then | |
1.2.1. | Apply the Choice Flow Tree Traversal Subprocess to the activity’s parent in the Forward direction | Recursion - Move to the activity’s parent’s next forward sibling. |
1.2.2. | Exit Choice Flow Tree Traversal Subprocess (Next Activity: the results of the recursive Choice Flow Tree Traversal Subprocess) | Return the result of the recursion. |
1.3. | Else | |
1.3.1. | Traverse the tree, forward preorder, one activity to the next activity, in the activity’s parent’s list of Available Children | |
1.3.2. | Exit Choice Flow Tree Traversal Subprocess (Next Activity: the activity identified by the traversal) | |
End If | ||
End If | ||
2. | If the traversal direction is Backward Then | |
2.1. | If the activity is the root activity of the tree Then | Cannot walk off the root of the activity tree. |
2.1.1. | Exit Choice Flow Tree Traversal Subprocess (Next Activity: Nil) | |
End If | ||
2.2. | If the activity is the first activity in the activity’s parent’s list of Available Children Then | |
2.2.1. | Apply the Choice Flow Tree Traversal Subprocess to the activity’s parent in the Backward direction | Recursion – Move to the activity’s parent’s next backward sibling. |
2.2.2. | Exit Choice Flow Tree Traversal Subprocess (Next Activity: the results of the recursive Choice Flow Tree Traversal Subprocess) | Return the result of the recursion. |
2.3. | Else | |
2.3.1. | Traverse the tree, reverse preorder, one activity to the previous activity, from the activity’s parent’s list of Available Children | |
2.3.2. | Exit Choice Flow Tree Traversal Subprocess (Next Activity: the activity identified by the traversal) | |
End If | ||
End If |
pseudo code for choice flow tree traversal subprocess
Retry Sequencing Request Process [SB.2.10] May return a delivery request; may return an exception code: | ||
Reference: Activity is Active AM.1.1; Activity is Suspended AM.1.1; Current Activity AM.1.2; Flow Subprocess SB.2.3 | ||
1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has already begun.. |
1.1. | Exit Retry Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.10-1) | Nothing to deliver. |
End If | ||
2. | If the Activity is Active for the Current Activity is True Or the Activity is Suspended for the Current Activity is True Then | Cannot retry an activity that is still active or suspended. |
2.1. | Exit Retry Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.10-2) | Nothing to deliver. |
End If | ||
3. | If the Current Activity is not a leaf Then | |
3.1. | Apply the Flow Subprocess to the Current Activity in the Forward direction with consider children equal to True | |
3.2. | If the Flow Subprocess returned False Then | |
3.2.1. | Exit Retry Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.10-3) | Nothing to deliver. |
3.3. | Else | |
3.3.1. | Exit Retry Sequencing Request Process (Delivery Request: the activity identified by the Flow Subprocess; Exception: n/a) | |
End If | ||
4. | Else | |
4.1. | Exit Retry Sequencing Request Process (Delivery Request: the Current Activity; Exception: n/a) | |
End If |
pseudo code for retry sequencing request process
Exit Sequencing Request Process [SB.2.11] Indicates if the sequencing session has ended; may return an exception code: | ||
Reference: Activity is Active AM.1.1; Current Activity AM.1.2 | ||
1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has already begun. |
1.1. | Exit Exit Sequencing Request Process (End Sequencing Session: False; Exception: SB.2.11-1) | |
End If | ||
2. | If the Activity is Active for the Current Activity is True Then | Make sure the current activity has already been terminated. |
2.1. | Exit Exit Sequencing Request Process (End Sequencing Session: False; Exception: SB.2.11-2) | |
End If | ||
3. | If the Current Activity is the root of the activity tree Then | |
3.1. | Exit Exit Sequencing Request Process (End Sequencing Session: True; Exception: n/a) | The sequencing session has ended, return control to the LTS. |
End If | ||
4. | Exit Exit Sequencing Request Process (End Sequencing Session: False; Exception: n/a) |
pseudo code for exit sequencing request process
Sequencing Request Process [SB.2.12] For a sequencing request; validates the sequencing request; may return a delivery request; may indicate control be returned to the LTS; may return an exception code: | ||
Reference: Choice Sequencing Request Process SB.2.9; Continue Sequencing Request Process SB.2.7; Exit Sequencing Request Process SB.2.11; Previous Sequencing Request Process SB.2.8; Resume All Sequencing Request Process SB.2.6; Retry Sequencing Request Process SB.2.10; Start Sequencing Request Process SB.2.5 | ||
1. | Case: sequencing request is Start | |
1.1. | Apply the Start Sequencing Request Process | |
1.2. | If the Start Sequencing Request Process returns an exception Then | |
1.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: the exception identified by the Start Sequencing Request Process) | |
1.3. | Else | |
1.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: the result of the Start Sequencing Request Process; End Sequencing Session: as identified by the Start Sequencing Request Process; Exception: n/a) | |
End If | ||
End Case | ||
2. | Case: sequencing request is Resume All | |
2.1. | Apply the Resume All Sequencing Request Process | |
2.2. | If the Resume All Sequencing Request Process returns an exception Then | |
2.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: the exception identified by the Resume All Sequencing Request Process) | |
2.3. | Else | |
2.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: the result of the Resume All Sequencing Request Process; End Sequencing Session: n/a; Exception: n/a) | |
End If | ||
End Case | ||
3. | Case: sequencing request is Exit | |
3.1. | Apply the Exit Sequencing Request Process | |
3.2. | If the Exit Sequencing Request Process returns an exception Then | |
3.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: the exception identified by the Exit Sequencing Request Process) | |
3.3. | Else | |
3.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: n/a; End Sequencing Session: the result of the Exit Sequencing Request Process; Exception: n/a) | |
End If | ||
End Case | ||
4. | Case: sequencing request is Retry | |
4.1. | Apply the Retry Sequencing Request Process | |
4.2. | If the Retry Sequencing Request Process returns an exception Then | |
4.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; |
Sequencing Request Process [SB.2.12] For a sequencing request; validates the sequencing request; may return a delivery request; may indicate control be returned to the LTS; may return an exception code: | ||
Exception: the exception identified by the Retry Sequencing Request Process) | ||
4.3. | Else | |
4.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: the result of the Retry Sequencing Request Process; End Sequencing Session: n/a) ; Exception: n/a) | |
End If | ||
End Case | ||
5. | Case: sequencing request is Continue | |
5.1. | Apply the Continue Sequencing Request Process | |
5.2. | If the Continue Sequencing Request Process returns an exception Then | |
5.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: the exception identified by the Continue Sequencing Request Process) | |
5.3. | Else | |
5.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: the result of the Continue Sequencing Request Process; End Sequencing Session: as identified by the Continue Sequencing Request Process;; Exception: n/a) | |
End If | ||
End Case | ||
6. | Case: sequencing request is Previous | |
6.1. | Apply the Previous Sequencing Request Process | |
6.2. | If the Previous Sequencing Request Process returns an exception Then | |
6.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: the exception identified by the Previous Sequencing Request Process) | |
6.3. | Else | |
6.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: the result of the Previous Sequencing Request Process; End Sequencing Session: n/a; Exception: n/a) | |
End If | ||
End Case | ||
7. | Case: sequencing request is Choice | |
7.1. | Apply the Choice Sequencing Request Process | |
7.2. | If the Choice Sequencing Request Process returns an exception Then | |
7.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: the exception identified by the Choice Sequencing Request Process) | |
7.3. | Else | |
7.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: the result of the Choice Sequencing Request Process; End Sequencing Session: n/a; Exception: n/a) | |
End If | ||
End Case | ||
8. | Case: sequencing request is Jump | |
8.1. | Apply the Jump Sequencing Request Process |
Sequencing Request Process [SB.2.12] For a sequencing request; validates the sequencing request; may return a delivery request; may indicate control be returned to the LTS; may return an exception code: | ||
8.2. | If the Jump Sequencing Request Process returns an exception Then | |
8.2.1. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: the exception identified by the Jump Sequencing Request Process) | |
8.3. | Else | |
8.3.1. | Exit Sequencing Request Process (Sequencing Request: Valid; Delivery Request: the result of the Jump Sequencing Request Process; End Sequencing Session: n/a; Exception: n/a) | |
End If | ||
End Case | ||
9. | Exit Sequencing Request Process (Sequencing Request: Not Valid; Delivery Request: n/a; End Sequencing Session: n/a; Exception: SB.2.12- 1) | Invalid sequencing request. |
pseudo code for sequencing request process
Jump Sequencing Request Process [SB.2.13] For a target activity; may return a delivery request; may return an exception code: | ||
Reference: Current Activity AM.1.2 | ||
1. | If the Current Activity is Not Defined Then | Make sure the sequencing session has not already begun. |
1.1. | Exit Jump Sequencing Request Process (Delivery Request: n/a; Exception: SB.2.13-1) | Nothing to deliver. |
End If | ||
2. | Exit Jump Sequencing Request Process (Delivery Request: the activity identified by the target activity; Exception: n/a) |
pseudo code for jump sequencing request process
Delivery Request Process [DB.1.1] For a delivery request; returns the validity of the delivery request; may return an exception code: | ||
Reference: Check Activity Process UP.5 | ||
1. | If the activity specified by the delivery request is not a leaf Then | Can only deliver leaf activities. |
1.1. | Exit Delivery Request Process (Delivery Request: Not Valid; Exception: DB.1.1-1) | |
End If | ||
2. | Form the activity path as the ordered series of activities from the root of the activity tree to the activity specified in the delivery request, inclusive | |
3. | If the activity path is Empty Then | Nothing to deliver. |
3.1. | Exit Delivery Request Process (Delivery Request: Not Valid; Exception: DB.1.1-2) | |
End If | ||
4. | For each activity in the activity path | Make sure each activity along the path is allowed. |
4.1. | Apply the Check Activity Process to the activity | |
4.2. | If the Check Activity Process returned True Then | |
4.2.1. | Exit Delivery Request Process (Delivery Request: Not Valid; Exception: DB.1.1-3) | |
End If | ||
End For | ||
5. | Exit Delivery Request Process (Delivery Request: Valid; Exception: n/a) |
pseudo code for delivery request process
Content Delivery Environment Process [DB.2] For a delivery request; may return an exception code: | ||
Reference: Activity Progress Status TM.1.2.1; Activity Attempt Count TM.1.2.1; Activity is Active AM.1.1; Activity is Suspended AM.1.1; Attempt Absolute Duration TM.1.2.2; Attempt Experienced Duration TM.1.2.2; Attempt Progress Information TM.1.2.2; Clear Suspended Activity Subprocess DB.2.1; Current Activity AM.1.2; Objective Progress Information TM.1.1; Suspended Activity AM.1.2; Terminate Descendent Attempts Process UP.4; Tracked SM.11 | ||
1. | If the Activity is Active for the Current Activity is True Then | If the attempt on the current activity has not been terminated, we cannot deliver new content. |
1.1. | Exit Content Delivery Environment Process (Exception: DB.2-1) | Delivery request is invalid - The Current Activity has not been terminated. |
End If | ||
2. | If the activity identified for delivery is not equal to the Suspended Activity Then | Content is about to be delivered, clear any existing suspend all state. |
2.1. | Apply the Clear Suspended Activity Subprocess to the activity identified for delivery | |
End If | ||
3. | Apply the Terminate Descendent Attempts Process to the activity identified for delivery | Make sure that all attempts that should end are terminated. |
4. | Form the activity path as the ordered series of activities from the root of the activity tree to the activity identified for delivery, inclusive | Begin all attempts required to deliver the identified activity. |
5. | For each activity in the activity path | |
5.1. | If Activity is Active for the activity is False Then | |
5.1.1. | If Tracked for the activity is True Then | |
5.1.1.1. | If Activity is Suspended for the activity is True Then | If the previous attempt on the activity ended due to a suspension, clear the suspended state; do not start a new attempt. |
5.1.1.1.1. | Set Activity is Suspended for the activity to False | |
5.1.1.2. | Else | |
5.1.1.2.1. | Increment the Activity Attempt Count for the activity | Begin a new attempt on the activity. |
5.1.1.2.2. | If Activity Attempt Count for the activity is equal to One (1) Then | Is this the first attempt on the activity? |
5.1.1.2.2.1. | Set Activity Progress Status for the activity to True |
Content Delivery Environment Process [DB.2] For a delivery request; may return an exception code: | ||
End If | ||
5.1.1.2.3. | Initialize Objective Progress Information and Attempt Progress Information required for the new attempt | Initialize tracking information for the new attempt. |
End If | ||
End If | ||
5.1.2. | Set Activity is Active for the activity to True | |
End If | ||
End For | ||
6. | Set Current Activity to the activity identified for delivery | The activity identified for delivery becomes the current activity. |
7. | Set Suspended Activity to undefined | |
8. | Once the delivery of the activity’s content resources and auxiliary resources begins | The delivery environment is assumed to deliver the content resources associated with the identified activity. While the activity is assumed to be active, the sequencer may track learner status. |
8.1. | If Tracked for the activity identified for delivery is False Then | |
8.1.1. | The Objective and Attempt Progress information for the activity should not be recorded during delivery | |
8.1.2. | The delivery environment begins tracking the Attempt Absolute Duration and the Attempt Experienced Duration | |
End If | ||
9. | Exit Content Delivery Environment Process (Exception: n/a) |
pseudo code for content delivery environment process
Clear Suspended Activity Subprocess [DB.2.1] For an activity; may change the Suspended Activity: | ||
Reference: Activity is Suspended AM.1.1; Suspended Activity AM.1.2 | ||
1. | If the Suspended Activity is Defined Then | Make sure there is something to clear. |
1.1. | Find the common ancestor of the identified activity and the Suspended Activity | |
1.2. | Form an activity path as the ordered series of activities from the Suspended Activity to the common ancestor, inclusive | |
1.3. | If the activity path is Not Empty Then | |
1.3.1. | For each activity in the activity path | Walk down the tree setting each of the identified activities to ‘not suspended’. |
1.3.1.1. | If the activity is a leaf Then | |
1.3.1.1.1. | Set Activity is Suspended for the activity to False | |
1.3.1.2. | Else | |
1.3.1.2.1. | If the activity does not include any child activity whose Activity is Suspended attribute is True Then | |
1.3.1.2.1.1. | Set Activity is Suspended for the activity to False | |
End If | ||
End If | ||
End For | ||
End If | ||
1.4. | Set Suspended Activity to Undefined | Clear the Suspended Activity attribute. |
End If | ||
2. | Exit Clear Suspended Activity Subprocess |
pseudo code for clear suspended activity subprocess
Limit Conditions Check Process [UP.1] For an activity; returns True if any of the activity’s limit conditions have been violated: | |||
Reference: Activity Attempt Count TM.1.2.1; Activity Progress Status TM.1.2.1; Activity Absolute Duration TM.1.2.1; Activity Experienced Duration TM.1.2.1; Attempt Progress Status TM.1.2.2; Attempt Absolute Duration TM.1.2.2; Attempt Experienced Duration TM.1.2.2; Limit Condition Activity Absolute Duration Control SM.3; Limit Condition Activity Absolute Duration Limit SM.3; Limit Condition Activity Experienced Duration Control SM.3; Limit Condition Activity Experienced Duration Limit SM.3; Limit Condition Attempt Absolute Duration Control SM.3; Limit Condition Attempt Absolute Duration Limit SM.3; Limit Condition Attempt Experienced Duration Control SM.3; Limit Condition Attempt Experienced Duration Limit SM.3; Limit Condition Attempt Control SM.3; Limit Condition Attempt Limit SM.3; Limit Condition Begin Time Limit SM.3; Limit Condition Begin Time Limit Control SM.3; Limit Condition End Time Limit SM.3; Limit Condition End Time Limit Control SM.3; Tracked SM.11 | |||
1. | If Tracked for the activity is False Then | If the activity is not tracked, its limit conditions cannot be violated. | |
1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: False) | Activity is not tracked, no limit conditions can be violated, exit UP.1. | |
End If | |||
2. | If the Activity is Active for the activity is True Or the Activity is Suspended for the activity is True Then | Only need to check activities that will begin a new attempt. | |
2.1 | Exit Limit Conditions Check Process (Limit Condition Violated: False) | ||
End If | |||
3. | If the Limit Condition Attempt Control for the activity is True Then | ||
3.1. | If the Activity Progress Status for the activity is True And the Activity Attempt Count for the activity is greater than or equal (>=) to the Limit Condition Attempt Limit for the activity Then | ||
3.1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: True) | Limit conditions have been violated. | |
End If | |||
End If | |||
4. | If the Limit Condition Activity Absolute Duration Control for the activity is True Then | ||
4.1. | If the Activity Progress Status for the activity is True And the Activity Absolute Duration for the activity is greater than or equal (>=) to Limit Condition Activity Absolute Duration Limit for the activity Then | ||
4.1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: True) | Limit conditions have been violated. | |
End If | |||
End If | |||
5. | If the Limit Condition Activity Experienced Duration Control for the activity is True Then | ||
5.1. | If the Activity Progress Status for the activity is True And the Activity Experienced Duration for the activity is greater than or equal (>=) to the Limit Condition Activity Experienced Duration Limit for the activity Then | ||
5.1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: True) | Limit conditions have been violated. |
Limit Conditions Check Process [UP.1] For an activity; returns True if any of the activity’s limit conditions have been violated: | |||
End If | |||
End If | |||
6. | If the Limit Condition Attempt Absolute Duration Control for the activity is True Then | ||
6.1. | If the Activity Progress Status for the activity is True And the Attempt Progress Status for the activity is True And the Attempt Absolute Duration for the activity is greater than or equal (>=) to the Limit Condition Attempt Absolute Duration Limit for the activity Then | ||
6.1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: True) | Limit conditions have been violated. | |
End If | |||
End If | |||
7. | If the Limit Condition Attempt Experienced Duration Control for the activity is True Then | ||
7.1. | If the Activity Progress Status for the activity is True And the Attempt Progress Status for the activity is True And the Attempt Experienced Duration for the activity is greater than or equal (>=) to the Limit Condition Attempt Experienced Duration Limit for the activity Then | ||
7.1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: True) | Limit conditions have been violated. | |
End If | |||
End If | |||
8. | If the Limit Condition Begin Time Limit Control for the activity is True Then | ||
8.1. | If the current time point is before the Limit Condition Begin Time Limit for the activity Then | ||
8.1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: True) | Limit conditions have been violated. | |
End If | |||
End If | |||
9. | If the Limit Condition End Time Limit Control for the activity is True Then | ||
9.1. | If the current time point is after the Limit Condition End Time Limit for the activity Then | ||
9.1.1. | Exit Limit Conditions Check Process (Limit Condition Violated: True) | Limit conditions have been violated. | |
End If | |||
End If | |||
10.. | Exit Limit Conditions Check Process (Limit Condition Violated: False) | No limit conditions have been violated. |
pseudo code for limit conditions check process
ADL Note: Pseudo code in the Limit Conditions Check Process (UP.1) that may be optionally supported by an implementation of the SCORM 2004 4th Edition Sequencing and Navigation is identified by gray-highlighted text – for example: this is optional code.
Sequencing Rules Check Process [UP.2] For an activity and a set of Rule Actions; returns the action to apply or Nil: | ||
Reference: Rule Action SM.2; Sequencing Rule Check Subprocess UP.2.1; Sequencing Rule Description SM.2 | ||
1. | If the activity includes Sequencing Rules with any of the specified Rule Actions Then | Make sure the activity has rules to evaluate. |
1.1. | Initialize rules list by selecting the set of Sequencing Rules for the activity that have any of the specified Rule Actions, maintaining original rule ordering | |
1.2. | For each rule in the rules list | |
1.2.1. | Apply the Sequencing Rule Check Subprocess to the activity and the rule | Evaluate each rule, one at a time. |
1.2.2. | If the Sequencing Rule Check Subprocess returns True Then | |
1.2.2.1. | Exit Sequencing Rules Check Process (Action: Rule Action for the rule) | Stop at the first rule that evaluates to true - perform the associated action. |
End If | ||
End For | ||
End If | ||
2. | Exit Sequencing Rules Check Process (Action: Nil) | No rules evaluated to true - do not perform any action. |
pseudo code for sequencing rules check process
Sequencing Rule Check Subprocess [UP.2.1] For an activity and a Sequencing Rule; returns True if the rule applies, False if the rule does not apply, and Unknown if the condition(s) cannot be evaluated: | ||
Reference: Rule Combination SM.2; Rule Condition SM.2; Rule Condition Operator SM.2; Sequencing Rule Description SM.2; Tracking Model TM | ||
1. | Initialize rule condition bag as an Empty collection | This is used to keep track of the evaluation of the rule’s conditions. |
2. | For each Rule Condition for the Sequencing Rule for the activity | |
2.1. | Evaluate the rule condition by applying the appropriate tracking information for the activity to the Rule Condition | Evaluate each condition against the activity’s tracking information. |
2.2. | If the Rule Condition Operator for the Rule Condition is Not Then | |
2.2.1. | Negate the rule condition | Negating “unknown” results in “unknown”. |
End If | ||
2.3. | Add the value of rule condition to the rule condition bag | Add the evaluation of this condition to the set of evaluated conditions. |
End For | ||
3. | If the rule condition bag is Empty Then | If there are no defined conditions for the rule, the rule does not apply. |
3.1. | Exit Sequencing Rule Check Subprocess (Result: Unknown) | No rule conditions. |
End If | ||
4. | Apply the Rule Combination for the Sequencing Rule to the rule condition bag to produce a single combined rule evaluation | ‘And’ or ‘Or’ the set of evaluated conditions, based on the sequencing rule definition. |
5. | Exit Sequencing Rule Check Subprocess (Result: the value of rule evaluation) |
pseudo code for sequencing rule check subprocess
Terminate Descendent Attempts Process [UP.3] For an activity: | ||
Reference: Current Activity AM.1.2; End Attempt Process UP.4 | ||
1. | Find the activity that is the common ancestor of the Current Activity and the identified activity | |
2. | Form the activity path as the ordered series of activities from the Current Activity to the common ancestor, exclusive of the Current Activity and the common ancestor | The current activity must have already been exited. |
3. | If the activity path is Not Empty Then | There are some activities that need to be terminated. |
3.1. | For each activity in the activity path | |
3.1.1. | Apply the End Attempt Process to the activity | End the current attempt on each activity. |
End For | ||
End If | ||
4. | Exit Terminate Descendent Attempts Process |
pseudo code for terminate descendent attempts process
For an activity: | ||
Reference: Activity is Active AM.1.1; Activity is Suspended AM.1.1; Attempt Completion Status TM.1.2.2; Attempt Progress Status TM.1.2.2; Completion Set by Content SM.11; Objective Contributes to Rollup SM.6; Objective Progress Status TM.1.1; Objective Satisfied Status TM.1.1; Objective Set by Content SM.11; Tracked SM.11; Overall Rollup Process RB.1.5 | ||
1. | If the activity is a leaf Then | |
1.1. | If Tracked for the activity is True Then | |
1.1.1. | If the Activity is Suspended for the activity is False Then | The sequencer will not affect the state of suspended activities. |
1.1.1.1. | If the Completion Set by Content for the activity is False Then | Should the sequencer set the completion status of the activity? |
1.1.1.1.1. | If the Attempt Progress Status for the activity is False Then | Did the content inform the sequencer of the activity’s completion status? |
1.1.1.1.1.1. | Set the Attempt Progress Status for the activity to True | |
1.1.1.1.1.2. | Set the Attempt Completion Status for the activity to True | |
End If | ||
End If | ||
1.1.1.2. | If the Objective Set by Content for the activity is False Then | Should the sequencer set the objective status of the activity? |
1.1.1.2.1. | For all objectives associated with the activity | |
1.1.1.2.1.1. | If the Objective Contributes to Rollup for the objective is True Then | |
1.1.1.2.1.1.1. | If the Objective Progress Status for the objective is False Then | Did the content inform the sequencer of the activity’s rolled-up objective status? |
1.1.1.2.1.1.1.1. | Set the Objective Progress Status for the objective to True | |
1.1.1.2.1.1.1.2. | Set the Objective Satisfied Status for the objective to True | |
End If | ||
End If | ||
End For | ||
End If | ||
End If | ||
End If | ||
2. | Else | The activity has children. |
2.1. | If the activity includes any child activity whose Activity is Suspended attribute is True Then | The suspended status of the parent |
End Attempt Process [UP.4] For an activity: | ||
is dependent on the suspended status of its children. | ||
2.1.1. | Set the Activity is Suspended for the activity to True | |
2.2. | Else | |
2.2.1. | Set the Activity is Suspended for the activity to False | |
End If | ||
End If | ||
3. | Set the Activity is Active for the activity to False | The current attempt on this activity has ended. |
4. | Apply the Overall Rollup Process to the activity | Ensure that any status change to this activity is propagated through the entire activity tree. |
5. | Exit End Attempt Subprocess |
pseudo code for end attempt process
Check Activity Process [UP.5] For an activity; returns True if the activity is disabled or violates any of its limit conditions: | ||
Reference: Disabled Rules SM.2; Limit Conditions Check Process UP.1; Sequencing Rules Check Process UP.2 | ||
1. | Apply the Sequencing Rules Check Process to the activity and the Disabled sequencing rules | Make sure the activity is not disabled. |
2. | If the Sequencing Rules Check Process does not return Nil Then | |
2.1. | Exit Check Activity Process (Result: True) | |
End If | ||
3. | Apply the Limit Conditions Check Process to the activity | Make sure the activity does not violate any limit condition. |
4. | If the Limit Conditions Check Process returns True Then | |
4.1. | Exit Check Activity Process (Result: True) | |
End If | ||
5. | Exit Check Activity Process (Result: False) | Activity is allowed. |
pseudo code for check activity process