Interface IAnswerOptionDAO
- All Known Implementing Classes:
AnswerOptionDAO
public interface IAnswerOptionDAO
Defines the interface for an AnswerOption DAO.
Any class implementing
IAnswerOptionDAO
must provide implementations for
the CRUD methods in this interface.- Author:
- Joshua M.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createAnswerOption
(AnswerOption answerOption) Creates a new AnswerOption in the database.getAllQuestionAnswerOptions
(int messageId, int questionNumber) Retrieves all AnswerOptions for a specific question in a quiz.getQuestionAnswerOption
(int messageId, int questionNumber, String option) Retrieves an AnswerOption from the database
-
Method Details
-
createAnswerOption
Creates a new AnswerOption in the database.- Parameters:
answerOption
- The AnswerOption to create.- Throws:
SQLException
- If an SQL error occurs during the operation.
-
getQuestionAnswerOption
AnswerOption getQuestionAnswerOption(int messageId, int questionNumber, String option) throws SQLException Retrieves an AnswerOption from the database- Parameters:
messageId
- The ID of the message associated with the AnswerOption.questionNumber
- The question number associated with the AnswerOption.option
- The specific option text to retrieve.- Returns:
- The
AnswerOption
matching the implemented criteria. - Throws:
SQLException
- If an SQL error occurs during the operation.
-
getAllQuestionAnswerOptions
List<AnswerOption> getAllQuestionAnswerOptions(int messageId, int questionNumber) throws SQLException Retrieves all AnswerOptions for a specific question in a quiz.- Parameters:
messageId
- The ID of the message associated with the quiz.questionNumber
- The question number for which to retrieve answer options.- Returns:
- A list of
AnswerOption
objects for the specified question. - Throws:
SQLException
- If an SQL error occurs during the operation.
-