org.activemath.exercises.generators
Class ExerciseGeneratorTools

java.lang.Object
  extended by org.activemath.exercises.openmath.OpenMathService
      extended by org.activemath.exercises.generators.ExerciseGeneratorTools

public class ExerciseGeneratorTools
extends OpenMathService


Field Summary
protected static org.jdom.Namespace activemathNamespace
           
protected static org.jdom.Namespace omdocNamespace
           
 
Fields inherited from class org.activemath.exercises.openmath.OpenMathService
comparatorCD, comparatorName, context, expressionTransformer, om, xpathError, xpathHint, xpathQuit
 
Constructor Summary
ExerciseGeneratorTools()
           
 
Method Summary
 org.jdom.Element addBlank(org.jdom.Element interactionMap, org.jdom.Element blank)
           
 org.jdom.Element addChoice(org.jdom.Element selection, org.jdom.Element choice)
           
 org.jdom.Element addSelection(org.jdom.Element interactionMap, org.jdom.Element selection)
           
static void main(String[] args)
           
 org.jdom.Element makeAnswerMap(List conditions)
           
 org.jdom.Element makeBlank(String forAtt)
           
 org.jdom.Element makeComparison(String comparisonType, org.jdom.Element expression)
           
 org.jdom.Element makeComplexCondition(org.jdom.Element diagnosis, List composites, String nextInteractionId)
           
 org.jdom.Element makeComposite()
           
 org.jdom.Element makeComposite(List comparisons)
           
 org.jdom.Element makeComposite(List comparisons, String mapAtt)
           
 org.jdom.Element makeComposite(String mapAtt)
           
 org.jdom.Element makeCondition(org.jdom.Element diagnosis, org.jdom.Element comparison, String nextInteractionId)
           
 org.jdom.Element makeCondition(org.jdom.Element diagnosis, List comparisons, String nextInteractionId)
           
 org.jdom.Element makeDiagnosis(String achievementValue, String relevanceValue, List misconceptions)
           
 org.jdom.Element makeFeedback(boolean keep)
          make empty feedback element if keep argument is true the feedback will be kept in the latter interactions
 org.jdom.Element makeFeedback(boolean keep, org.jdom.Content content)
          make a feedback element with content if keep argument is true the feedback will be kept in the latter interactions
 org.jdom.Element makeFeedback(boolean keep, String from)
          make empty feedback element with from attribute, specifying the id of the interaction the feedback should be imported from if keep argument is true the feedback will be kept in the latter interactions
 org.jdom.Element makeInteraction(String nextInteractionId)
          build an empty interaction with a pointer to the next step
 org.jdom.Element makeInteraction(String id, org.jdom.Element feedback, org.jdom.Element interactionMap, org.jdom.Element answerMap)
          make an interaction element which contains one feedback, interaction map and answer map
 org.jdom.Element makeInteraction(String id, org.jdom.Element interactionMetadata, org.jdom.Element feedback, org.jdom.Element interactionMap, org.jdom.Element answerMap)
          make an interaction element which contains interaction metadata, one feedback, interaction map and answer map
 org.jdom.Element makeInteraction(String id, org.jdom.Element interactionMetadata, org.jdom.Element feedback, String nextInteractionId)
          build an interaction element which only contains a step metadata, one feedback and an empty interaction, pointing to the next step
 org.jdom.Element makeInteraction(String id, org.jdom.Element interactionMetadata, List feedbacks, org.jdom.Element interactionMap, org.jdom.Element answerMap)
          make an interaction element which contains interaction metadata, list of feebacks, interaction map and answer map
 org.jdom.Element makeInteraction(String id, org.jdom.Element interactionMetadata, List feedbacks, org.jdom.Element interactionMap, List answerMaps)
          make interaction which contains interaction metadata, list of feedbacks, interaction map and a list of answer maps
 org.jdom.Element makeInteraction(String id, org.jdom.Element interactionMetadata, List feedbacks, String nextInteractionId)
          build an interaction element which contains interaction metadata, a list of feedbacks elements and an empty interaction, pointing to the next step
 org.jdom.Element makeInteraction(String id, org.jdom.Element feedback, String nextInteractionId)
          build an interaction element which contains only one feedback element and an empty interaction, pointing to the next step
 org.jdom.Element makeInteraction(String id, List interactionContent)
           
 org.jdom.Element makeInteraction(String id, List feedbacks, org.jdom.Element interactionMap, org.jdom.Element answerMap)
          make an interaction element which contains a list of feedbacks, interaction map and answer map
 org.jdom.Element makeInteraction(String id, List feedbacks, org.jdom.Element interactionMap, List answerMaps)
          make an interaction which contains the list of feedbacks, interaction map and a list of answer maps
 org.jdom.Element makeInteraction(String id, List feedbacks, String nextInteractionId)
          build an interaction element which contains a list of feedbacks elements and an empty interaction, pointing to the next step
 org.jdom.Element makeInteractionMap()
           
 org.jdom.Element makeInteractionMap(List blankIds)
          make interaction map which contains blanks with given ids
 org.jdom.Element makeNumEq(org.jdom.Element expression)
           
 org.jdom.Element makeNumEq(org.jdom.Element expression, String epsilon)
           
 org.jdom.Element makeSelection(String forAtt, boolean multiple)
           
 org.jdom.Element makeSemEval(org.jdom.Element expression)
           
 org.jdom.Element makeSemEval(org.jdom.Element expression, String context)
           
 org.jdom.Element makeSynEq(org.jdom.Element expression)
           
 
Methods inherited from class org.activemath.exercises.openmath.OpenMathService
abort, console, evaluate, evaluateEquivalence, selectContext, setComparator, setExpressionTransformer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

omdocNamespace

protected static final org.jdom.Namespace omdocNamespace

activemathNamespace

protected static final org.jdom.Namespace activemathNamespace
Constructor Detail

ExerciseGeneratorTools

public ExerciseGeneratorTools()
Method Detail

main

public static void main(String[] args)
Parameters:
args -

makeInteraction

public org.jdom.Element makeInteraction(String nextInteractionId)
build an empty interaction with a pointer to the next step

Parameters:
nextInteractionId -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        org.jdom.Element feedback,
                                        String nextInteractionId)
build an interaction element which contains only one feedback element and an empty interaction, pointing to the next step

Parameters:
feedback -
nextInteractionId -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        org.jdom.Element interactionMetadata,
                                        org.jdom.Element feedback,
                                        String nextInteractionId)
build an interaction element which only contains a step metadata, one feedback and an empty interaction, pointing to the next step

Parameters:
interactionMetadata -
feedback -
nextInteractionId -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        List feedbacks,
                                        String nextInteractionId)
build an interaction element which contains a list of feedbacks elements and an empty interaction, pointing to the next step

Parameters:
feedbacks -
nextInteractionId -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        org.jdom.Element interactionMetadata,
                                        List feedbacks,
                                        String nextInteractionId)
build an interaction element which contains interaction metadata, a list of feedbacks elements and an empty interaction, pointing to the next step

Parameters:
interactionMetadata -
feedbacks -
nextInteractionId -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        org.jdom.Element feedback,
                                        org.jdom.Element interactionMap,
                                        org.jdom.Element answerMap)
make an interaction element which contains one feedback, interaction map and answer map

Parameters:
feedback -
interactionMap -
answerMap -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        org.jdom.Element interactionMetadata,
                                        org.jdom.Element feedback,
                                        org.jdom.Element interactionMap,
                                        org.jdom.Element answerMap)
make an interaction element which contains interaction metadata, one feedback, interaction map and answer map

Parameters:
interactionMetadata -
feedback -
interactionMap -
answerMap -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        List feedbacks,
                                        org.jdom.Element interactionMap,
                                        org.jdom.Element answerMap)
make an interaction element which contains a list of feedbacks, interaction map and answer map

Parameters:
feedbacks -
interactionMap -
answerMap -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        org.jdom.Element interactionMetadata,
                                        List feedbacks,
                                        org.jdom.Element interactionMap,
                                        org.jdom.Element answerMap)
make an interaction element which contains interaction metadata, list of feebacks, interaction map and answer map

Parameters:
interactionMetadata -
feedbacks -
interactionMap -
answerMap -
Returns:
Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        List feedbacks,
                                        org.jdom.Element interactionMap,
                                        List answerMaps)
make an interaction which contains the list of feedbacks, interaction map and a list of answer maps

Parameters:
feedbacks -
interactionMap -
answerMaps -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        org.jdom.Element interactionMetadata,
                                        List feedbacks,
                                        org.jdom.Element interactionMap,
                                        List answerMaps)
make interaction which contains interaction metadata, list of feedbacks, interaction map and a list of answer maps

Parameters:
interactionMetadata -
feedbacks -
interactionMap -
answerMaps -
Returns:
interaction Element

makeInteraction

public org.jdom.Element makeInteraction(String id,
                                        List interactionContent)

makeFeedback

public org.jdom.Element makeFeedback(boolean keep)
make empty feedback element if keep argument is true the feedback will be kept in the latter interactions

Parameters:
keep -
Returns:
feedback Element

makeFeedback

public org.jdom.Element makeFeedback(boolean keep,
                                     String from)
make empty feedback element with from attribute, specifying the id of the interaction the feedback should be imported from if keep argument is true the feedback will be kept in the latter interactions

Parameters:
keep -
from -
Returns:
feedback Element

makeFeedback

public org.jdom.Element makeFeedback(boolean keep,
                                     org.jdom.Content content)
make a feedback element with content if keep argument is true the feedback will be kept in the latter interactions

Parameters:
keep -
content -
Returns:
feedback Element

makeInteractionMap

public org.jdom.Element makeInteractionMap(List blankIds)
make interaction map which contains blanks with given ids

Parameters:
blankIds -
Returns:

makeInteractionMap

public org.jdom.Element makeInteractionMap()

addBlank

public org.jdom.Element addBlank(org.jdom.Element interactionMap,
                                 org.jdom.Element blank)

addSelection

public org.jdom.Element addSelection(org.jdom.Element interactionMap,
                                     org.jdom.Element selection)

makeBlank

public org.jdom.Element makeBlank(String forAtt)

makeSelection

public org.jdom.Element makeSelection(String forAtt,
                                      boolean multiple)

addChoice

public org.jdom.Element addChoice(org.jdom.Element selection,
                                  org.jdom.Element choice)

makeAnswerMap

public org.jdom.Element makeAnswerMap(List conditions)

makeCondition

public org.jdom.Element makeCondition(org.jdom.Element diagnosis,
                                      org.jdom.Element comparison,
                                      String nextInteractionId)

makeCondition

public org.jdom.Element makeCondition(org.jdom.Element diagnosis,
                                      List comparisons,
                                      String nextInteractionId)

makeComplexCondition

public org.jdom.Element makeComplexCondition(org.jdom.Element diagnosis,
                                             List composites,
                                             String nextInteractionId)

makeComposite

public org.jdom.Element makeComposite()

makeComposite

public org.jdom.Element makeComposite(String mapAtt)

makeComposite

public org.jdom.Element makeComposite(List comparisons)

makeComposite

public org.jdom.Element makeComposite(List comparisons,
                                      String mapAtt)

makeComparison

public org.jdom.Element makeComparison(String comparisonType,
                                       org.jdom.Element expression)

makeSynEq

public org.jdom.Element makeSynEq(org.jdom.Element expression)

makeNumEq

public org.jdom.Element makeNumEq(org.jdom.Element expression)

makeNumEq

public org.jdom.Element makeNumEq(org.jdom.Element expression,
                                  String epsilon)

makeSemEval

public org.jdom.Element makeSemEval(org.jdom.Element expression)

makeSemEval

public org.jdom.Element makeSemEval(org.jdom.Element expression,
                                    String context)

makeDiagnosis

public org.jdom.Element makeDiagnosis(String achievementValue,
                                      String relevanceValue,
                                      List misconceptions)