org.activemath.tutor
Class TutorialInteraction

java.lang.Object
  extended by org.activemath.tutor.TutorialInteraction

public class TutorialInteraction
extends Object

Class for tutorial interactions.

Each tutorial interaction solves a single task. It has the following attributes:


Field Summary
protected  OJDocument courseStructure
          Course structure achieving the tutorial task
protected static int idCounter
          Counter for ID generation
protected  Map initialWorldState
           
protected  Task task
          Tasks achieved by the tutorial interaction
protected  String tutorialInteractionId
          The identifier of the tutorial interaction
protected  String userId
          The user the tutorial interaction is for
protected  boolean wasInvoked
          True after trying to achieve a task (even in case of failure)
 
Constructor Summary
TutorialInteraction(String userId, Task task)
          Create a new tutorial interaction.
TutorialInteraction(String userId, Task task, Map initialWorldState)
           
TutorialInteraction(String userId, Task task, Map initialWorldState, String sessionId, String client)
           
 
Method Summary
protected static String generateID()
           
 OJDocument getCourseStructure()
           
static String getDocumentString(OJDocument omdoc)
          print out the DOM Object as XML string
 int getProgress()
          Query the current progressing status.
 Task getTask()
           
 String getTutorialInteractionId()
           
 String getUserId()
           
 void startThread()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

userId

protected String userId
The user the tutorial interaction is for


tutorialInteractionId

protected String tutorialInteractionId
The identifier of the tutorial interaction


courseStructure

protected OJDocument courseStructure
Course structure achieving the tutorial task


task

protected Task task
Tasks achieved by the tutorial interaction


wasInvoked

protected boolean wasInvoked
True after trying to achieve a task (even in case of failure)


idCounter

protected static int idCounter
Counter for ID generation


initialWorldState

protected Map initialWorldState
Constructor Detail

TutorialInteraction

public TutorialInteraction(String userId,
                           Task task)
Create a new tutorial interaction.


TutorialInteraction

public TutorialInteraction(String userId,
                           Task task,
                           Map initialWorldState)

TutorialInteraction

public TutorialInteraction(String userId,
                           Task task,
                           Map initialWorldState,
                           String sessionId,
                           String client)
Method Detail

generateID

protected static String generateID()

startThread

public void startThread()

getProgress

public int getProgress()
Query the current progressing status. If the thread for generation is finished, then return 100, else return 50.

Returns:

getCourseStructure

public OJDocument getCourseStructure()
Returns:
Returns the course structure that achieves the task (or null, if no course can achieve the task).

getTask

public Task getTask()

getTutorialInteractionId

public String getTutorialInteractionId()

getUserId

public String getUserId()

toString

public String toString()
Overrides:
toString in class Object

getDocumentString

public static String getDocumentString(OJDocument omdoc)
print out the DOM Object as XML string

Returns:
the XML String of the given OJDocument