fr.paris.lutece.plugins.quiz.web
Class QuizApp

java.lang.Object
  extended by fr.paris.lutece.plugins.quiz.web.QuizApp
All Implemented Interfaces:
fr.paris.lutece.portal.web.xpages.XPageApplication, Serializable

public class QuizApp
extends Object
implements fr.paris.lutece.portal.web.xpages.XPageApplication

This class manages Quiz page.

See Also:
Serialized Form

Constructor Summary
QuizApp()
           
 
Method Summary
static void doDownloadQuizImage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do download a quiz image
protected  fr.paris.lutece.portal.web.xpages.XPage getErrorPage(int nIdQuiz, String strError, int nStepToRedirect, Locale locale)
          Returns an error page
 fr.paris.lutece.portal.web.xpages.XPage getPage(javax.servlet.http.HttpServletRequest request, int nMode, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Returns the Quiz XPage content depending on the request parameters and the current mode.
protected  fr.paris.lutece.portal.web.xpages.XPage getQuizList(Locale locale)
          Get the quiz list
protected  fr.paris.lutece.portal.web.xpages.XPage getQuizNextStep(Quiz quiz, int nOldStepId, javax.servlet.http.HttpServletRequest request)
          Get the next step of the quiz
protected  fr.paris.lutece.portal.web.xpages.XPage getQuizPage(int nQuizId, Locale locale)
          Gets the quiz page
protected  fr.paris.lutece.portal.web.xpages.XPage getQuizResults(Quiz quiz, Locale locale, Map<String,String[]> mapParameters, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return The Answers list
protected  fr.paris.lutece.portal.web.xpages.XPage getQuizStepResults(Quiz quiz, int nIdStep, Locale locale, Map<String,String[]> mapResponsesCurrentStep, javax.servlet.http.HttpSession session, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Return The Answers list for the given step
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuizApp

public QuizApp()
Method Detail

doDownloadQuizImage

public static void doDownloadQuizImage(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.http.HttpServletResponse response)
Do download a quiz image

Parameters:
request - The request
response - The response

getPage

public fr.paris.lutece.portal.web.xpages.XPage getPage(javax.servlet.http.HttpServletRequest request,
                                                       int nMode,
                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
                                                throws fr.paris.lutece.portal.service.message.SiteMessageException
Returns the Quiz XPage content depending on the request parameters and the current mode.

Specified by:
getPage in interface fr.paris.lutece.portal.web.xpages.XPageApplication
Parameters:
request - The HTTP request.
nMode - The current mode.
plugin - The Plugin
Returns:
The page content.
Throws:
fr.paris.lutece.portal.service.message.SiteMessageException - Message displayed if an exception occures

getQuizList

protected fr.paris.lutece.portal.web.xpages.XPage getQuizList(Locale locale)
Get the quiz list

Parameters:
locale - The locale
Returns:
The XPage

getQuizPage

protected fr.paris.lutece.portal.web.xpages.XPage getQuizPage(int nQuizId,
                                                              Locale locale)
Gets the quiz page

Parameters:
nQuizId - The quiz Id
locale - The current locale
Returns:
The XPage

getQuizNextStep

protected fr.paris.lutece.portal.web.xpages.XPage getQuizNextStep(Quiz quiz,
                                                                  int nOldStepId,
                                                                  javax.servlet.http.HttpServletRequest request)
Get the next step of the quiz

Parameters:
quiz - The quiz to display
nOldStepId - The id of the last displayed step of the quiz, or 0 if no step was displayed
request - The request
Returns:
The XPage to display

getQuizResults

protected fr.paris.lutece.portal.web.xpages.XPage getQuizResults(Quiz quiz,
                                                                 Locale locale,
                                                                 Map<String,String[]> mapParameters,
                                                                 fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return The Answers list

Parameters:
quiz - The quiz
locale - The current locale
mapParameters - request parameters as a map
plugin - the plugin
Returns:
The XPage

getQuizStepResults

protected fr.paris.lutece.portal.web.xpages.XPage getQuizStepResults(Quiz quiz,
                                                                     int nIdStep,
                                                                     Locale locale,
                                                                     Map<String,String[]> mapResponsesCurrentStep,
                                                                     javax.servlet.http.HttpSession session,
                                                                     fr.paris.lutece.portal.service.plugin.Plugin plugin)
Return The Answers list for the given step

Parameters:
quiz - The quiz
nIdStep - The id of the submitted step
locale - The current locale
mapResponsesCurrentStep - Responses of the current step
session - The session
plugin - the plugin
Returns:
The XPage

getErrorPage

protected fr.paris.lutece.portal.web.xpages.XPage getErrorPage(int nIdQuiz,
                                                               String strError,
                                                               int nStepToRedirect,
                                                               Locale locale)
Returns an error page

Parameters:
nIdQuiz - The id of the quiz
strError - The error message
nStepToRedirect - The id of the step to redirect the user to, or 0 to redirect the user to the start of the quiz
locale - The current locale
Returns:
The XPage


Copyright © 2014 Mairie de Paris. All Rights Reserved.