public final class ChooseOneProblem extends ChooseNProblem
ChooseOneProblem
represents ... tbs
Currently this class is final
. If you need to subclass it and thus remove
final
, you need to add a second constructor which takes two parameters:
public ChooseOneProblem(String classType, String uid)
Subclasses of would use that new constructor and pass the subclass'
type via a call to super(classType, uid)
).
answerableClasses, probProperties
defaultResponseDescription
Constructor and Description |
---|
ChooseOneProblem(java.lang.String uid) |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getClassName()
Returns this class' fully specified name.
|
static AnswerableProblemAttributes |
getProblemAttributes()
Returns the problem type attributes for ChooseOneProblem.
|
java.util.List<java.lang.String> |
getResponseTypeDescription() |
boolean |
isCorrect(ChooseNResponseValue response,
java.util.Map<java.lang.String,java.lang.String> args)
Determines whether the submitted response to this question is correct.
|
ChooseNResponseValue |
makeResponse(java.lang.String... responseParts)
Creates an object that holds the student's response to the question.
|
void |
validate()
Check this object's data for inconsistencies
Subclasses must (by informal contract) implement this method!
|
addAnswer, addAnswer
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
getQuestion, setQuestion
initializeContent
getDescription, getName, setDescription, setName
createKey, createKey, equals, extractType, extractUID, getKey, getShortKey, getShortKey, getType, getUID, getValidatorUtilities, setValidatorUtilities, toString, validateKey
public static AnswerableProblemAttributes getProblemAttributes()
This is a convenience method so that a caller can gain access to the problem type attributes without having to first instantiate an instance of ChooseOneProblem.
public static java.lang.String getClassName()
public ChooseNResponseValue makeResponse(java.lang.String... responseParts)
ChooseNProblem
makeResponse
in class ChooseNProblem
responseParts
- An array containing the indexes of the student's selection.
For example: if the student checked off the 1st, 3rd, and 4th items, responseParts
would contain:
public boolean isCorrect(ChooseNResponseValue 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 ChooseNProblem
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)
public void validate() throws ValidationException
SelfValidating
validate
in interface SelfValidating
validate
in class AnswerableProblem<ChooseNAnswerValuePart,ChooseNAnswer,ChooseNAnswerValue,ChooseNResponseValue>
ValidationException
- if the data is invalidpublic java.util.List<java.lang.String> getResponseTypeDescription()
getResponseTypeDescription
in class ChooseNProblem