public class SortingProblem extends ChooseNProblem
answerableClasses, probProperties
defaultResponseDescription
Constructor and Description |
---|
SortingProblem(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 SortingProblem.
|
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.
|
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, validate
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 SortingProblem.
public static java.lang.String getClassName()
public ChooseNResponseValue makeResponse(java.lang.String... responseParts)
makeResponse
in class ChooseNProblem
responseParts
- An array containing the indexes of the student's selection as ordered
by the student.
For example: If the are are 4 "answers" displayed in the order 'C', 'A', 'D', 'B':
[0]: 'C'and the student assigned the sorted order as:
3 - [0]: 'C'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 java.util.List<java.lang.String> getResponseTypeDescription()
getResponseTypeDescription
in class ChooseNProblem