public class QuizService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
BEAN_QUIZ_SERVICE
Name of the bean of QuizService
|
static String |
KEY_ERROR
Error key
|
static String |
KEY_QUIZ
Quiz key
|
static String |
PARAMETER_ACTION
Action parameter
|
static String |
PLUGIN_NAME
Name of the quiz plugin
|
static String |
PROPERTY_INPUT_PREFIX
Input prefix property
|
| Constructor and Description |
|---|
QuizService() |
| Modifier and Type | Method and Description |
|---|---|
Map<String,Object> |
calculateQuizProfile(int nIdQuiz,
Map<String,String[]> parameterMap,
Locale locale)
Compute the profile of a user from his answers
|
Map<String,Object> |
calculateQuizStepProfile(Quiz quiz,
int nIdCurrentStep,
Map<String,String[]> mapResponsesCurrentStep,
Locale locale,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Compute the profile of a user from his answers
|
Quiz |
findQuizById(int nQuizId)
Find a quiz by its primary key
|
Map<String,Object> |
getQuiz(int nId)
Gets a quiz as a model map
|
Map<String,Object> |
getQuizList()
Gets the list of quiz
|
Map<String,Object> |
getQuizNextStep(Quiz quiz,
int nOldStepId)
Gets a quiz step as a model map
|
Map<String,Object> |
getResults(int nIdQuiz,
Map<String,String[]> parameterMap,
Locale locale)
Get results
|
Map<String,Object> |
getStepResults(Quiz quiz,
int nIdCurrentStep,
Map<String,String[]> mapResponsesCurrentStep,
Locale locale,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get results for the current step
|
Map<String,String[]> |
getUserAnswersForGroup(int nIdQuiz,
int nIdOldStep,
Map<String,String[]> parameterMap,
Locale locale,
fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the answers of a user to questions of a quiz
|
void |
processEndOfQuiz(Quiz quiz,
String strScore,
Map<String,String[]> userAnswers)
Process the end of the quiz
|
public static final String BEAN_QUIZ_SERVICE
public static final String KEY_QUIZ
public static final String KEY_ERROR
public static final String PLUGIN_NAME
public static final String PARAMETER_ACTION
public static final String PROPERTY_INPUT_PREFIX
public Quiz findQuizById(int nQuizId)
nQuizId - The id of the quizpublic Map<String,Object> getQuiz(int nId)
nId - The quiz Idpublic Map<String,Object> getQuizNextStep(Quiz quiz, int nOldStepId)
quiz - The quiznOldStepId - The id of the last displayed step, or 0 to display the
first steppublic Map<String,String[]> getUserAnswersForGroup(int nIdQuiz, int nIdOldStep, Map<String,String[]> parameterMap, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
nIdQuiz - The id of the quiz to get answers ofnIdOldStep - The last validated stepparameterMap - The map of HTTP parameterslocale - The locale to use to display error messagesplugin - The pluginpublic Map<String,Object> getResults(int nIdQuiz, Map<String,String[]> parameterMap, Locale locale)
nIdQuiz - The quiz IdparameterMap - The parameters maplocale - The current localepublic Map<String,Object> getStepResults(Quiz quiz, int nIdCurrentStep, Map<String,String[]> mapResponsesCurrentStep, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
quiz - The quiznIdCurrentStep - The id of the stepmapResponsesCurrentStep - The parameters maplocale - The current localeplugin - The pluginpublic Map<String,Object> calculateQuizProfile(int nIdQuiz, Map<String,String[]> parameterMap, Locale locale)
nIdQuiz - The id of the answered quizparameterMap - The map containing answerslocale - The localepublic Map<String,Object> calculateQuizStepProfile(Quiz quiz, int nIdCurrentStep, Map<String,String[]> mapResponsesCurrentStep, Locale locale, fr.paris.lutece.portal.service.plugin.Plugin plugin)
quiz - The quiznIdCurrentStep - The id of the current stepmapResponsesCurrentStep - The map containing answerslocale - The localeplugin - The pluginCopyright © 2015 City of Paris. All rights reserved.