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 TypeMethodDescriptionvoidAdds a Question to the Examination.booleanReturns whether this Examination was automatically scored.booleangetEmpty()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.booleanReturns if a route plotting question is included in this Examination.Returns the CSS class name for a view table row.intgetSize()Returns the number of questions in this Examination.booleanhasImage()Returns if the Examination has any questions with images.booleanReturns if the Examination has any multiple-choice questions.voidsetAutoScored(boolean isAutoScored) Updates whether this Examination was automatically scored.voidsetEmpty(boolean isEmpty) Marks this Examination as having all blank answers.voidsetExpiryDate(Instant dt) Updates the expiration date of this Examination.voidsetSize(int size) Updates the size of this examination.Methods inherited from class 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, setSubmittedOnModifier and TypeMethodDescriptionintbooleanReturns whether this Test is part of the Flight Academy.intReturns the Author of this bean.Returns the Examination comments.getDate()Returns the date this Examination was created/performed on.Returns the Pilot's first (given) name.Returns the Pilot's last (family) name.getName()Returns the name of the examination/video.getOwner()Returns the owner Airline of this Examination.booleanReturns if the Pilot passed or failed this examinationintgetScore()Returns the score of this examination.Returns the date/time this Examination was scored onintReturns the Scorer's Database ID.intgetStage()Returns the stage level of this examination/checkride.Returns the status of this examination.Returns the date/time this Examination was submitted on.voidsetAcademy(boolean academy) Marks this Test as part of the Flight Academy.voidsetAuthorID(int id) Updates the author of this bean.voidsetComments(String comments) Updates the Examination comments.voidUpdates this Examination's date.voidsetFirstName(String name) Sets the first (given) name of the Pilot.voidsetLastName(String name) Sets the last (family) name of the Pilot.voidUpdates this Examination's owner Airline.voidsetPassFail(boolean passFail) Sets whether this Pilot passed or failed the examination.voidsetScore(int score) Sets the score for this Examination.voidsetScoredOn(Instant dt) Updates this Examination's "scored on" date.voidsetScorerID(int id) Updates the database ID for the Pilot who scored this exam.voidsetStage(int stage) Sets the stage level for this Examination.voidSets the status for this Test.voidUpdates this Examination's submission date.Methods inherited from class DatabaseBean
cacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateIDModifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.booleangetHexID()Returns the hexadecimal database ID of this object.intgetID()Returns the database ID of this object.inthashCode()voidsetID(int id) Update the database row ID of this bean.static voidvalidateID(int oldID, int newID) Validates a database ID.static voidvalidateID(int oldID, int newID, boolean allowZero) Validates a database ID.
-
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:
setSizein 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
-