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

public final class QuizHome extends Object
Home class for Quiz providing static service methods.
  • Method Details

    • create

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

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

      public static void remove(int nKey)
      Removes a quiz from the database.
      Parameters:
      nKey - The quiz ID
    • findByPrimaryKey

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

      public static List<Quiz> getQuizzesByBook(int nIdBook)
      Retrieves all quizzes for a specific book.
      Parameters:
      nIdBook - The book ID
      Returns:
      A list of quizzes in the book
    • getPublishedQuizzesByBook

      public static List<Quiz> getPublishedQuizzesByBook(int nIdBook)
      Retrieves published quizzes for a specific book.
      Parameters:
      nIdBook - The book ID
      Returns:
      A list of published quizzes in the book