All Known Implementing Classes:
UserAnswerDAO

public interface IUserAnswerDAO
Defines the interface for a UserAnswer DAO. Any class implementing IUserAnswerDAO must provide implementations for the CRUD methods in this interface.
Author:
Joshua M.
  • Method Details

    • createUserAnswer

      void createUserAnswer(UserAnswer userAnswer) throws SQLException
      Creates a new UserAnswer in the database.
      Parameters:
      userAnswer - The UserAnswer to create.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getUserQuestionAnswer

      UserAnswer getUserQuestionAnswer(int messageId, int attempt, int questionNumber) throws SQLException
      Retrieves a UserAnswer from the database
      Parameters:
      messageId - The ID of the message associated with the UserAnswer.
      attempt - The question attempt associated with the UserAnswer.
      questionNumber - The question number associated with the UserAnswer.
      Returns:
      The UserAnswer matching the implemented criteria.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getAllUserQuestionAttempts

      List<UserAnswer> getAllUserQuestionAttempts(int messageId, int questionNumber) throws SQLException
      Retrieves all attempts of UserAnswers 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 UserAnswer objects for the specified question.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getAllUserQuizAnswers

      List<UserAnswer> getAllUserQuizAnswers(int messageId, int attempt) throws SQLException
      Retrieves all question UserAnswers for a specific attempt of a quiz.
      Parameters:
      messageId - The ID of the message associated with the quiz.
      attempt - The attempt for which to retrieve answer options.
      Returns:
      A list of UserAnswer objects for the specified question.
      Throws:
      SQLException - If an SQL error occurs during the operation.
    • getAllUserQuizAttempts

      List<UserAnswer> getAllUserQuizAttempts(int messageId) throws SQLException
      Retrieves all attempts of question UserAnswers for a specific quiz.
      Parameters:
      messageId - The ID of the message associated with the quiz.
      Returns:
      A list of UserAnswer objects for the specified question.
      Throws:
      SQLException - If an SQL error occurs during the operation.