fr.paris.lutece.plugins.quiz.business
Class QuizQuestionDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.quiz.business.QuizQuestionDAO

public final class QuizQuestionDAO
extends Object

This class provides Data Access methods for QuizQuestion objects


Constructor Summary
QuizQuestionDAO()
           
 
Method Summary
 void delete(int nIdQuestion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Deletes the Quiz instance whose identifier is specified in parameter
 void deleteQuestionsByGroup(int nIdQuiz, int nIdGroup, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Deletes the Quiz instances whose identifier is specified in parameter by group
 void deleteQuestionsByQuiz(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete an instance of a question by Quiz
 Collection<Integer> getVerifyQuestionsByGroup(int nIdQuiz, int nIdGroup, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of the article Quiz whose identifier is specified in parameter
 void insert(QuizQuestion quizQuestion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Creation o of an article Quiz
 QuizQuestion load(int nIdQuizQuestion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of the article Quiz whose identifier is specified in parameter
 QuizQuestion loadLastQuestion(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of the question which just created
 Collection<QuizQuestion> selectQuestionsByGroup(int nIdQuiz, int nIdGroup, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns a list of questions for a given group
 Collection<QuizQuestion> selectQuestionsList(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of the article Quiz whose identifier is specified in parameter
 Collection<QuizQuestion> selectQuestionsListWithAnswer(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns a list of questions with answers
 Collection<QuizQuestion> selectQuestionsListWithAnswerByIdGroup(int nIdQuiz, int nIdGroup, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Gets a list of questions that has at least one answer and re associated with a given group
 void store(QuizQuestion quizQuestion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Updates of the Quiz instance specified in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuizQuestionDAO

public QuizQuestionDAO()
Method Detail

insert

public void insert(QuizQuestion quizQuestion,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Creation o of an article Quiz

Parameters:
quizQuestion - An if an instancenstance of the Quiz which contains the informations to store
plugin - the plugin

delete

public void delete(int nIdQuestion,
                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Deletes the Quiz instance whose identifier is specified in parameter

Parameters:
nIdQuestion - The identifier of the article Quiz to delete in the database
plugin - the plugin

deleteQuestionsByQuiz

public void deleteQuestionsByQuiz(int nIdQuiz,
                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete an instance of a question by Quiz

Parameters:
nIdQuiz - An instance of the Quiz which contains the informations to store
plugin - the plugin

load

public QuizQuestion load(int nIdQuizQuestion,
                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of the article Quiz whose identifier is specified in parameter

Parameters:
nIdQuizQuestion - The primary key of the article to find in the database
plugin - the plugin
Returns:
An instance of the Quiz which corresponds to the key

loadLastQuestion

public QuizQuestion loadLastQuestion(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of the question which just created

Parameters:
plugin - the plugin
Returns:
An instance of the Quiz which corresponds to the key

store

public void store(QuizQuestion quizQuestion,
                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Updates of the Quiz instance specified in parameter

Parameters:
quizQuestion - An instance of the Quiz which contains the informations to store
plugin - the plugin

selectQuestionsList

public Collection<QuizQuestion> selectQuestionsList(int nIdQuiz,
                                                    fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of the article Quiz whose identifier is specified in parameter

Parameters:
nIdQuiz - The primary key of the article to find in the database
plugin - the plugin
Returns:
An instance of the Quiz which corresponds to the key

getVerifyQuestionsByGroup

public Collection<Integer> getVerifyQuestionsByGroup(int nIdQuiz,
                                                     int nIdGroup,
                                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of the article Quiz whose identifier is specified in parameter

Parameters:
nIdQuiz - The primary key of the article to find in the database
nIdGroup - The primary key of the group
plugin - the plugin
Returns:
The list of ids of questions

selectQuestionsByGroup

public Collection<QuizQuestion> selectQuestionsByGroup(int nIdQuiz,
                                                       int nIdGroup,
                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns a list of questions for a given group

Parameters:
nIdQuiz - The quiz ID
nIdGroup - The group Id
plugin - The plugin
Returns:
The list

deleteQuestionsByGroup

public void deleteQuestionsByGroup(int nIdQuiz,
                                   int nIdGroup,
                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Deletes the Quiz instances whose identifier is specified in parameter by group

Parameters:
nIdQuiz - The identifier of the article Quiz to delete in the database
nIdGroup - the id of a group
plugin - the plugin

selectQuestionsListWithAnswer

public Collection<QuizQuestion> selectQuestionsListWithAnswer(int nIdQuiz,
                                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns a list of questions with answers

Parameters:
nIdQuiz - The quiz Id
plugin - The plugin
Returns:
The list

selectQuestionsListWithAnswerByIdGroup

public Collection<QuizQuestion> selectQuestionsListWithAnswerByIdGroup(int nIdQuiz,
                                                                       int nIdGroup,
                                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets a list of questions that has at least one answer and re associated with a given group

Parameters:
nIdQuiz - the Quiz Id
nIdGroup - The id of the group
plugin - The plugin
Returns:
a list of questions


Copyright © 2014 Mairie de Paris. All Rights Reserved.