Class MultiChoiceQuestion
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.DatabaseBlobBean
org.deltava.beans.ImageBean
org.deltava.beans.testing.Question
org.deltava.beans.testing.MultiChoiceQuestion
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,IDBean
,MultipleChoice
,Cacheable
- Direct Known Subclasses:
RoutePlotQuestion
A bean to store multiple-choice examination questions.
- Since:
- 1.0
- Version:
- 9.0
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.deltava.beans.ImageBean
ImageBean.ImageFormat
-
Field Summary
Fields inherited from class org.deltava.beans.DatabaseBlobBean
_buffer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a choice to the available choices.Returns the list of choices.final boolean
Returns if the user has provided the exact correct answer.int
Returns the maximum length of any of the answer choices.Methods inherited from class org.deltava.beans.testing.Question
compareTo, getAnswer, getCorrectAnswer, getImageType, getNumber, getQuestion, getReference, isCorrect, setAnswer, setCorrect, setCorrectAnswer, setNumber, setReference
Methods inherited from class org.deltava.beans.ImageBean
checkParam, getFormat, getHasImage, getHeight, getSize, getWidth, load, load, setFormat, setHeight, setSize, setWidth
Methods inherited from class org.deltava.beans.DatabaseBlobBean
clear, getInputStream, isLoaded
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateID
-
Constructor Details
-
MultiChoiceQuestion
Creates a new Question bean- Parameters:
text
- the Question text- Throws:
NullPointerException
- if text is null
-
-
Method Details
-
getChoices
Returns the list of choices.- Specified by:
getChoices
in interfaceMultipleChoice
- Returns:
- a List of choices
- See Also:
-
getMaxAnswerLength
public int getMaxAnswerLength()Returns the maximum length of any of the answer choices.- Returns:
- the maximum answer length
-
addChoice
Adds a choice to the available choices.- Specified by:
addChoice
in interfaceMultipleChoice
- Parameters:
choice
- the choice text- Throws:
NullPointerException
- if choice is null- See Also:
-
getExactMatch
public final boolean getExactMatch()Returns if the user has provided the exact correct answer.- Overrides:
getExactMatch
in classQuestion
- Returns:
- FALSE always
-