Interface IQuizQuestionDAO
- All Known Implementing Classes:
QuizQuestionDAO
public interface IQuizQuestionDAO
Defines the interface for a QuizQuestion DAO.
Any class implementing
IQuizQuestionDAO
must provide implementations for
creating and retrieving quiz questions.- Author:
- Joshua M.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createQuizQuestion
(QuizQuestion quizQuestion) Creates a new QuizQuestion in the database.getAllQuizQuestions
(int messageId) Retrieves all QuizQuestions associated with a specific quiz (message).getQuizQuestion
(int messageId, int number) Retrieves a specific QuizQuestion from the database.
-
Method Details
-
createQuizQuestion
Creates a new QuizQuestion in the database.- Parameters:
quizQuestion
- The QuizQuestion to create.- Throws:
SQLException
- If an SQL error occurs during the operation.
-
getQuizQuestion
Retrieves a specific QuizQuestion from the database.- Parameters:
messageId
- The ID of the message (quiz) associated with the question.number
- The question number within the quiz.- Returns:
- The
QuizQuestion
matching the criteria, or null if not found. - Throws:
SQLException
- If an SQL error occurs during the operation.
-
getAllQuizQuestions
Retrieves all QuizQuestions associated with a specific quiz (message).- Parameters:
messageId
- The ID of the message (quiz) whose questions are to be retrieved.- Returns:
- A list of
QuizQuestion
objects for the specified quiz. - Throws:
SQLException
- If an SQL error occurs during the operation.
-