public abstract class ExternallyGradedProblem extends ExternalProblem<ExternallyGradedAnswer,ExternallyGradedAnswerValue,ExternallyGradedResponseValue>
answerableClasses, probProperties
defaultResponseDescription
Modifier | Constructor and Description |
---|---|
protected |
ExternallyGradedProblem(java.lang.String classType,
java.lang.String uid)
Constructor
For use when
ProblemFillIn has been subclassed. |
|
ExternallyGradedProblem(java.lang.String classType,
java.lang.String uid,
java.lang.String name,
java.lang.String description)
Constructor
For use when calling code directly needs an instance of
ProblemFillIn . |
Modifier and Type | Method and Description |
---|---|
protected ExternallyGradedAnswer |
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. |
boolean |
isCorrect(ExternallyGradedResponseValue 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, getResponseTypeDescription, setQuestion
initializeContent
getDescription, getName, setDescription, setName
createKey, createKey, equals, extractType, extractUID, getKey, getShortKey, getShortKey, getType, getUID, getValidatorUtilities, setValidatorUtilities, toString, validateKey
protected ExternallyGradedProblem(java.lang.String classType, java.lang.String uid)
ProblemFillIn
has been subclassed. In that case
the subclass will need to use this constructor to specify its classType.classType
- Subclass' class type as a fully specified name. For example:
org.assistments.core.domain.FillInWithUnitsProblem
.uid
- public ExternallyGradedProblem(java.lang.String classType, java.lang.String uid, java.lang.String name, java.lang.String description)
ProblemFillIn
.uid
- UID of this instance.name
- The name given to the problemdescription
- A short description of the problempublic boolean isCorrect(ExternallyGradedResponseValue 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,ExternallyGradedAnswer,ExternallyGradedAnswerValue,ExternallyGradedResponseValue>
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 ExternallyGradedAnswer 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,ExternallyGradedAnswer,ExternallyGradedAnswerValue,ExternallyGradedResponseValue>
uid
- Unique identifier for this answervalueParts
- The value parts comprising this answer.AnswerableProblem.getAnswerEvalTypes()
,
AnswerValuePart