Class QuizAttemptDAO
java.lang.Object
fr.paris.lutece.plugins.wiki.modules.quiz.business.QuizAttemptDAO
- All Implemented Interfaces:
IQuizAttemptDAO
Implementation of quiz attempt data access object.
-
Constructor Summary
Constructors -
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.
-
Constructor Details
-
QuizAttemptDAO
public QuizAttemptDAO()
-
-
Method Details
-
insert
Inserts a new quiz attempt into the database.- Specified by:
insertin interfaceIQuizAttemptDAO- Parameters:
attempt- The quiz attempt to insertplugin- The plugin instance
-
load
Loads a quiz attempt by its primary key.- Specified by:
loadin interfaceIQuizAttemptDAO- Parameters:
nKey- The attempt IDplugin- The plugin instance- Returns:
- An optional containing the quiz attempt if found
-
store
Updates an existing quiz attempt in the database.- Specified by:
storein interfaceIQuizAttemptDAO- Parameters:
attempt- The quiz attempt to updateplugin- The plugin instance
-
selectByQuiz
public List<QuizAttempt> selectByQuiz(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin) Retrieves all attempts for a specific quiz.- Specified by:
selectByQuizin interfaceIQuizAttemptDAO- Parameters:
nIdQuiz- The quiz IDplugin- The plugin instance- Returns:
- A list of quiz attempts for the quiz
-
selectByQuizAndUser
public 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.- Specified by:
selectByQuizAndUserin interfaceIQuizAttemptDAO- Parameters:
nIdQuiz- The quiz IDstrUserGuid- The user GUIDplugin- The plugin instance- Returns:
- A list of quiz attempts for the quiz and user
-
countByQuizAndUser
public 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.- Specified by:
countByQuizAndUserin interfaceIQuizAttemptDAO- Parameters:
nIdQuiz- The quiz IDstrUserGuid- The user GUIDplugin- The plugin instance- Returns:
- The count of attempts
-