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

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

public final class QuizQuestionHome
extends Object

This class provides instances management methods (create, find, ...) for QuizQuestion objects


Method Summary
static QuizQuestion create(QuizQuestion quizQuestion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Creation of an instance of an article QuizQuestion
static Collection<QuizQuestion> findAll(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns QuizQuestion list
static QuizQuestion findByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of the article QuizQuestion whose identifier is specified in parameter
static Collection<Integer> findIdQuestionsByGroup(int nIdQuiz, int nIdGroup, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Gets a list of questions for a group
static QuizQuestion findLastQuestion(fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns an instance of the article QuizQuestion whose identifier is specified in parameter
static Collection<QuizQuestion> findQuestionsByGroup(int nIdQuiz, int nIdGroup, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Gets a list of questions for a group
static Collection<QuizQuestion> findQuestionsWithAnswer(int nIdQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Gets a list of questions that has at least one answer
static Collection<QuizQuestion> findQuestionsWithAnswerByIdGroup(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
static void remove(int nIdQuestion, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Deletes the QuizQuestion instance whose identifier is specified in parameter
static void removeQuestionsByGroup(int nIdQuiz, int nIdGroup, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Deletes the QuizQuestions instance by Group
static void removeQuestionsByQuiz(int nQuiz, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Deletes the QuizQuestion instance whose identifier is specified in parameter
static QuizQuestion update(QuizQuestion question, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Updates of the QuizQuestion instance specified in parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static QuizQuestion create(QuizQuestion quizQuestion,
                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Creation of an instance of an article QuizQuestion

Parameters:
quizQuestion - An instance of the QuizQuestion which contains the informations to store
plugin - the plugin
Returns:
The instance of the QuizQuestion which has been created

update

public static QuizQuestion update(QuizQuestion question,
                                  fr.paris.lutece.portal.service.plugin.Plugin plugin)
Updates of the QuizQuestion instance specified in parameter

Parameters:
question - An instance of the QuizQuestion which contains the informations to store
plugin - the plugin
Returns:
The instance of the QuizQuestion which has been updated.

remove

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

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

removeQuestionsByQuiz

public static void removeQuestionsByQuiz(int nQuiz,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Deletes the QuizQuestion instance whose identifier is specified in parameter

Parameters:
nQuiz - The identifier of the article QuizQuestion to delete in the database
plugin - the plugin

findByPrimaryKey

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

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

findAll

public static Collection<QuizQuestion> findAll(int nIdQuiz,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns QuizQuestion list

Parameters:
plugin - the plugin
nIdQuiz - The identifier of the article Quiz to find it in the database
Returns:
the list of the QuizQuestion of the database in form of a QuizQuestion Collection object

findIdQuestionsByGroup

public static Collection<Integer> findIdQuestionsByGroup(int nIdQuiz,
                                                         int nIdGroup,
                                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets a list of questions for a group

Parameters:
nIdQuiz - The Quiz id
nIdGroup - The group id
plugin - The plugin
Returns:
The list

findQuestionsByGroup

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

Parameters:
nIdQuiz - The Quiz id
nIdGroup - The group id
plugin - The plugin
Returns:
The list

removeQuestionsByGroup

public static void removeQuestionsByGroup(int nIdQuiz,
                                          int nIdGroup,
                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Deletes the QuizQuestions instance by Group

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

findLastQuestion

public static QuizQuestion findLastQuestion(fr.paris.lutece.portal.service.plugin.Plugin plugin)
Returns an instance of the article QuizQuestion whose identifier is specified in parameter

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

findQuestionsWithAnswer

public static Collection<QuizQuestion> findQuestionsWithAnswer(int nIdQuiz,
                                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Gets a list of questions that has at least one answer

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

findQuestionsWithAnswerByIdGroup

public static Collection<QuizQuestion> findQuestionsWithAnswerByIdGroup(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.