java.lang.Object
fr.paris.lutece.plugins.wiki.modules.quiz.business.QuizAttemptHome

public final class QuizAttemptHome extends Object
Home class for QuizAttempt providing static service methods.
  • Method Details

    • create

      public static QuizAttempt create(QuizAttempt attempt)
      Creates a new quiz attempt in the database.
      Parameters:
      attempt - The quiz attempt to create
      Returns:
      The created quiz attempt with its ID set
    • update

      public static QuizAttempt update(QuizAttempt attempt)
      Updates an existing quiz attempt in the database.
      Parameters:
      attempt - The quiz attempt to update
      Returns:
      The updated quiz attempt
    • findByPrimaryKey

      public static Optional<QuizAttempt> findByPrimaryKey(int nKey)
      Retrieves a quiz attempt by its primary key.
      Parameters:
      nKey - The attempt ID
      Returns:
      An optional containing the quiz attempt if found
    • getAttemptsByQuiz

      public static List<QuizAttempt> getAttemptsByQuiz(int nIdQuiz)
      Retrieves all attempts for a specific quiz.
      Parameters:
      nIdQuiz - The quiz ID
      Returns:
      A list of quiz attempts for the quiz
    • getAttemptsByQuizAndUser

      public static List<QuizAttempt> getAttemptsByQuizAndUser(int nIdQuiz, String strUserGuid)
      Retrieves all attempts for a specific quiz by a specific user.
      Parameters:
      nIdQuiz - The quiz ID
      strUserGuid - The user GUID
      Returns:
      A list of quiz attempts for the quiz and user
    • countAttemptsByQuizAndUser

      public static int countAttemptsByQuizAndUser(int nIdQuiz, String strUserGuid)
      Counts the number of attempts for a specific quiz by a specific user.
      Parameters:
      nIdQuiz - The quiz ID
      strUserGuid - The user GUID
      Returns:
      The count of attempts