Class Examination
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.testing.Test
org.deltava.beans.testing.Examination
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,AuthoredBean
,IDBean
,ViewEntry
,Cacheable
A class to store information about written examinations.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a Question to the Examination.boolean
Returns whether this Examination was automatically scored.boolean
getEmpty()
Returns whether this Examination's answers were empty.Returns the Expiration Date of this Examination.getQuestion
(int idx) Returns a specific Question from the Examination.Returns this Examination's questions.boolean
Returns if a route plotting question is included in this Examination.Returns the CSS class name for a view table row.int
getSize()
Returns the number of questions in this Examination.boolean
hasImage()
Returns if the Examination has any questions with images.boolean
Returns if the Examination has any multiple-choice questions.void
setAutoScored
(boolean isAutoScored) Updates whether this Examination was automatically scored.void
setEmpty
(boolean isEmpty) Marks this Examination as having all blank answers.void
setExpiryDate
(Instant dt) Updates the expiration date of this Examination.void
setSize
(int size) Updates the size of this examination.Methods inherited from class org.deltava.beans.testing.Test
compareTo, getAcademy, getAuthorID, getComments, getDate, getFirstName, getLastName, getName, getOwner, getPassFail, getScore, getScoredOn, getScorerID, getStage, getStatus, getSubmittedOn, setAcademy, setAuthorID, setComments, setDate, setFirstName, setLastName, setOwner, setPassFail, setScore, setScoredOn, setScorerID, setStage, setStatus, setSubmittedOn
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateID
-
Field Details
-
QUESTIONNAIRE_NAME
-
-
Constructor Details
-
Examination
Creates a new examination.- Parameters:
name
- the name of the examination
-
-
Method Details
-
getSize
-
getExpiryDate
Returns the Expiration Date of this Examination.- Returns:
- the date/time this exam must be completed by
- See Also:
-
getQuestions
Returns this Examination's questions.- Returns:
- a List of questions.
- See Also:
-
getEmpty
public boolean getEmpty()Returns whether this Examination's answers were empty.- Returns:
- TRUE if all Answers are blank, otherwise FALSE
- See Also:
-
getRoutePlot
public boolean getRoutePlot()Returns if a route plotting question is included in this Examination.- Returns:
- TRUE if a route plotting question is included, otherwise FALSE
- See Also:
-
getQuestion
Returns a specific Question from the Examination.- Parameters:
idx
- the question number- Returns:
- the Question with the specified number, or null if not present
-
getAutoScored
public boolean getAutoScored()Returns whether this Examination was automatically scored.- Returns:
- TRUE if the Examination was automatically scored, otherwise FALSE
- See Also:
-
hasMultipleChoice
public boolean hasMultipleChoice()Returns if the Examination has any multiple-choice questions.- Returns:
- TRUE if there is at least one multiple-choice question, otherwise FALSE
-
hasImage
public boolean hasImage()Returns if the Examination has any questions with images.- Returns:
- TRUE if there is at least one question with an image, otherwise false
-
setEmpty
public void setEmpty(boolean isEmpty) Marks this Examination as having all blank answers.- Parameters:
isEmpty
- TRUE if all answers are blank, otherwise FALSE- Throws:
IllegalStateException
- if Questions have been populated- See Also:
-
addQuestion
Adds a Question to the Examination.- Parameters:
q
- the Question to add- See Also:
-
setSize
public void setSize(int size) Updates the size of this examination.- Specified by:
setSize
in classTest
- Parameters:
size
- the number of questions- Throws:
IllegalStateException
- if at least one question has been aded to this exam- See Also:
-
setExpiryDate
Updates the expiration date of this Examination.- Parameters:
dt
- the new expiration date- See Also:
-
setAutoScored
public void setAutoScored(boolean isAutoScored) Updates whether this Examination was automatically scored.- Parameters:
isAutoScored
- TRUE if the Examination was automatically scored, otherwise FALSE- See Also:
-
getRowClassName
Returns the CSS class name for a view table row.- Returns:
- the CSS class name
-