org.activemath.exercises.generators
Class DRGenerator
java.lang.Object
org.activemath.exercises.openmath.OpenMath
org.activemath.exercises.InteractionGenerator
org.activemath.exercises.generators.DRGenerator
- Direct Known Subclasses:
- IDEASGenerator, IntegralGenerator
public class DRGenerator
- extends InteractionGenerator
| Fields inherited from class org.activemath.exercises.InteractionGenerator |
activemathNamespace, dublinCoreNamespace, exercise, exerciseId, knownInteractions, lang, localUserModel, localUserModelActive, masterGenerator, om, omdocNamespace, openmathNamespace, parameters, presentationStrategy, serializer, session, theoryId |
|
Method Summary |
static org.jdom.Element |
amdel(String name)
|
static org.jdom.Element |
blank(String id)
|
static org.jdom.Element |
br()
|
org.jdom.Element |
cmp()
|
org.jdom.Element |
cmp(List content)
|
org.jdom.Element |
cmp(String content)
|
org.jdom.Element |
comparison(String type,
org.jdom.Element omobj)
|
org.jdom.Element |
composite(String map,
List comparisons)
|
org.jdom.Element |
condition(String target,
org.jdom.Element diagnosis,
org.jdom.Element comparison)
|
org.jdom.Element |
defaultCondition(String target,
org.jdom.Element diagnosis)
|
org.jdom.Element |
diagnosis(String achievementValue)
|
org.jdom.Element |
diagnosis(String achievementValue,
String buggyRuleId)
|
org.jdom.Element |
feedback(String id,
boolean showKR,
String decoration,
String keep,
String from,
List content,
String nextStepId)
|
org.jdom.Element |
feedbackBad(List content)
|
org.jdom.Element |
feedbackBad(List content,
String nextStepId)
|
org.jdom.Element |
feedbackGood(List content)
|
org.jdom.Element |
feedbackGood(List content,
String nextStepId)
|
org.jdom.Element |
feedbackNear(List content)
|
org.jdom.Element |
feedbackNear(List content,
String nextStepId)
|
org.jdom.Element |
feedbackSuboptimal(List content)
|
org.jdom.Element |
fromString(String str)
|
protected org.jdom.Element |
generateErrorDiagnosisFeedback()
|
protected org.jdom.Element |
generateFinalResult()
|
protected org.jdom.Element |
generateNextStepHint()
|
static String |
generateRandomId()
|
protected org.jdom.Element |
generateSolution()
|
protected org.jdom.Element |
generateTask()
|
Evaluator |
getAnswerEvaluator()
Provide an answer evaluator, if this generator requires a custom
one. |
String |
getDifficulty()
|
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. |
org.jdom.Element |
hint()
|
org.jdom.Element |
hint(List content)
|
org.jdom.Element |
hint(List content,
String hintId,
String nextId)
|
org.jdom.Element |
hintCondition(String target)
|
protected void |
initDifficulty()
|
void |
initEncoding()
|
void |
initFirstStepId()
|
protected String |
initParam(String paramname)
|
void |
initProblemStatement()
|
protected org.jdom.Element |
initTaskFromParam()
|
org.jdom.Element |
interaction(String id,
List content,
List conditions)
|
static boolean |
isSpecialRequest(org.jdom.Element request)
|
static boolean |
isSyntaxError(org.jdom.Element request)
|
org.jdom.Element |
makeNextStepHint()
|
org.jdom.Element |
makeNextStepHint(String hintId,
String nextId)
|
org.jdom.Element |
makeSolution()
|
org.jdom.Element |
makeSolution(String solutionId)
|
static org.jdom.Element |
makeSpecialCondition(String requestType,
String target)
|
org.jdom.Element |
numEq(org.jdom.Element omobj,
String epsilon)
|
static org.jdom.Element |
oma(org.jdom.Element el1,
org.jdom.Element el2,
org.jdom.Element el3,
org.jdom.Element el4,
org.jdom.Element el5,
org.jdom.Element el6)
|
static org.jdom.Element |
omdel(String name)
|
static org.jdom.Element |
omel(String name)
|
org.jdom.Element |
relation(String type,
String xref)
|
org.jdom.Element |
semEval(org.jdom.Element omobj)
|
org.jdom.Element |
semEval(org.jdom.Element omobj,
String context)
|
void |
setContext(String context)
|
void |
setDifficulty(String difficulty)
|
void |
setLang(String lang)
|
void |
setTask(org.jdom.Element task)
|
org.jdom.Element |
solution()
|
org.jdom.Element |
solution(List content)
|
org.jdom.Element |
solution(List content,
String solutionId)
|
org.jdom.Element |
solutionCondition(String target)
|
org.jdom.Element |
staticContent(List contentList,
String keep)
|
org.jdom.Element |
staticContent(String from,
String keep,
String decoration)
|
org.jdom.Element |
synEq(org.jdom.Element omobj)
|
org.jdom.Element |
task(String currentStepId,
List content,
String nextStepId)
|
org.jdom.Element |
task(String currentStepId,
List content,
String nextStepId,
String keepTask)
|
String |
toString(org.jdom.Element el)
|
String |
toString(List<org.jdom.Element> list)
|
org.jdom.Element |
unconditionalTransition(String target)
|
static org.jdom.Element |
with()
|
static org.jdom.Element |
with(String style)
|
| Methods inherited from class org.activemath.exercises.InteractionGenerator |
abort, getExerciseDocument, getExerciseId, getFeedback, getName, getParameters, getPresentationStrategy, getSession, getTheoryId, hasAnswerMap, isStrategy, setExerciseDocument, setExerciseId, setIsStrategy, 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 |
feedbackGenerator
protected FeedbackGenerator feedbackGenerator
userInput
protected org.jdom.Element userInput
currentStepId
protected String currentStepId
previousStepId
protected String previousStepId
taskIds
protected List taskIds
interactionIds
protected List interactionIds
badFeedbackIds
protected List badFeedbackIds
goodFeedbackIds
protected List goodFeedbackIds
suboptimalFeedbackIds
protected List suboptimalFeedbackIds
granThresholdFeedbackIds
protected List granThresholdFeedbackIds
granThresholdExceededFeedbackIds
protected List granThresholdExceededFeedbackIds
syntaxErrorFeedbackIds
protected List syntaxErrorFeedbackIds
hintIds
protected List hintIds
solutionIds
protected List solutionIds
FIRST_STEP_ID
protected String FIRST_STEP_ID
FINAL_CORRECT_ID
protected String FINAL_CORRECT_ID
task
protected org.jdom.Element task
problemStatement
protected org.jdom.Element problemStatement
finalResult
protected org.jdom.Element finalResult
encoding
protected String encoding
stepGran
protected int stepGran
granThreshold
protected int granThreshold
maxSolutionStepNr
protected int maxSolutionStepNr
maxUserSolStepNr
protected int maxUserSolStepNr
numberOfStepsLeft
protected int numberOfStepsLeft
hint
public static final org.jdom.Element hint
solution
public static final org.jdom.Element solution
difficulty
protected String difficulty
context
protected String context
DRGenerator
public DRGenerator()
DRGenerator
public DRGenerator(LocalUserModel localUserModel)
setLang
public void setLang(String lang)
- Overrides:
setLang in class InteractionGenerator
setContext
public void setContext(String context)
setDifficulty
public void setDifficulty(String difficulty)
getDifficulty
public String getDifficulty()
setTask
public void setTask(org.jdom.Element task)
initFirstStepId
public void initFirstStepId()
initDifficulty
protected void initDifficulty()
initEncoding
public void initEncoding()
initProblemStatement
public void initProblemStatement()
initParam
protected String initParam(String paramname)
initTaskFromParam
protected org.jdom.Element initTaskFromParam()
getInteraction
public org.jdom.Element getInteraction()
- Description copied from class:
InteractionGenerator
- Produce the initial node, where the exercise really starts.
- Overrides:
getInteraction in class InteractionGenerator
- 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)
- Description copied from class:
InteractionGenerator
- Produce an interaction element from the given ID attribute.
TODO: document here the basic structure of an interaction element.
- Overrides:
getInteraction in class InteractionGenerator
- Parameters:
id - value of the "id" attribute of the desired element.
- Returns:
- element found, or null.
makeNextStepHint
public org.jdom.Element makeNextStepHint()
makeNextStepHint
public org.jdom.Element makeNextStepHint(String hintId,
String nextId)
makeSolution
public org.jdom.Element makeSolution(String solutionId)
makeSolution
public org.jdom.Element makeSolution()
generateTask
protected org.jdom.Element generateTask()
generateFinalResult
protected org.jdom.Element generateFinalResult()
generateErrorDiagnosisFeedback
protected org.jdom.Element generateErrorDiagnosisFeedback()
generateNextStepHint
protected org.jdom.Element generateNextStepHint()
generateSolution
protected org.jdom.Element generateSolution()
omel
public static org.jdom.Element omel(String name)
omdel
public static org.jdom.Element omdel(String name)
amdel
public static org.jdom.Element amdel(String name)
br
public static org.jdom.Element br()
cmp
public org.jdom.Element cmp()
cmp
public org.jdom.Element cmp(String content)
cmp
public org.jdom.Element cmp(List content)
with
public static org.jdom.Element with(String style)
with
public static org.jdom.Element with()
blank
public static org.jdom.Element blank(String id)
task
public org.jdom.Element task(String currentStepId,
List content,
String nextStepId)
task
public org.jdom.Element task(String currentStepId,
List content,
String nextStepId,
String keepTask)
interaction
public org.jdom.Element interaction(String id,
List content,
List conditions)
feedbackGood
public org.jdom.Element feedbackGood(List content,
String nextStepId)
feedbackGood
public org.jdom.Element feedbackGood(List content)
feedbackSuboptimal
public org.jdom.Element feedbackSuboptimal(List content)
feedbackBad
public org.jdom.Element feedbackBad(List content,
String nextStepId)
feedbackBad
public org.jdom.Element feedbackBad(List content)
feedbackNear
public org.jdom.Element feedbackNear(List content,
String nextStepId)
feedbackNear
public org.jdom.Element feedbackNear(List content)
hint
public org.jdom.Element hint(List content,
String hintId,
String nextId)
hint
public org.jdom.Element hint(List content)
solution
public org.jdom.Element solution(List content,
String solutionId)
solution
public org.jdom.Element solution(List content)
feedback
public org.jdom.Element feedback(String id,
boolean showKR,
String decoration,
String keep,
String from,
List content,
String nextStepId)
unconditionalTransition
public org.jdom.Element unconditionalTransition(String target)
staticContent
public org.jdom.Element staticContent(List contentList,
String keep)
staticContent
public org.jdom.Element staticContent(String from,
String keep,
String decoration)
condition
public org.jdom.Element condition(String target,
org.jdom.Element diagnosis,
org.jdom.Element comparison)
defaultCondition
public org.jdom.Element defaultCondition(String target,
org.jdom.Element diagnosis)
hintCondition
public org.jdom.Element hintCondition(String target)
solutionCondition
public org.jdom.Element solutionCondition(String target)
hint
public org.jdom.Element hint()
solution
public org.jdom.Element solution()
diagnosis
public org.jdom.Element diagnosis(String achievementValue,
String buggyRuleId)
relation
public org.jdom.Element relation(String type,
String xref)
diagnosis
public org.jdom.Element diagnosis(String achievementValue)
composite
public org.jdom.Element composite(String map,
List comparisons)
comparison
public org.jdom.Element comparison(String type,
org.jdom.Element omobj)
semEval
public org.jdom.Element semEval(org.jdom.Element omobj)
semEval
public org.jdom.Element semEval(org.jdom.Element omobj,
String context)
numEq
public org.jdom.Element numEq(org.jdom.Element omobj,
String epsilon)
synEq
public org.jdom.Element synEq(org.jdom.Element omobj)
generateRandomId
public static String generateRandomId()
oma
public static org.jdom.Element oma(org.jdom.Element el1,
org.jdom.Element el2,
org.jdom.Element el3,
org.jdom.Element el4,
org.jdom.Element el5,
org.jdom.Element el6)
makeSpecialCondition
public static org.jdom.Element makeSpecialCondition(String requestType,
String target)
isSpecialRequest
public static boolean isSpecialRequest(org.jdom.Element request)
fromString
public org.jdom.Element fromString(String str)
toString
public String toString(org.jdom.Element el)
toString
public String toString(List<org.jdom.Element> list)
isSyntaxError
public static boolean isSyntaxError(org.jdom.Element request)
getAnswerEvaluator
public Evaluator getAnswerEvaluator()
- Description copied from class:
InteractionGenerator
- Provide an answer evaluator, if this generator requires a custom
one. Normally it would be enough with the default evaluator.
- Overrides:
getAnswerEvaluator in class InteractionGenerator
- Returns:
- Evaluator object.