Class QuizHome
java.lang.Object
fr.paris.lutece.plugins.wiki.modules.quiz.business.QuizHome
Home class for Quiz providing static service methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic QuizCreates a new quiz in the database.findByPrimaryKey(int nKey) Retrieves a quiz by its primary key.getPublishedQuizzesByBook(int nIdBook) Retrieves published quizzes for a specific book.getQuizzesByBook(int nIdBook) Retrieves all quizzes for a specific book.static voidremove(int nKey) Removes a quiz from the database.static QuizUpdates an existing quiz in the database.
-
Method Details
-
create
Creates a new quiz in the database.- Parameters:
quiz- The quiz to create- Returns:
- The created quiz with its ID set
-
update
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
Retrieves a quiz by its primary key.- Parameters:
nKey- The quiz ID- Returns:
- An optional containing the quiz if found
-
getQuizzesByBook
Retrieves all quizzes for a specific book.- Parameters:
nIdBook- The book ID- Returns:
- A list of quizzes in the book
-
getPublishedQuizzesByBook
Retrieves published quizzes for a specific book.- Parameters:
nIdBook- The book ID- Returns:
- A list of published quizzes in the book
-