public class ExternallyRunProblem extends ExternalProblem<ExternallyRunAnswer,ExternallyRunAnswerValue,ExternallyRunResponseValue>
answerableClasses, probProperties
defaultResponseDescription
Constructor and Description |
---|
ExternallyRunProblem(java.lang.String uid) |
ExternallyRunProblem(java.lang.String uid,
java.lang.String name,
java.lang.String description) |
Modifier and Type | Method and Description |
---|---|
protected ExternallyRunAnswer |
addAnswer(java.lang.String uid,
boolean isCorrect,
ExternalAnswerValuePart... valueParts)
Given a list of value parts, returns a subclass instance of an
Answer containing
those values. |
static java.lang.String |
getClassName() |
java.util.List<java.lang.String> |
getResponseTypeDescription() |
boolean |
isCorrect(ExternallyRunResponseValue response,
java.util.Map<java.lang.String,java.lang.String> args)
Determines whether the submitted response to this question is correct.
|
makeResponse
addAnswer, addProperty, getAnswer, getAnswerCount, getAnswerEvalType, getAnswerEvalTypes, getAnswers, getAnswers, getAnswerValuePartsList, getCorrectAnswer, getProblemTypeAttributes, getProblemTypeAttributes, getProperties, getProperty, getResponseEvalType, getResponseEvalTypes, getUnscrambledAnswerIndexes, getUnscrambledAnswerIndexes, getWrongAnswer, isAllowedAnswerEvalType, isAllowedResponseEvalType, isAnswerable, isCorrect, isCorrectDefault, isScrambleAnswers, registerProblemTypeAttributes, setAnswerEvalTypes, setAnswerEvalTypes, setAnswers, setCorrectAnswer, setProperties, setResponseEvalTypes, setResponseEvalTypes, setScrambleAnswers, setWrongAnswer, validate
getQuestion, setQuestion
initializeContent
getDescription, getName, setDescription, setName
createKey, createKey, equals, extractType, extractUID, getKey, getShortKey, getShortKey, getType, getUID, getValidatorUtilities, setValidatorUtilities, toString, validateKey
public ExternallyRunProblem(java.lang.String uid)
public ExternallyRunProblem(java.lang.String uid, java.lang.String name, java.lang.String description)
public static java.lang.String getClassName()
public java.util.List<java.lang.String> getResponseTypeDescription()
getResponseTypeDescription
in class Problem
public boolean isCorrect(ExternallyRunResponseValue response, java.util.Map<java.lang.String,java.lang.String> args)
AnswerableProblem
If your problem type defines correctness as when the student's response matches any one of
the answers marked as a correct answer, then your subclass can implement this method to call
#isCorrectDefault(StudentResponseValue)
.
If your problem type requires a different semantic for determining correctness, you must
implement that logic yourself in isCorrect(). In this case, your implementation
may want (or need) to call AnswerableProblem.setWrongAnswer(Answer)
so that a common wrong answer
is available later to a caller.
isCorrect
in class AnswerableProblem<ExternalAnswerValuePart,ExternallyRunAnswer,ExternallyRunAnswerValue,ExternallyRunResponseValue>
response
- The student's response to compare to this problem's answer list.args
- Map for problem specific properties that will
be used in calculating correctness for the problem.#isCorrectDefault(StudentResponseValue)
,
AnswerableProblem.setWrongAnswer(Answer)
protected ExternallyRunAnswer addAnswer(java.lang.String uid, boolean isCorrect, ExternalAnswerValuePart... valueParts)
AnswerableProblem
Answer
containing
those values.
It is highly recommended that each AnswerableProblem subclass implements a custom, public version of the addAnswer(...) method which hides from the calling code the variable arguments AnswerValuePart... valueParts.
For example, a fill in problem would implement:
public FillInAnswer addAnswer(String uid, boolean isCorrect, String value)
The implementation of this abstract method would be responsible for obtaining the evaluation type, and the subsequent creation of an AnswerValuePart.
addAnswer
in class AnswerableProblem<ExternalAnswerValuePart,ExternallyRunAnswer,ExternallyRunAnswerValue,ExternallyRunResponseValue>
uid
- Unique identifier for this answervalueParts
- The value parts comprising this answer.AnswerableProblem.getAnswerEvalTypes()
,
AnswerValuePart