Interface IQuizAttemptDAO
- All Known Implementing Classes:
QuizAttemptDAO
public interface IQuizAttemptDAO
Data access object interface for quiz attempts.
-
Method Summary
Modifier and TypeMethodDescriptionintcountByQuizAndUser(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.voidinsert(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.voidstore(QuizAttempt attempt, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates an existing quiz attempt in the database.
-
Method Details
-
insert
Inserts a new quiz attempt into the database.- Parameters:
attempt- The quiz attempt to insertplugin- The plugin instance
-
store
Updates an existing quiz attempt in the database.- Parameters:
attempt- The quiz attempt to updateplugin- The plugin instance
-
load
Loads a quiz attempt by its primary key.- Parameters:
nKey- The attempt IDplugin- The plugin instance- Returns:
- An optional containing the quiz attempt if found
-
selectByQuiz
Retrieves all attempts for a specific quiz.- Parameters:
nIdQuiz- The quiz IDplugin- 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 IDstrUserGuid- The user GUIDplugin- 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 IDstrUserGuid- The user GUIDplugin- The plugin instance- Returns:
- The count of attempts
-