Class QuizResponseHome
java.lang.Object
fr.paris.lutece.plugins.wiki.modules.quiz.business.QuizResponseHome
Home class for QuizResponse providing static service methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic QuizResponsecreate(QuizResponse response) Creates a new quiz response in the database.static Optional<QuizResponse>findByAttemptAndQuestion(int nIdAttempt, int nIdQuestion) Retrieves a response for a specific attempt and question combination.static List<QuizResponse>getResponsesByAttempt(int nIdAttempt) Retrieves all responses for a specific attempt.static QuizResponseupdate(QuizResponse response) Updates an existing quiz response in the database.
-
Method Details
-
create
Creates a new quiz response in the database.- Parameters:
response- The quiz response to create- Returns:
- The created quiz response with its ID set
-
update
Updates an existing quiz response in the database.- Parameters:
response- The quiz response to update- Returns:
- The updated quiz response
-
getResponsesByAttempt
Retrieves all responses for a specific attempt.- Parameters:
nIdAttempt- The attempt ID- Returns:
- A list of quiz responses for the attempt
-
findByAttemptAndQuestion
Retrieves a response for a specific attempt and question combination.- Parameters:
nIdAttempt- The attempt IDnIdQuestion- The question ID- Returns:
- An optional containing the quiz response if found
-