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

  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)`
  Saves the specified quizz in Silverpeas.
  `org.silverpeas.core.questioncontainer.container.model.QuestionContainerPK`
  `createQuizz(org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail quizzDetail, String componentId)`
  `void`
  `createTemporaryQuizz(jakarta.servlet.http.HttpServletRequest request)`
  `org.silverpeas.core.web.export.ExportCSVBuilder`
  `exportQuizzCSV(String quizzId)`
  `Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail>`
  `getAdminPalmares(String quizzId)`
  `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>`
  `getAdminQuizzList()`
  `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>`
  `getAdminResults()`
  `float`
  `getAveragePoints(String quizzId)`
  `org.silverpeas.core.questioncontainer.score.model.ScoreDetail`
  `getCurrentUserScoreByFatherIdAndParticipationId(String quizzId, int participationId)`
  `List<org.silverpeas.core.admin.component.model.ComponentInstLight>`
  `getGalleries()`
  `boolean`
  `getIsAllowedTopScores()`
  `int`
  `getNbTopScores()`
  `int`
  `getNbVoters(String quizzId)`
  Gets the numbers of voters for the specified quizz.
  `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)`
  `org.silverpeas.core.questioncontainer.container.service.QuestionContainerService`
  `getQuestionContainerService()`
  `org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail`
  `getQuizzDetail(String id)`
  `org.silverpeas.kernel.bundle.SettingBundle`
  `getSettings()`
  `int`
  `getUserNbParticipationsByFatherId(String quizzId, String userId)`
  `Collection<org.silverpeas.core.questioncontainer.score.model.ScoreDetail>`
  `getUserPalmares(String quizzId)`
  `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>`
  `getUserQuizzList()`
  `Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader>`
  `getUserResults()`
  `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)`
  `boolean`
  `isParticipationAllowed(String id)`
  `boolean`
  `isPdcUsed()`
  `void`
  `paste()`
  `void`
  `recordReply(String quizzId, Map<String,List<String>> reply)`
  Saves the specified answers to the given quizz.
  `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)`

  ### 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 Details

  - ### QuizzSessionController

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

- ## Method Details

  - ### 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()
    Specified by:
      `getSettings` in interface `org.silverpeas.core.web.mvc.controller.ComponentSessionController`
    Overrides:
      `getSettings` in class `org.silverpeas.core.web.mvc.controller.AbstractComponentSessionController`

  - ### getUserQuizzList

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

  - ### getAdminQuizzList

    public Collection<org.silverpeas.core.questioncontainer.container.model.QuestionContainerHeader> getAdminQuizzList() throws QuizzException
    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` - if the quizz getting fails.

  - ### createQuizz

    public void createQuizz(org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail quizzDetail) throws QuizzException
    Saves the specified quizz in Silverpeas.
    Parameters:
      `quizzDetail` - the question container detail to create
    Throws:
      `QuizzException` - if the quizz creation fails.

  - ### 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` - if the creation fails.

  - ### recordReply

    public void recordReply(String quizzId, Map<String,List<String>> reply) throws QuizzException
    Saves the specified answers to the given quizz.
    Parameters:
      `quizzId` - the quizz identifier
      `reply` - the reply to record
    Throws:
      `QuizzException` - if the saving fails.

  - ### closeQuizz

    public void closeQuizz(String quizzId) throws QuizzException
    Close the quizz identified by parameter
    Parameters:
      `quizzId` - the quizz identifier to close
    Throws:
      `QuizzException` - if the closing fails.

  - ### getNbVoters

    public int getNbVoters(String quizzId) throws QuizzException
    Gets the numbers of voters for the specified quizz.
    Parameters:
      `quizzId` - the quizz identifier
    Returns:
      the number of voters
    Throws:
      `QuizzException` - if the getting of the voters count fails.

  - ### getAveragePoints

    public float getAveragePoints(String quizzId) throws QuizzException
    Throws:
      `QuizzException`

  - ### getAdminResults

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

  - ### getUserResults

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

  - ### getUserScoresByFatherId

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

  - ### getUserPalmares

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

  - ### getAdminPalmares

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

  - ### getQuestionContainerByParticipationId

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

  - ### getQuestionContainerForCurrentUserByParticipationId

    public org.silverpeas.core.questioncontainer.container.model.QuestionContainerDetail getQuestionContainerForCurrentUserByParticipationId(String quizzId, int participationId) throws QuizzException
    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 participation of the quizz
    Throws:
      `QuizzException` - if the getting fails.

  - ### getUserScoreByFatherIdAndParticipationId

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

  - ### getCurrentUserScoreByFatherIdAndParticipationId

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

  - ### updateScore

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

  - ### updateQuizzHeader

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

  - ### updateQuestions

    public void updateQuestions(Collection<org.silverpeas.core.questioncontainer.question.model.Question> questions, String quizzId) throws QuizzException
    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`

  - ### 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(jakarta.servlet.http.HttpServletRequest request) throws ParseException
    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