Class MultiChoiceQuestionProfile
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.DatabaseBlobBean
org.deltava.beans.ImageBean
org.deltava.beans.testing.Question
org.deltava.beans.testing.QuestionProfile
org.deltava.beans.testing.MultiChoiceQuestionProfile
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Object>
,Auditable
,IDBean
,MultipleChoice
,PassStatistics
,ViewEntry
,Cacheable
- Direct Known Subclasses:
RoutePlotQuestionProfile
A bean to store multiple-choice question data.
- Since:
- 1.0
- Version:
- 7.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
ConstructorsConstructorDescriptionCreates a new multiple-choice question profile. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a choice to the available choices.Returns the list of choices.void
setChoices
(Collection<String> choices) Clears and updates the list of available choices.void
setCorrectAnswer
(String answer) Sets the correct answer to this question.Converts this profile into aMultiChoiceQuestion
bean.Methods inherited from class org.deltava.beans.testing.QuestionProfile
addAirline, addExam, compareTo, getActive, getAirlines, getAuditID, getExams, getOwner, getPassCount, getRowClassName, getTotal, setActive, setAirlines, setCorrectAnswers, setExams, setNumber, setOwner, setQuestion, setTotalAnswers
Methods inherited from class org.deltava.beans.testing.Question
getAnswer, getCorrectAnswer, getExactMatch, getImageType, getNumber, getQuestion, getReference, isCorrect, setAnswer, setCorrect, 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.deltava.beans.Auditable
getAuditType, isCrossApp
-
Constructor Details
-
MultiChoiceQuestionProfile
Creates a new multiple-choice question profile.- 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 Collection of choices
- See Also:
-
addChoice
Adds a choice to the available choices.- Specified by:
addChoice
in interfaceMultipleChoice
- Parameters:
choice
- the choice text- See Also:
-
setChoices
Clears and updates the list of available choices.- Parameters:
choices
- a Collection of choices- See Also:
-
setCorrectAnswer
Sets the correct answer to this question.- Overrides:
setCorrectAnswer
in classQuestion
- Parameters:
answer
- the correct answer- See Also:
-
toQuestion
Converts this profile into aMultiChoiceQuestion
bean. The choices will be rearranged in random order.- Overrides:
toQuestion
in classQuestionProfile
- Returns:
- a Question bean
-