org.activemath.exercises.generators
Class Randomizer

java.lang.Object
  extended by org.activemath.exercises.openmath.OpenMath
      extended by org.activemath.exercises.InteractionGenerator
          extended by org.activemath.exercises.generators.Static
              extended by org.activemath.exercises.generators.Randomizer

public class Randomizer
extends Static

Randomizer of exercises. Replaces variables in expressions with values picked randomly from a list. The extensions for intervals and generated mathematical expressions are documented at: http://www.matracas.org/escritos/index.en.html#edtech2007_randomizer

Version:
$Revision: 1.18 $ $Date: 2008/01/08 10:10:09 $

Field Summary
protected  boolean adaptKnowledge
           
protected  String competency
           
protected  String conceptId
           
protected  String difficulty
           
protected  org.jdom.Element initialInteraction
           
protected  Map knownInteractions
           
protected  String typicalLearningTime
           
protected  Map variables
           
 
Fields inherited from class org.activemath.exercises.generators.Static
initialNode
 
Fields inherited from class org.activemath.exercises.InteractionGenerator
activemathNamespace, dublinCoreNamespace, exercise, exerciseId, lang, localUserModel, localUserModelActive, masterGenerator, om, omdocNamespace, openmathNamespace, parameters, presentationStrategy, serializer, session, theoryId
 
Constructor Summary
Randomizer(LocalUserModel localUserModel)
           
 
Method Summary
protected  String getConstantName(org.jdom.Element om)
           
 org.jdom.Element getInteraction()
          Produce the initial node, where the exercise really starts.
 org.jdom.Element getInteraction(String id)
          Produce an interaction element from the given ID attribute.
 
Methods inherited from class org.activemath.exercises.InteractionGenerator
abort, getAnswerEvaluator, getExerciseDocument, getExerciseId, getFeedback, getName, getParameters, getPresentationStrategy, getSession, getTheoryId, hasAnswerMap, isStrategy, setExerciseDocument, setExerciseId, setIsStrategy, setLang, setMasterGenerator, setName, setParameters, setPresentationStrategy, setSession, setTheoryId
 
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
 

Field Detail

initialInteraction

protected org.jdom.Element initialInteraction

knownInteractions

protected Map knownInteractions

variables

protected Map variables

conceptId

protected String conceptId

competency

protected String competency

difficulty

protected String difficulty

typicalLearningTime

protected String typicalLearningTime

adaptKnowledge

protected boolean adaptKnowledge
Constructor Detail

Randomizer

public Randomizer(LocalUserModel localUserModel)
Method Detail

getInteraction

public org.jdom.Element getInteraction()
Produce the initial node, where the exercise really starts.

Overrides:
getInteraction in class Static
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.

Overrides:
getInteraction in class Static
Parameters:
id - value of the "id" attribute of the desired element.
Returns:
element found, or null.

getConstantName

protected String getConstantName(org.jdom.Element om)