Package org.silverpeas.components.quizz.control

## Class QuizzSessionController

- java.lang.Object
- - org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController
  - - org.silverpeas.components.quizz.control.QuizzSessionController

- All Implemented Interfaces:
    `Serializable`, `org.silverpeas.core.web.mvc.controller.ComponentSessionController`, `org.silverpeas.core.web.session.SessionCloseable`

      public final class QuizzSessionController
      extends org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

      `context`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `QuizzSessionController​(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl, org.silverpeas.core.web.mvc.controller.ComponentContext context)` | Creates new sessionClientController

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `closeQuizz​(String quizzId)` | Close the quizz identified by parameter
    `void` | `copySurvey​(String quizzId)` |
    `void` | `createQuizz​(org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail quizzDetail)` | Method declaration
    `org.silverpeas.core.questioncontainer.container.model.QuestionContainerPK` | `createQuizz​(org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail quizzDetail, String componentId)` |
    `void` | `createTemporaryQuizz​(javax.servlet.http.HttpServletRequest request)` |
    `org.silverpeas.core.web.export.ExportCSVBuilder` | `exportQuizzCSV​(String quizzId)` |
    `Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail>` | `getAdminPalmares​(String quizzId)` | Method declaration
    `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>` | `getAdminQuizzList()` |
    `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>` | `getAdminResults()` | Method declaration
    `float` | `getAveragePoints​(String quizzId)` | Method declaration
    `org.silverpeas.core.questioncontainer.score.model.ScoreDetail` | `getCurrentUserScoreByFatherIdAndParticipationId​(String quizzId, int participationId)` | Method declaration
    `List<org.silverpeas.core.admin.component.model.ComponentInstLight>` | `getGalleries()` |
    `boolean` | `getIsAllowedTopScores()` |
    `int` | `getNbTopScores()` |
    `int` | `getNbVoters​(String quizzId)` | Method declaration
    `List<org.silverpeas.core.pdc.pdc.model.PdcPosition>` | `getPositions()` |
    `org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail` | `getQuestionContainerByParticipationId​(String quizzId, String userId, int participationId)` |
    `org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail` | `getQuestionContainerForCurrentUserByParticipationId​(String quizzId, int participationId)` | Method declaration
    `org.silverpeas.core.questioncontainer.container.service.QuestionContainerService` | `getQuestionContainerService()` |
    `org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail` | `getQuizzDetail​(String id)` |
    `org.silverpeas.kernel.bundle.SettingBundle` | `getSettings()` | Method declaration
    `int` | `getSilverObjectId​(String objectId)` |
    `Collection<org.silverpeas.core.questioncontainer.result.model.QuestionResult>` | `getSuggestions​(String quizzId)` | Method declaration
    `int` | `getUserNbParticipationsByFatherId​(String quizzId, String userId)` |
    `Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail>` | `getUserPalmares​(String quizzId)` | Method declaration
    `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>` | `getUserQuizzList()` | Method declaration
    `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>` | `getUserResults()` | Method declaration
    `org.silverpeas.core.questioncontainer.score.model.ScoreDetail` | `getUserScoreByFatherIdAndParticipationId​(String quizzId, String userId, int participationId)` |
    `Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail>` | `getUserScoresByFatherId​(String quizzId)` | Method declaration
    `boolean` | `isParticipationAllowed​(String id)` |
    `boolean` | `isPdcUsed()` |
    `void` | `paste()` |
    `void` | `recordReply​(String quizzId, Map<String,​List<String>> reply)` | Method declaration
    `void` | `setIsAllowedTopScores​(boolean isAllowedTopScores)` |
    `void` | `setNbTopScores​(int nbTopScores)` |
    `void` | `setPositions​(List<org.silverpeas.core.pdc.pdc.model.PdcPosition> positions)` |
    `void` | `setQuizPositionsFromJSON​(String positions)` | Set new survey positions (axis classification) from JSON string
    `void` | `updateQuestions​(Collection<org.silverpeas.core.questioncontainer.question.model.Question> questions, String quizzId)` |
    `void` | `updateQuizzHeader​(org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader quizzHeader, String quizzId)` |
    `void` | `updateScore​(org.silverpeas.core.questioncontainer.score.model.ScoreDetail scoreDetail)` | Method declaration

    - ### Methods inherited from class org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController

      `addClipboardSelection, clipboardPasteDone, close, getClipboardErrorMessage, getClipboardExceptionError, getClipboardObjects, getClipboardSelectedObjects, getClipboardSize, getComponentAccessController, getComponentId, getComponentLabel, getComponentName, getComponentParameterValue, getComponentParameterValue, getComponentRootName, getComponentUrl, getHighestSilverpeasUserRole, getIcon, getLanguage, getLook, getMultilang, getOrganisationController, getPersonalization, getRSSUrl, getSelection, getSilverpeasUserRoles, getSpaceId, getSpaceLabel, getString, getSubscriptionContext, getUrlEncodedParameter, getUserAccessLevel, getUserAvailComponentIds, getUserDetail, getUserDetail, getUserId, getUserManageableGroupIds, getUserManageableSpaceIds, getUserRoles, getZoneId, isAppInMaintenance, isGroupManager, isPasswordChangeAllowed, isSpaceInMaintenance, removeClipboardElement, setAppModeMaintenance, setClipboardSelectedElement, setComponentRootName, setSpaceModeMaintenance`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### QuizzSessionController

          public QuizzSessionController​(org.silverpeas.core.web.mvc.controller.MainSessionController mainSessionCtrl,
                                        org.silverpeas.core.web.mvc.controller.ComponentContext context)

      Creates new sessionClientController

  - ### Method Detail

    - #### getNbTopScores

          public int getNbTopScores()

    - #### setNbTopScores

          public void setNbTopScores​(int nbTopScores)

    - #### getIsAllowedTopScores

          public boolean getIsAllowedTopScores()

    - #### setIsAllowedTopScores

          public void setIsAllowedTopScores​(boolean isAllowedTopScores)

    - #### getQuestionContainerService

          public org.silverpeas.core.questioncontainer.container.service.QuestionContainerService getQuestionContainerService()

    - #### getSettings

          public org.silverpeas.kernel.bundle.SettingBundle getSettings()

      Method declaration
      Specified by:
        `getSettings` in interface `org.silverpeas.core.web.mvc.controller.ComponentSessionController`
      Overrides:
        `getSettings` in class `org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController`
      Returns:

    - #### getUserQuizzList

          public Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader> getUserQuizzList()
                                                                                                                     throws QuizzException

      Method declaration
      Returns:
      Throws:
        `QuizzException`

    - #### getAdminQuizzList

          public Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader> getAdminQuizzList()
                                                                                                                      throws QuizzException

      Returns:
      Throws:
        `QuizzException`

    - #### getQuizzDetail

          public org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail getQuizzDetail​(String id)
                                                                                                       throws QuizzException

      Parameters:
        `id` - the quizz identifier
      Returns:
        the question container detail of the quizz identified by given parameter
      Throws:
        `QuizzException`

    - #### createQuizz

          public void createQuizz​(org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail quizzDetail)
                           throws QuizzException

      Method declaration
      Parameters:
        `quizzDetail` - the question container detail to create
      Throws:
        `QuizzException`

    - #### createQuizz

          public org.silverpeas.core.questioncontainer.container.model.QuestionContainerPK createQuizz​(org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail quizzDetail,
                                                                                                       String componentId)
                                                                                                throws QuizzException

      Parameters:
        `quizzDetail` - the question container detail to create
        `componentId` - the component instance identifier
      Throws:
        `QuizzException`

    - #### recordReply

          public void recordReply​(String quizzId,
                                  Map<String,​List<String>> reply)
                           throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
        `reply` - the reply to record
      Throws:
        `QuizzException`

    - #### getSuggestions

          public Collection<org.silverpeas.core.questioncontainer.result.model.QuestionResult> getSuggestions​(String quizzId)
                                                                                                       throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
      Returns:
      Throws:
        `QuizzException`

    - #### closeQuizz

          public void closeQuizz​(String quizzId)
                          throws QuizzException

      Close the quizz identified by parameter
      Parameters:
        `quizzId` - the quizz identifier to close
      Throws:
        `QuizzException`

    - #### getNbVoters

          public int getNbVoters​(String quizzId)
                          throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
      Returns:
        the number of voters
      Throws:
        `QuizzException`

    - #### getAveragePoints

          public float getAveragePoints​(String quizzId)
                                 throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
      Returns:
      Throws:
        `QuizzException`

    - #### getAdminResults

          public Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader> getAdminResults()
                                                                                                                    throws QuizzException

      Method declaration
      Returns:
      Throws:
        `QuizzException`

    - #### getUserResults

          public Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader> getUserResults()
                                                                                                                   throws QuizzException

      Method declaration
      Returns:
      Throws:
        `QuizzException`

    - #### getUserScoresByFatherId

          public Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail> getUserScoresByFatherId​(String quizzId)
                                                                                                            throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
      Returns:
      Throws:
        `QuizzException`

    - #### getUserPalmares

          public Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail> getUserPalmares​(String quizzId)
                                                                                                    throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
      Returns:
      Throws:
        `QuizzException`

    - #### getAdminPalmares

          public Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail> getAdminPalmares​(String quizzId)
                                                                                                     throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
      Returns:
      Throws:
        `QuizzException`

    - #### getQuestionContainerByParticipationId

          public org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail getQuestionContainerByParticipationId​(String quizzId,
                                                                                                                                     String userId,
                                                                                                                                     int participationId)
                                                                                                                              throws QuizzException

      Parameters:
        `quizzId` - the quizz identifier
        `userId` - the user identifier
        `participationId` -
      Returns:
      Throws:
        `QuizzException`

    - #### getQuestionContainerForCurrentUserByParticipationId

          public org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail getQuestionContainerForCurrentUserByParticipationId​(String quizzId,
                                                                                                                                                   int participationId)
                                                                                                                                            throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
        `participationId` -
      Returns:
      Throws:
        `QuizzException`

    - #### getUserNbParticipationsByFatherId

          public int getUserNbParticipationsByFatherId​(String quizzId,
                                                       String userId)
                                                throws QuizzException

      Parameters:
        `quizzId` - the quizz identifier
        `userId` - the user identifier
      Returns:
        the number of particippations of the quizz
      Throws:
        `QuizzException`

    - #### getUserScoreByFatherIdAndParticipationId

          public org.silverpeas.core.questioncontainer.score.model.ScoreDetail getUserScoreByFatherIdAndParticipationId​(String quizzId,
                                                                                                                        String userId,
                                                                                                                        int participationId)
                                                                                                                 throws QuizzException

      Parameters:
        `quizzId` - the quizz identifier
        `userId` - the user identifier
        `participationId` -
      Returns:
      Throws:
        `QuizzException`

    - #### getCurrentUserScoreByFatherIdAndParticipationId

          public org.silverpeas.core.questioncontainer.score.model.ScoreDetail getCurrentUserScoreByFatherIdAndParticipationId​(String quizzId,
                                                                                                                               int participationId)
                                                                                                                        throws QuizzException

      Method declaration
      Parameters:
        `quizzId` - the quizz identifier
        `participationId` -
      Returns:
      Throws:
        `QuizzException`

    - #### updateScore

          public void updateScore​(org.silverpeas.core.questioncontainer.score.model.ScoreDetail scoreDetail)
                           throws QuizzException

      Method declaration
      Parameters:
        `scoreDetail` -
      Throws:
        `QuizzException`

    - #### updateQuizzHeader

          public void updateQuizzHeader​(org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader quizzHeader,
                                        String quizzId)
                                 throws QuizzException

      Parameters:
        `quizzHeader` -
        `quizzId` - the quizz identifier
      Throws:
        `QuizzException`

    - #### updateQuestions

          public void updateQuestions​(Collection<org.silverpeas.core.questioncontainer.question.model.Question> questions,
                                      String quizzId)
                               throws QuizzException

      Parameters:
        `questions` -
        `quizzId` - the quizz identifier
      Throws:
        `QuizzException`

    - #### getGalleries

          public List<org.silverpeas.core.admin.component.model.ComponentInstLight> getGalleries()

    - #### isPdcUsed

          public boolean isPdcUsed()

    - #### copySurvey

          public void copySurvey​(String quizzId)
                          throws org.silverpeas.core.clipboard.ClipboardException,
                                 QuizzException

      Throws:
        `org.silverpeas.core.clipboard.ClipboardException`
        `QuizzException`

    - #### paste

          public void paste()
                     throws Exception

      Throws:
        `Exception`

    - #### getSilverObjectId

          public int getSilverObjectId​(String objectId)

    - #### exportQuizzCSV

          public org.silverpeas.core.web.export.ExportCSVBuilder exportQuizzCSV​(String quizzId)

    - #### isParticipationAllowed

          public boolean isParticipationAllowed​(String id)
                                         throws QuizzException

      Throws:
        `QuizzException`

    - #### createTemporaryQuizz

          public void createTemporaryQuizz​(javax.servlet.http.HttpServletRequest request)
                                    throws ParseException

      Parameters:
        `request` -
      Throws:
        `ParseException`

    - #### setQuizPositionsFromJSON

          public void setQuizPositionsFromJSON​(String positions)

      Set new survey positions (axis classification) from JSON string
      Parameters:
        `positions` - : the JSON string positions

    - #### getPositions

          public List<org.silverpeas.core.pdc.pdc.model.PdcPosition> getPositions()

      Returns:
        the positions

    - #### setPositions

          public void setPositions​(List<org.silverpeas.core.pdc.pdc.model.PdcPosition> positions)

      Parameters:
        `positions` - the positions to set