Class Test
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.testing.Test
- All Implemented Interfaces:
Serializable,Comparable<Object>,AuthoredBean,IDBean,ViewEntry,Cacheable
- Direct Known Subclasses:
CheckRide,Examination
An class to implement commonalities between user examinations and flight videos.
- Since:
- 1.0
- Version:
- 8.0
- Author:
- Luke
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier 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.abstract intgetSize()Returns the number of questions in the examination.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.abstract voidsetSize(int size) Updates the number of questions in this examination.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 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.ViewEntry
getRowClassName
-
Field Details
-
_score
protected int _score
-
-
Constructor Details
-
Test
Create a new examination/video with a particular name.- Parameters:
name- the name of the exam/video- Throws:
NullPointerException- if name is null- See Also:
-
-
Method Details
-
getName
Returns the name of the examination/video.- Returns:
- the name of the exam/video
-
getFirstName
Returns the Pilot's first (given) name.- Returns:
- the Pilot's first name
- See Also:
-
getLastName
Returns the Pilot's last (family) name.- Returns:
- the Pilot's last name
- See Also:
-
getAuthorID
public int getAuthorID()Description copied from interface:AuthoredBeanReturns the Author of this bean.- Specified by:
getAuthorIDin interfaceAuthoredBean- Returns:
- the author's database ID
- See Also:
-
getStatus
-
getAcademy
public boolean getAcademy()Returns whether this Test is part of the Flight Academy.- Returns:
- TRUE if the Test is part of the Flight Academy, otherwise FALSE
- See Also:
-
getOwner
Returns the owner Airline of this Examination.- Returns:
- the AirlineInformation bean
- See Also:
-
getScorerID
public int getScorerID()Returns the Scorer's Database ID. This corresponds to the key in the PILOTS for the entry of the Pilot who scored this Test.- Returns:
- the database ID
- See Also:
-
getScore
public int getScore()Returns the score of this examination.- Returns:
- the score achieved, from 0 to 100.
- See Also:
-
getSize
public abstract int getSize()Returns the number of questions in the examination.- Returns:
- the size of the examination.
-
getStage
public int getStage()Returns the stage level of this examination/checkride.- Returns:
- the stage from 1 to 5
- See Also:
-
getPassFail
public boolean getPassFail()Returns if the Pilot passed or failed this examination- Returns:
- TRUE if the pilot passed, otherwise FALSE
- See Also:
-
getComments
-
getDate
Returns the date this Examination was created/performed on.- Returns:
- the creation Date
- See Also:
-
getSubmittedOn
Returns the date/time this Examination was submitted on.- Returns:
- the submission Date
- See Also:
-
getScoredOn
Returns the date/time this Examination was scored on- Returns:
- the scoring Date
- See Also:
-
setFirstName
Sets the first (given) name of the Pilot.- Parameters:
name- the Pilot's first name- See Also:
-
setLastName
Sets the last (family) name of the Pilot.- Parameters:
name- the Pilot's last name- See Also:
-
setAuthorID
public void setAuthorID(int id) Description copied from interface:AuthoredBeanUpdates the author of this bean.- Specified by:
setAuthorIDin interfaceAuthoredBean- Parameters:
id- the author's database ID.- See Also:
-
setAcademy
public void setAcademy(boolean academy) Marks this Test as part of the Flight Academy.- Parameters:
academy- TRUE if the Test is part of the Flight Academy, otherwise FALSE- See Also:
-
setScorerID
public void setScorerID(int id) Updates the database ID for the Pilot who scored this exam. This will typically be called by a DAO.- Parameters:
id- the new database ID- Throws:
IllegalArgumentException- if id is negative- See Also:
-
setScore
public void setScore(int score) Sets the score for this Examination.- Parameters:
score- the number of correct answers- Throws:
IllegalArgumentException- if score is negative or greater than getSize()- See Also:
-
setStatus
Sets the status for this Test.- Parameters:
s- the Status- See Also:
-
setStage
public void setStage(int stage) Sets the stage level for this Examination.- Parameters:
stage- the stage- See Also:
-
setPassFail
public void setPassFail(boolean passFail) Sets whether this Pilot passed or failed the examination.- Parameters:
passFail- TRUE if the Pilot passed, otherwise FALSE- See Also:
-
setComments
Updates the Examination comments.- Parameters:
comments- the comments- See Also:
-
setSize
public abstract void setSize(int size) Updates the number of questions in this examination.- Parameters:
size- the number of questions
-
setDate
Updates this Examination's date.- Parameters:
dt- the new date/time- See Also:
-
setSubmittedOn
Updates this Examination's submission date.- Parameters:
dt- the new submission date/time- See Also:
-
setScoredOn
Updates this Examination's "scored on" date.- Parameters:
dt- the new date/time this Examination was graded on- See Also:
-
setOwner
Updates this Examination's owner Airline.- Parameters:
ai- the AirlineInformation bean- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<Object>- Overrides:
compareToin classDatabaseBean
-