com.ibm.openpages.api.questionnaire

## Interface IQuestionnaire

- All Superinterfaces:
    IQuestionnaireBase

      public interface IQuestionnaire
      extends IQuestionnaireBase

  This is an interface to access a questionnaire for both template and assessment.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAttachment(IAttachment attachment)` Add an attachment to the assessment.
    `void` | `addComment(IComment comment)` Add a comment to the assessment.
    `void` | `addQuestion(IQuestion question)` Add a question to the questionnaire.
    `void` | `addSection(ISection section)` Add a section to the questionnaire.
    `java.lang.String` | `getActionType()`
    `IUser` | `getAssignee()` Returns the assignee (user) of this questionnaire.
    `java.util.List<IAttachment>` | `getAttachments()` Returns a list of attachments of the assessment.
    `java.util.List<java.lang.String>` | `getAvailableActions()` Returns available transitions to set, which is determined by the lifecycle or the workflow.
    `java.util.List<IEnumValue>` | `getAvailableTransitions()` Deprecated. - call `getAvailableActions()` instead.
    `java.util.List<IComment>` | `getComments()` Returns a list of comments of the assessment.
    `java.lang.Boolean` | `getCompletionRequired()`
    `java.util.Date` | `getDueDate()`
    `java.util.Date` | `getLastModifiedDate()`
    `IQuestion` | `getQuestionBy(Id id)` Returns a question that has the specified id.
    `java.util.List<IQuestion>` | `getQuestions()` Returns a list of questions, sorted by the order configured on the child objects.
    `ISection` | `getSectionBy(Id id)` Returns a section or sub-section that has the specified id.
    `java.util.List<ISection>` | `getSections()` Returns a list of sections and sub-sections, sorted by the order configured on the child objects.
    `QuestionnaireStatus` | `getStatus()` Returns the status of the questionnaire, which is determined by lifecycle.
    `java.lang.String` | `getTransitionComment()`
    `void` | `recalculateScore(boolean recalcScore)` Sets the flag to indicate to re-calculate the scores and the progress of the assessment (as a percentage) in the next save operation.
    `void` | `removeAttachment(IAttachment attachment)` Remove an attachment from the assessment.
    `void` | `removeQuestion(Id questionId)` Remove a question from the question.
    `void` | `removeSection(Id sectionId)` Remove a section from the section.
    `void` | `setTransition(java.lang.String transitionName)` Sets transition of the questionnaire.
    `void` | `setTransitionComment(java.lang.String comment)` Sets transition comment of the questionnaire.

    - ### Methods inherited from interface com.ibm.openpages.api.questionnaire.IQuestionnaireBase

      `getDescription, getId, getOrder, getParentId, getRationale, getReference, getReportID, getTitle, setDescription, setOrder, setRationale, setReference, setTitle`

- - ### Method Detail

    - #### getSections

          java.util.List<ISection> getSections()

      Returns a list of sections and sub-sections, sorted by the order configured on the child objects.
      Returns:
        list of `ISection`

    - #### getSectionBy

          ISection getSectionBy(Id id)

      Returns a section or sub-section that has the specified id.
      Parameters:
        `id` - of a section or a sub-section
      Returns:
        an ISection object, or null if id does not match any of the sections or sub-sections for this questionnaire

    - #### getQuestions

          java.util.List<IQuestion> getQuestions()

      Returns a list of questions, sorted by the order configured on the child objects.
      Returns:
        list of `IQuestion`

    - #### getQuestionBy

          IQuestion getQuestionBy(Id id)

      Returns a question that has the specified id.
      Parameters:
        `id` - the id of a question
      Returns:
        an IQuestion object, or null if id does not match any of the questions for this questionnaire

    - #### getComments

          java.util.List<IComment> getComments()

      Returns a list of comments of the assessment.
      Returns:
        list of `IComment`

    - #### getAttachments

          java.util.List<IAttachment> getAttachments()

      Returns a list of attachments of the assessment.
      Returns:
        list of `IAttachment`

    - #### getStatus

          QuestionnaireStatus getStatus()

      Returns the status of the questionnaire, which is determined by lifecycle.
      Returns:
        `QuestionnaireStatus`

    - #### getCompletionRequired

          java.lang.Boolean getCompletionRequired()

      Returns:
        the flag whether the completion is required

    - #### getAssignee

          IUser getAssignee()

      Returns the assignee (user) of this questionnaire. Note that the IQuestionnaire API only supports single user display type for the assignee field.
      Returns:
        the assignee of this questionnaire as IUser, or null if the display type is not single user.

    - #### getDueDate

          java.util.Date getDueDate()

      Returns:
        the due date of the assessment

    - #### getLastModifiedDate

          java.util.Date getLastModifiedDate()

      Returns:
        last modified date of the template or the assessment

    - #### addSection

          void addSection(ISection section)

      Add a section to the questionnaire.
      Parameters:
        `section` - the section to be added

    - #### removeSection

          void removeSection(Id sectionId)

      Remove a section from the section.
      Parameters:
        `sectionId` - the id of the section

    - #### removeQuestion

          void removeQuestion(Id questionId)

      Remove a question from the question.
      Parameters:
        `questionId` - the id of the question

    - #### addQuestion

          void addQuestion(IQuestion question)

      Add a question to the questionnaire.
      Parameters:
        `question` - the question to be added

    - #### addComment

          void addComment(IComment comment)

      Add a comment to the assessment.
      Parameters:
        `comment` - the comment to be added

    - #### addAttachment

          void addAttachment(IAttachment attachment)

      Add an attachment to the assessment.
      Parameters:
        `attachment` - the attachment to be added

    - #### removeAttachment

          void removeAttachment(IAttachment attachment)

      Remove an attachment from the assessment.
      Parameters:
        `attachment` - the attachment to be removed

    - #### getTransitionComment

          java.lang.String getTransitionComment()

      Returns:
        transition comment of the questionnaire

    - #### setTransitionComment

          void setTransitionComment(java.lang.String comment)

      Sets transition comment of the questionnaire.
      Parameters:
        `comment` -

    - #### getActionType

          java.lang.String getActionType()

      Returns:
        Action Type (lifecycle/workflow) of the questionnaire.

    - #### getAvailableTransitions

          java.util.List<IEnumValue> getAvailableTransitions()

      Deprecated. - call `getAvailableActions()` instead.
      Returns available transitions to set, which is determined by the lifecycle.
      Returns:
        `IEnumValue`

    - #### getAvailableActions

          java.util.List<java.lang.String> getAvailableActions()

      Returns available transitions to set, which is determined by the lifecycle or the workflow.
      Returns:
        `String`
      Since:
        8.2

    - #### setTransition

          void setTransition(java.lang.String transitionName)

      Sets transition of the questionnaire. When you set the transition and save the questionnaire, the lifecycle/workflow stage/questionnaire status is updated automatically by the lifecycle trigger or the workflow. This throws `InvalidArgumentException` when the transitionName is not in the list of available transitions.
      Parameters:
        `transitionName` - non-null string value which is one of available transitions

    - #### recalculateScore

          void recalculateScore(boolean recalcScore)

      Sets the flag to indicate to re-calculate the scores and the progress of the assessment (as a percentage) in the next save operation. The flag itself is not persisted. By default, the score is calculated incrementally and it is not required to call this method to recalculate the score. There would be a case like a product jar is patched and you would like to reflect the change in the scores. Then, you can set this flag and save the questionnaire.
      Parameters:
        `recalcScore` -

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.