Interface IQuizAttemptDAO

All Known Implementing Classes:
QuizAttemptDAO

public interface IQuizAttemptDAO
Data access object interface for quiz attempts.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    countByQuizAndUser(int nIdQuiz, String strUserGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Counts the number of attempts for a specific quiz by a specific user.
    void
    insert(QuizAttempt attempt, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Inserts a new quiz attempt into the database.
    load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Loads a quiz attempt by its primary key.
    selectByQuiz(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Retrieves all attempts for a specific quiz.
    selectByQuizAndUser(int nIdQuiz, String strUserGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Retrieves all attempts for a specific quiz by a specific user.
    void
    store(QuizAttempt attempt, fr.paris.lutece.portal.service.plugin.Plugin plugin)
    Updates an existing quiz attempt in the database.
  • Method Details

    • insert

      void insert(QuizAttempt attempt, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Inserts a new quiz attempt into the database.
      Parameters:
      attempt - The quiz attempt to insert
      plugin - The plugin instance
    • store

      void store(QuizAttempt attempt, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Updates an existing quiz attempt in the database.
      Parameters:
      attempt - The quiz attempt to update
      plugin - The plugin instance
    • load

      Optional<QuizAttempt> load(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Loads a quiz attempt by its primary key.
      Parameters:
      nKey - The attempt ID
      plugin - The plugin instance
      Returns:
      An optional containing the quiz attempt if found
    • selectByQuiz

      List<QuizAttempt> selectByQuiz(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Retrieves all attempts for a specific quiz.
      Parameters:
      nIdQuiz - The quiz ID
      plugin - The plugin instance
      Returns:
      A list of quiz attempts for the quiz
    • selectByQuizAndUser

      List<QuizAttempt> selectByQuizAndUser(int nIdQuiz, String strUserGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Retrieves all attempts for a specific quiz by a specific user.
      Parameters:
      nIdQuiz - The quiz ID
      strUserGuid - The user GUID
      plugin - The plugin instance
      Returns:
      A list of quiz attempts for the quiz and user
    • countByQuizAndUser

      int countByQuizAndUser(int nIdQuiz, String strUserGuid, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Counts the number of attempts for a specific quiz by a specific user.
      Parameters:
      nIdQuiz - The quiz ID
      strUserGuid - The user GUID
      plugin - The plugin instance
      Returns:
      The count of attempts