org.olat.modules.scorm.server.sequence
Class SequenceManager

java.lang.Object
  extended by org.olat.modules.scorm.server.sequence.SequenceManager

public class SequenceManager
extends java.lang.Object

A class used to figure out the sequencing for a package. It has methods which the LMS frameset can call to find out what the current state of the package is at any one given time. - ie what item comes next?. This class holds a hashtable of ItemSequence (the class used to house each item). It also holds a PrerequisiteManager - the class used to figure out the AICC script which can be found under the prerequisites section of a scorm package.

Author:
Paul Sharples

Field Summary
static int COURSE_COMPLETED_VALUE
          Comment for COURSE_COMPLETED_VALUE
 
Constructor Summary
SequenceManager(java.lang.String org, ISettingsHandler settings)
          Default constructor
 
Method Summary
 void addNewItem(java.lang.String scoId, java.lang.String launchUrl, int sequence, java.lang.String scoType, java.lang.String title, java.lang.String prereqs)
          Method to populate a single instance of itemsequence with the information found within the settings(navigation) xml file.
 void addtoPrereqTable(java.lang.String sco, java.lang.String status, boolean persist)
          Method to allow us to update our prerequisite table.
 boolean checkItemsPrerequisites()
          A method to allow us to check if the current item has its prerequisites completed.
 boolean checkItemsPrerequisites(java.lang.String itemID)
          A method to allow us to check if the current item has its prerequisites completed.
 boolean doesItemExist(java.lang.String item)
          Check if an item actaully exists
 java.lang.String findFirstItemToLaunch()
          Method to figure out, what the first item is to be launched when the package is played.
 java.lang.String findItemFromIndex(int index)
          A method to find a scoID from the itemsequence hashtable, based on an index (number).
 java.lang.String getCurrentSco()
          Method to allow us to get the current sco ID
 ItemSequence getItem(java.lang.String itemId)
          A Method to get a itemsequence, based on its scoID (which also happens to be its key)
 java.lang.String getLaunchFromId(java.lang.String scoIdentifier)
          Methos to return the correct launch url for this sco
 java.lang.String[][] getPackageStatus()
           
 int getSequenceFromId(java.lang.String scoIdentifier)
          Given a identifier - return the items sequence
 boolean hasItemBeenCompleted(java.lang.String scoID)
          Method to check if an item has been completed
 boolean isFirstItem(java.lang.String scoIdentifier)
          Method to find out if requested sco is the first item in the course
 boolean isItemSco(java.lang.String itemId)
          Check if an item is a sco or not
 boolean isLastItem(java.lang.String scoIdentifier)
          Method to find out if requested sco is the last item in the course
 void setCurrentSco(java.lang.String _sco)
          Method to allow us to set the current sco
 void showPreReqTable()
          Method to ask the prerequisite manager to show the prerequisite table.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COURSE_COMPLETED_VALUE

public static final int COURSE_COMPLETED_VALUE
Comment for COURSE_COMPLETED_VALUE

See Also:
Constant Field Values
Constructor Detail

SequenceManager

public SequenceManager(java.lang.String org,
                       ISettingsHandler settings)
Default constructor

Parameters:
org -
Method Detail

findFirstItemToLaunch

public java.lang.String findFirstItemToLaunch()
Method to figure out, what the first item is to be launched when the package is played.

Returns:
- a string referencing the sco ID

getPackageStatus

public java.lang.String[][] getPackageStatus()
Returns:
package status

hasItemBeenCompleted

public boolean hasItemBeenCompleted(java.lang.String scoID)
Method to check if an item has been completed

Parameters:
scoID -
Returns:
true if item is compl.

showPreReqTable

public void showPreReqTable()
Method to ask the prerequisite manager to show the prerequisite table.


checkItemsPrerequisites

public boolean checkItemsPrerequisites()
A method to allow us to check if the current item has its prerequisites completed.

Returns:
true if item has prereq.

checkItemsPrerequisites

public boolean checkItemsPrerequisites(java.lang.String itemID)
A method to allow us to check if the current item has its prerequisites completed. Can be passed a item id.

Parameters:
itemID -
Returns:
if item has prereq.

doesItemExist

public boolean doesItemExist(java.lang.String item)
Check if an item actaully exists

Parameters:
item -
Returns:
if item exists

addtoPrereqTable

public void addtoPrereqTable(java.lang.String sco,
                             java.lang.String status,
                             boolean persist)
Method to allow us to update our prerequisite table.

Parameters:
sco -
status -
persist -

setCurrentSco

public void setCurrentSco(java.lang.String _sco)
Method to allow us to set the current sco

Parameters:
_sco -

getCurrentSco

public java.lang.String getCurrentSco()
Method to allow us to get the current sco ID

Returns:
the current sco

getItem

public ItemSequence getItem(java.lang.String itemId)
A Method to get a itemsequence, based on its scoID (which also happens to be its key)

Parameters:
itemId -
Returns:
an ItemSequence

isItemSco

public boolean isItemSco(java.lang.String itemId)
Check if an item is a sco or not

Parameters:
itemId -
Returns:
true if item is sco

addNewItem

public void addNewItem(java.lang.String scoId,
                       java.lang.String launchUrl,
                       int sequence,
                       java.lang.String scoType,
                       java.lang.String title,
                       java.lang.String prereqs)
Method to populate a single instance of itemsequence with the information found within the settings(navigation) xml file. Its then added to the hastable of itemsequence found above

Parameters:
scoId - - actual scoID
launchUrl - - the launch
sequence - - this scos order or sequence
scoType - - SCO or Asset
title - - The title of this sco (found in manifest )<DD><CODE>prereqs</CODE> - - any prerequisites for this sco</DL> </DD> </DL> <HR> <A NAME="getLaunchFromId(java.lang.String)"><!-- --></A><H3> getLaunchFromId</H3> <PRE> public java.lang.String <B>getLaunchFromId</B>(java.lang.String scoIdentifier)</PRE> <DL> <DD>Methos to return the correct launch url for this sco <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>scoIdentifier</CODE> - <DT><B>Returns:</B><DD>an url string</DL> </DD> </DL> <HR> <A NAME="getSequenceFromId(java.lang.String)"><!-- --></A><H3> getSequenceFromId</H3> <PRE> public int <B>getSequenceFromId</B>(java.lang.String scoIdentifier)</PRE> <DL> <DD>Given a identifier - return the items sequence <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>scoIdentifier</CODE> - <DT><B>Returns:</B><DD>return the items sequence</DL> </DD> </DL> <HR> <A NAME="findItemFromIndex(int)"><!-- --></A><H3> findItemFromIndex</H3> <PRE> public java.lang.String <B>findItemFromIndex</B>(int index)</PRE> <DL> <DD>A method to find a scoID from the itemsequence hashtable, based on an index (number). Used when we need to find out, what the next item is (in order) <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>index</CODE> - (number) <DT><B>Returns:</B><DD>a sco ID</DL> </DD> </DL> <HR> <A NAME="isFirstItem(java.lang.String)"><!-- --></A><H3> isFirstItem</H3> <PRE> public boolean <B>isFirstItem</B>(java.lang.String scoIdentifier)</PRE> <DL> <DD>Method to find out if requested sco is the first item in the course <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>scoIdentifier</CODE> - <DT><B>Returns:</B><DD>true or false</DL> </DD> </DL> <HR> <A NAME="isLastItem(java.lang.String)"><!-- --></A><H3> isLastItem</H3> <PRE> public boolean <B>isLastItem</B>(java.lang.String scoIdentifier)</PRE> <DL> <DD>Method to find out if requested sco is the last item in the course <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>scoIdentifier</CODE> - <DT><B>Returns:</B><DD>true or false</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev">  <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SequenceManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../../../../org/olat/modules/scorm/server/sequence/PrerequisiteManager.html" title="class in org.olat.modules.scorm.server.sequence"><B>PREV CLASS</B></A>   NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/olat/modules/scorm/server/sequence/SequenceManager.html" target="_top"><B>FRAMES</B></A>    <A HREF="SequenceManager.html" target="_top"><B>NO FRAMES</B></A>    <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>