Class UserAnswer
java.lang.Object
ai.tutor.cab302exceptionalhandlers.model.UserAnswer
Represents a user's answer to a quiz question.
All variables here once set, are immutable.
- Author:
- Joshua M.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUserAnswer
(int messageId, int attempt, int questionNumber, String answerOption) Constructs a UserAnswer object. -
Method Summary
Modifier and TypeMethodDescriptionint
int
int
-
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 0attempt
- The attempt number for this answer, must be greater than 0questionNumber
- The question number within the quiz, must be greater than 0answerOption
- 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
-