org.activemath.webapp.exercises.tools
Class Exercise

java.lang.Object
  extended by org.activemath.webapp.exercises.tools.Exercise
All Implemented Interfaces:
Graph

public class Exercise
extends Object
implements Graph


Constructor Summary
Exercise(String exerciseId, String interactionId, org.jdom.Element metadata)
           
 
Method Summary
protected  void addEdge(Edge edge)
           
 String addInteraction()
          add new empty interaction to exercise with automaticly assigned interactionId
 void addInteraction(String interactionId)
          add new empty interaction to exercise
 void addInteractionGenerator(org.jdom.Element interactionGenerator)
          add as the case may be replace Element interaction_generator
 void addMetadata(org.jdom.Element metadata)
          add as the case may be replace Element metadata
 void addProblemstatement(List content)
           
 List edges()
           
 List edgesByFrom(String from)
           
 List edgesByTo(String to)
           
 org.jdom.Document getCleanedDocument()
           
 Interaction getCurrentInteraction()
           
 org.jdom.Document getDocument()
           
 String getExerciseId()
           
 org.jdom.Element getInteractionGenerator()
           
 Map getInteractions()
           
 org.jdom.Element getMetadata()
           
 org.jdom.Element getProblemstatement()
           
 boolean isAutomatic()
           
protected  void removeEdge(Edge edge)
           
protected  void removeEdgesToNode(String interactionId)
           
 void removeInteraction(String interactionId)
           
 void rotate(String interactionId)
           
 void setAutomatic(boolean a)
           
 void setCurrentInteraction(String interactionId)
           
 void sort(org.jdom.Document document)
           
 String suggestInteractionId()
           
 Vertex vertexById(String id)
           
 List vertices()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exercise

public Exercise(String exerciseId,
                String interactionId,
                org.jdom.Element metadata)
Method Detail

addMetadata

public void addMetadata(org.jdom.Element metadata)
add as the case may be replace Element metadata

Parameters:
org.jdom.Element - metadata to be added

addInteractionGenerator

public void addInteractionGenerator(org.jdom.Element interactionGenerator)
add as the case may be replace Element interaction_generator

Parameters:
org.jdom.Element - interactionGenerator to be added

addInteraction

public String addInteraction()
add new empty interaction to exercise with automaticly assigned interactionId


addInteraction

public void addInteraction(String interactionId)
add new empty interaction to exercise

Parameters:
java.lang.String - interactionId

addProblemstatement

public void addProblemstatement(List content)

getExerciseId

public String getExerciseId()

getCurrentInteraction

public Interaction getCurrentInteraction()

getMetadata

public org.jdom.Element getMetadata()

getInteractionGenerator

public org.jdom.Element getInteractionGenerator()

getProblemstatement

public org.jdom.Element getProblemstatement()

setCurrentInteraction

public void setCurrentInteraction(String interactionId)

removeInteraction

public void removeInteraction(String interactionId)

suggestInteractionId

public String suggestInteractionId()

getInteractions

public Map getInteractions()

getDocument

public org.jdom.Document getDocument()

getCleanedDocument

public org.jdom.Document getCleanedDocument()

rotate

public void rotate(String interactionId)

sort

public void sort(org.jdom.Document document)

addEdge

protected void addEdge(Edge edge)

removeEdge

protected void removeEdge(Edge edge)

removeEdgesToNode

protected void removeEdgesToNode(String interactionId)

vertices

public List vertices()
Specified by:
vertices in interface Graph

edges

public List edges()
Specified by:
edges in interface Graph

vertexById

public Vertex vertexById(String id)
Specified by:
vertexById in interface Graph

edgesByFrom

public List edgesByFrom(String from)
Specified by:
edgesByFrom in interface Graph

edgesByTo

public List edgesByTo(String to)
Specified by:
edgesByTo in interface Graph

setAutomatic

public void setAutomatic(boolean a)

isAutomatic

public boolean isAutomatic()