java.lang.Object
ai.tutor.cab302exceptionalhandlers.model.UserAnswer

public class UserAnswer extends Object
Represents a user's answer to a quiz question.

All variables here once set, are immutable.

Author:
Joshua M.
See Also:
  • Constructor Details

    • UserAnswer

      public UserAnswer(int messageId, int attempt, int questionNumber, String answerOption) throws IllegalArgumentException
      Constructs a UserAnswer object.
      Parameters:
      messageId - The message ID that this answer belongs to, must be greater than 0
      attempt - The attempt number for this answer, must be greater than 0
      questionNumber - The question number within the quiz, must be greater than 0
      answerOption - The answer option selected by the user, must not be null or empty and must be less than 25 characters
      Throws:
      IllegalArgumentException - if any of the parameters are invalid
  • Method Details

    • getMessageId

      public int getMessageId()
    • getAttempt

      public int getAttempt()
    • getQuestionNumber

      public int getQuestionNumber()
    • getAnswerOption

      public String getAnswerOption()