org.activemath.exercises
Class InteractionGenerator
java.lang.Object
org.activemath.exercises.openmath.OpenMath
org.activemath.exercises.InteractionGenerator
- Direct Known Subclasses:
- CasConsole, DRGenerator, EmbeddedHTMLGenerator, FractionsGenerator, HTWGenerator, MAPSMossaicControl, MAPSMossaicFremdPlannung, MathCoachGenerator, MathDoxInteractionManager, OmegaTutorGenerator, SelfRegulateStrategy, SelfRegulateStrategy2, SelfRegulateStrategyTest, STACKGenerator, Static, StrategyAction, TruthTables
public class InteractionGenerator
- extends OpenMath
Base class for interaction element generators.
- Version:
- $Revision: 1.18 $ $Date: 2011/08/24 16:48:11 $
| Methods inherited from class org.activemath.exercises.openmath.OpenMath |
applyBinding, getOmobjContents, oma, oma, oma, oma, oma, ombind, ombind, ombind, ombind, ombind, ombvar, ombvar, ombvar, ombvar, ome, ome, ome, ome, omf, omf, omi, omi, omobj, oms, omstr, omv, output, setOmNamespace, substituteVariables, tidyForOpenMath1, toDouble, toInt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serializer
protected org.jdom.output.XMLOutputter serializer
exercise
protected org.jdom.Document exercise
theoryId
protected String theoryId
exerciseId
protected String exerciseId
parameters
protected List parameters
openmathNamespace
protected static final org.jdom.Namespace openmathNamespace
dublinCoreNamespace
protected static final org.jdom.Namespace dublinCoreNamespace
omdocNamespace
protected static final org.jdom.Namespace omdocNamespace
activemathNamespace
protected static final org.jdom.Namespace activemathNamespace
om
protected static OpenMath om
localUserModel
protected LocalUserModel localUserModel
localUserModelActive
protected boolean localUserModelActive
masterGenerator
protected InteractionGenerator masterGenerator
presentationStrategy
protected PresentationStrategy presentationStrategy
knownInteractions
protected Map<String,org.jdom.Element> knownInteractions
session
protected AppSession session
lang
protected String lang
InteractionGenerator
public InteractionGenerator()
InteractionGenerator
public InteractionGenerator(LocalUserModel localUserModel)
InteractionGenerator
public InteractionGenerator(LocalUserModel localUserModel,
String lang)
setLang
public void setLang(String lang)
getExerciseDocument
public org.jdom.Document getExerciseDocument()
getTheoryId
public String getTheoryId()
getExerciseId
public String getExerciseId()
getParameters
public List getParameters()
setExerciseDocument
public void setExerciseDocument(org.jdom.Document exercise)
setTheoryId
public void setTheoryId(String theoryId)
setExerciseId
public void setExerciseId(String exerciseId)
setParameters
public void setParameters(List parameters)
setMasterGenerator
public void setMasterGenerator(InteractionGenerator masterGenerator)
getInteraction
public org.jdom.Element getInteraction()
- Produce the initial node, where the exercise really starts.
- Returns:
- JDOM element. Can be null only if the exercise item doesn't
have a root element.
getInteraction
public org.jdom.Element getInteraction(String id)
- Produce an interaction element from the given ID attribute.
TODO: document here the basic structure of an interaction element.
- Parameters:
id - value of the "id" attribute of the desired element.
- Returns:
- element found, or null.
getFeedback
public org.jdom.Element getFeedback(String id)
hasAnswerMap
protected boolean hasAnswerMap(org.jdom.Element interaction)
getAnswerEvaluator
public Evaluator getAnswerEvaluator()
- Provide an answer evaluator, if this generator requires a custom
one. Normally it would be enough with the default evaluator.
- Returns:
- Evaluator object.
abort
protected static void abort(String message)
- Abort and display a critical error to the user, by throwing a
RuntimeException.
- Parameters:
message - description of the problem.
getPresentationStrategy
public PresentationStrategy getPresentationStrategy()
setPresentationStrategy
public void setPresentationStrategy(PresentationStrategy presentationStrategy)
getName
public String getName()
setName
public void setName(String name)
isStrategy
public boolean isStrategy()
setIsStrategy
public void setIsStrategy(boolean isStrategy)
getSession
public AppSession getSession()
setSession
public void setSession(AppSession session)