All Known Implementing Classes:
QuizDAO

public interface IQuizDAO
Defines the interface for a Quiz DAO. Any class implementing IQuizDAO must provide implementations for CRUD methods and other quiz-related operations in this interface.
Author:
Joshua M.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Creates a new Quiz in the database.
    getAllChatQuizzes(int chatId)
    Retrieves all Quizzes associated with a specific chat.
    getAllUserQuizzes(int userId)
    Retrieves all Quizzes associated with a specific user.
    getQuiz(int messageId)
    Retrieves a Quiz from the database by its associated message ID.
  • Method Details

    • createQuiz

      void createQuiz(Quiz quiz) throws SQLException
      Creates a new Quiz in the database.
      Parameters:
      quiz - The Quiz to create.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getQuiz

      Quiz getQuiz(int messageId) throws SQLException
      Retrieves a Quiz from the database by its associated message ID.
      Parameters:
      messageId - The ID of the message associated with the Quiz.
      Returns:
      The Quiz matching the message ID, or null if not found.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getAllChatQuizzes

      List<Quiz> getAllChatQuizzes(int chatId) throws SQLException
      Retrieves all Quizzes associated with a specific chat.
      Parameters:
      chatId - The ID of the chat whose quizzes are to be retrieved.
      Returns:
      A list of Quiz objects associated with the chat.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getAllUserQuizzes

      List<Quiz> getAllUserQuizzes(int userId) throws SQLException
      Retrieves all Quizzes associated with a specific user.
      Parameters:
      userId - The ID of the user whose quizzes are to be retrieved.
      Returns:
      A list of Quiz objects associated with the user.
      Throws:
      SQLException - If an SQL error occurs during the operation.