Class ExamProfile

java.lang.Object
org.deltava.beans.testing.ExamProfile
All Implemented Interfaces:
Serializable, Cloneable, Comparable<ExamProfile>, Auditable, PassStatistics, ViewEntry, Cacheable

public class ExamProfile extends Object implements Comparable<ExamProfile>, PassStatistics, Auditable, Cacheable, ViewEntry
A class to store Examination profile information.
Since:
1.0
Version:
9.1
Author:
Luke
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Examination profile.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Makes this Examination visible to an Airline.
    void
    addScorerID(int id)
    Adds a user who can grade this Examination.
    Returns the cache key for this object.
    int
     
    boolean
    Returns whether this Examination is part of the Flight Academy.
    boolean
    Returns whether this Examination is avialable to be taken.
    Returns the Airlines that can access this Examination.
    Returns the object ID for this auditable object.
    Returns the equipment program required to take this Examination.
    int
    Returns the minimum stage required in order to take this Examination.
    Returns the Examination Name.
    boolean
    Returns whether a notification message should be sent on submission.
    Returns the Owner Airline for this Examination.
    int
    Returns the number of test passes or correct answers.
    int
    Returns the minimum percentage required to pass this Examination.
    int
    Returns the number of questions in this Examination's question pool.
    Returns the CSS class for this object if rendered in a view table.
    Returns the database IDs of all users who can grade this Examination.
    int
    Returns the number of questions in this Examination.
    int
    Returns the stage for this Examination.
    int
    Returns the time allowed to complete this Examination.
    int
    Returns the total number of invocations.
    int
     
    void
    setAcademy(boolean academy)
    Marks this Examination as part of the Flight Academy.
    void
    setActive(boolean active)
    Marks this Examination as available to be taken.
    void
    Sets the Airlines that this Examination will be visible to.
    void
    Sets the equipment program required to take this Examination.
    void
    setMinStage(int stage)
    Sets the minimum stage required to take this Examination.
    void
    Updates the Examination name.
    void
    setNotify(boolean doNotify)
    Sets a notification on Examination submission.
    void
    Sets which airline is the owner of this Examination.
    void
    setPassCount(int cnt)
    Updates the total numebr of times this Examination has been passed.
    void
    setPassScore(int score)
    Sets the passing score for this Examination as a percentage.
    void
    Updates the number of Exam Questions in this Examination's question pool.
    void
    setSize(int size)
    Sets the number of questions in this Examination.
    void
    setStage(int stage)
    Sets the stage for this Examination.
    void
    setTime(int time)
    Sets the time required to complete this Examination.
    void
    setTotal(int total)
    Updates the total number of times this Examination has been taken.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface Auditable

    getAuditType, isCrossApp
    Modifier and Type
    Method
    Description
    default String
    Returns the audit type for this auditable object.
    default boolean
    Returns whether this object is within multiple web applications.
  • Constructor Details

    • ExamProfile

      public ExamProfile(String name)
      Creates a new Examination profile.
      Parameters:
      name - the name of the examination
      Throws:
      NullPointerException - if name is null
      See Also:
  • Method Details

    • getName

      public String getName()
      Returns the Examination Name.
      Returns:
      the exam name
    • getEquipmentType

      public String getEquipmentType()
      Returns the equipment program required to take this Examination.
      Returns:
      the equipment program name
      See Also:
    • getStage

      public int getStage()
      Returns the stage for this Examination.
      Returns:
      the stage
      See Also:
    • getMinStage

      public int getMinStage()
      Returns the minimum stage required in order to take this Examination.
      Returns:
      the minimum stage
      See Also:
    • getSize

      public int getSize()
      Returns the number of questions in this Examination.
      Returns:
      the number of questions
      See Also:
    • getPassScore

      public int getPassScore()
      Returns the minimum percentage required to pass this Examination.
      Returns:
      the minimum percentage multiplied by 100
      See Also:
    • getTime

      public int getTime()
      Returns the time allowed to complete this Examination.
      Returns:
      the time in minutes
      See Also:
    • getActive

      public boolean getActive()
      Returns whether this Examination is avialable to be taken.
      Returns:
      TRUE if the Examination is active, otherwise FALSE
      See Also:
    • getAcademy

      public boolean getAcademy()
      Returns whether this Examination is part of the Flight Academy.
      Returns:
      TRUE if the Examination is part of the Academy, otherwise FALSE
      See Also:
    • getNotify

      public boolean getNotify()
      Returns whether a notification message should be sent on submission.
      Returns:
      TRUE if a message should be sent, otherwise FALSE
      See Also:
    • getTotal

      public int getTotal()
      Description copied from interface: PassStatistics
      Returns the total number of invocations.
      Specified by:
      getTotal in interface PassStatistics
      Returns:
      the number of invocations
    • getPassCount

      public int getPassCount()
      Description copied from interface: PassStatistics
      Returns the number of test passes or correct answers.
      Specified by:
      getPassCount in interface PassStatistics
      Returns:
      the number of successes
    • getQuestionPoolSize

      public int getQuestionPoolSize()
      Returns the number of questions in this Examination's question pool.
      Returns:
      the number of questions
      See Also:
    • getOwner

      public AirlineInformation getOwner()
      Returns the Owner Airline for this Examination.
      Returns:
      an AirlineInformation bean
      See Also:
    • getAirlines

      public Collection<AirlineInformation> getAirlines()
      Returns the Airlines that can access this Examination.
      Returns:
      a Collection of AirlineInformation beans
      See Also:
    • getScorerIDs

      public Collection<Integer> getScorerIDs()
      Returns the database IDs of all users who can grade this Examination.
      Returns:
      a Collection of database IDs
      See Also:
    • setStage

      public void setStage(int stage)
      Sets the stage for this Examination.
      Parameters:
      stage - the stage number
      See Also:
    • setName

      public void setName(String name)
      Updates the Examination name.
      Parameters:
      name - the new name
      Throws:
      NullPointerException - if name is null
      See Also:
    • setEquipmentType

      public void setEquipmentType(String eqType)
      Sets the equipment program required to take this Examination.
      Parameters:
      eqType - the equipment program name
      See Also:
    • setMinStage

      public void setMinStage(int stage)
      Sets the minimum stage required to take this Examination.
      Parameters:
      stage - the stage number
      See Also:
    • setPassScore

      public void setPassScore(int score)
      Sets the passing score for this Examination as a percentage.
      Parameters:
      score - the passing score, from 0 to 100
      Throws:
      IllegalArgumentException - if score is negative or > 100
      See Also:
    • setSize

      public void setSize(int size)
      Sets the number of questions in this Examination.
      Parameters:
      size - the number of questions
      See Also:
    • setTime

      public void setTime(int time)
      Sets the time required to complete this Examination.
      Parameters:
      time - the time in minutes
      Throws:
      IllegalArgumentException - if time is zero or negative
      See Also:
    • setActive

      public void setActive(boolean active)
      Marks this Examination as available to be taken.
      Parameters:
      active - TRUE if the Examination is active, otherwise FALSE
      See Also:
    • setAcademy

      public void setAcademy(boolean academy)
      Marks this Examination as part of the Flight Academy.
      Parameters:
      academy - TRUE if the Examination is part of the Flight Academy, otherwise FALSE
      See Also:
    • setNotify

      public void setNotify(boolean doNotify)
      Sets a notification on Examination submission.
      Parameters:
      doNotify - TRUE if a notification should be sent, otherwise FALSE
      See Also:
    • setTotal

      public void setTotal(int total)
      Updates the total number of times this Examination has been taken.
      Parameters:
      total - the number of times
      See Also:
    • setPassCount

      public void setPassCount(int cnt)
      Updates the total numebr of times this Examination has been passed.
      Parameters:
      cnt - the number of passed Examinations
      See Also:
    • setQuestionPoolSize

      public void setQuestionPoolSize(int cnt)
      Updates the number of Exam Questions in this Examination's question pool.
      Parameters:
      cnt - the number of questions
      See Also:
    • setOwner

      public void setOwner(AirlineInformation ai)
      Sets which airline is the owner of this Examination.
      Parameters:
      ai - the AirlineInformation bean for the owner airline
      See Also:
    • addAirline

      public void addAirline(AirlineInformation ai)
      Makes this Examination visible to an Airline.
      Parameters:
      ai - the AirlineInformation bean
      See Also:
    • setAirlines

      public void setAirlines(Collection<AirlineInformation> airlines)
      Sets the Airlines that this Examination will be visible to.
      Parameters:
      airlines - a Collection of AirlineInformation beans
    • addScorerID

      public void addScorerID(int id)
      Adds a user who can grade this Examination.
      Parameters:
      id - the user's database ID
      See Also:
    • compareTo

      public int compareTo(ExamProfile e2)
      Specified by:
      compareTo in interface Comparable<ExamProfile>
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none
    • getAuditID

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID