Class Examination

All Implemented Interfaces:
Serializable, Comparable<Object>, AuthoredBean, IDBean, ViewEntry, Cacheable

public class Examination extends Test
A class to store information about written examinations.
Since:
1.0
Version:
11.0
Author:
Luke
See Also:
  • Field Details

    • QUESTIONNAIRE_NAME

      public static final String QUESTIONNAIRE_NAME
      Applicant Questionnaire Examination Name.
      See Also:
  • Constructor Details

    • Examination

      public Examination(String name)
      Creates a new examination.
      Parameters:
      name - the name of the examination
  • Method Details

    • getSize

      public int getSize()
      Returns the number of questions in this Examination.
      Specified by:
      getSize in class Test
      Returns:
      the number of questions
      See Also:
    • getExpiryDate

      public Instant getExpiryDate()
      Returns the Expiration Date of this Examination.
      Returns:
      the date/time this exam must be completed by
      See Also:
    • getQuestions

      public Collection<Question> 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

      public Question getQuestion(int idx)
      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

      public void addQuestion(Question q)
      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 class Test
      Parameters:
      size - the number of questions
      Throws:
      IllegalStateException - if at least one question has been aded to this exam
      See Also:
    • setExpiryDate

      public void setExpiryDate(Instant dt)
      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

      public String getRowClassName()
      Returns the CSS class name for a view table row.
      Returns:
      the CSS class name