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 TypeMethodDescriptionvoidAdds a choice to the available choices.Returns the list of choices.voidsetChoices(Collection<String> choices) Clears and updates the list of available choices.voidsetCorrectAnswer(String answer) Sets the correct answer to this question.Converts this profile into aMultiChoiceQuestionbean.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, setTotalAnswersMethods inherited from class org.deltava.beans.testing.Question
getAnswer, getCorrectAnswer, getExactMatch, getImageType, getNumber, getQuestion, getReference, isCorrect, setAnswer, setCorrect, setReferenceMethods inherited from class org.deltava.beans.ImageBean
checkParam, getFormat, getHasImage, getHeight, getSize, getWidth, load, load, setFormat, setHeight, setSize, setWidthMethods inherited from class org.deltava.beans.DatabaseBlobBean
clear, getInputStream, isLoadedMethods inherited from class org.deltava.beans.DatabaseBean
cacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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:
getChoicesin interfaceMultipleChoice- Returns:
- a Collection of choices
- See Also:
-
addChoice
Adds a choice to the available choices.- Specified by:
addChoicein 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:
setCorrectAnswerin classQuestion- Parameters:
answer- the correct answer- See Also:
-
toQuestion
Converts this profile into aMultiChoiceQuestionbean. The choices will be rearranged in random order.- Overrides:
toQuestionin classQuestionProfile- Returns:
- a Question bean
-