com.objectplanet.survey.plugin.api
Class QuestionMultiple

java.lang.Object
  extended by com.objectplanet.survey.plugin.api.Question
      extended by com.objectplanet.survey.plugin.api.QuestionMultiple

public class QuestionMultiple
extends Question

This class represents a multiple choice question. Subclasses Question, and adds functionality to create/edit/delete a multiple choice question.

Author:
Irina Brun
Created:
31. march 2003

Field Summary
static int LAYOUT_BUTTON_BOTTOM
          Option layout: Button is placed under the text/image
static int LAYOUT_BUTTON_LEFT
          Option layout: Button is placed to the left of the text/image
static int LAYOUT_BUTTON_RIGHT
          Option layout: Button is placed to the right of the text/image
static int LAYOUT_BUTTON_TOP
          Option layout: Button is placed over the text/image
static int LAYOUT_IMAGE_BOTTOM
          Option layout: Image is placed under the text
static int LAYOUT_IMAGE_LEFT
          Option layout: Image is placed to the left of the text
static int LAYOUT_IMAGE_RIGHT
          Option layout: Image is placed to the tight of the text
static int LAYOUT_IMAGE_TOP
          Option layout: Image is placed over the text
 
Fields inherited from class com.objectplanet.survey.plugin.api.Question
ESSAY_FIELD_CHECKBOX, ESSAY_FIELD_DROPDOWN, ESSAY_FIELD_NUMERIC_DEC, ESSAY_FIELD_NUMERIC_INT, ESSAY_FIELD_TEXT, ESSAYFIELD_LENGTH, INTEXT_TYPE_CHECKBOX, INTEXT_TYPE_DROPDOWN, INTEXT_TYPE_NUMERIC_DEC, INTEXT_TYPE_NUMERIC_INT, INTEXT_TYPE_TEXT, QUESTION_DROPDOWN, QUESTION_MATRIX, QUESTION_MULTIPLE, QUESTION_NO_TYPE, QUESTION_NUMERIC, QUESTION_RATING, TAG_END, TAG_START, UPLOAD_IMAGE, UPLOAD_NONE
 
Method Summary
 void addOption(int optionIndex, java.lang.String optionText)
          Adds an option to the end of the multiple choice question.
 void addOption(int optionIndex, java.lang.String optionText, java.lang.String imageUrl, int buttonLayout, int imageLayout)
          Adds an option to the the multiple choice question.
 void addOption(java.lang.String optionText)
          Adds an option to the end of the multiple choice question.
 void addOption(java.lang.String optionText, java.lang.String imageUrl, int buttonLayout, int imageLayout)
          Adds an option to the end of the multiple choice question.
 int getColumnCount()
          Gets the number of columns
 boolean getMultipleOn()
          Gets the multipleOn
 int getOptionButtonLayout(int index)
          Gets option button layout (position relative to the text/image)
 int getOptionCount()
          Gets the optionCount
 java.lang.String getOptionImage(int index)
          Gets option image
 int getOptionImageLayout(int index)
          Gets option image layout (position relative to the text)
 java.lang.String getOptionText(int index)
          Gets option text.
 boolean getOtherField()
          Gets text-field for entering "other".
 void keepBusinessObject()
          Get and keep business object.
 void releaseBusinessObject()
          Release business object.
 void removeOption(int optionIndex)
          Removes one option
 void removeOptions()
          Removes all options.
 void setColumnCount(int columnCount)
          Sets the number of columns
 void setMultipleOn(boolean MultipleOn)
          Sets multiple selections.
 void setOtherField(boolean otherOn)
          Sets text-field for entering "other", if none of the other choices apply.
 
Methods inherited from class com.objectplanet.survey.plugin.api.Question
addEssayFieldCheckbox, addEssayFieldDecimal, addEssayFieldDropdown, addEssayFieldInteger, addEssayFieldText, addIntextCheckbox, addIntextDecimal, addIntextDropdown, addIntextInteger, addIntextText, deleteEssayField, deleteIntext, deleteValidator, deleteValidator, deleteValidator, deleteValidator, getAnswerRotation, getCustomId, getDisplayNo, getEssayFieldCount, getEssayFieldDropdownItems, getEssayFieldDropdownLabel, getEssayFieldDropdownSortOn, getEssayFieldSize, getEssayFieldType, getFreeTextColumns, getFreeTextLabel, getFreeTextMaxLength, getFreeTextRows, getIntextCount, getIntextDropdownItems, getIntextDropdownLabel, getIntextDropdownSortOn, getIntextIndex, getIntextName, getIntextSize, getIntextType, getQuestionId, getQuestionLayout, getQuestionText, getQuestionType, getTextAfter, getTextBefore, getUploadType, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorErrorMessage, getValidatorParameter, getValidatorParameter, getValidatorParameter, getValidatorParameter, getWeight, hasBusinessObject, isFreeTextOn, isValidatorOn, isValidatorOn, isValidatorOn, isValidatorOn, setAnswerRotation, setDisplayNo, setFreeTextColumns, setFreeTextLabel, setFreeTextMaxLength, setFreeTextOn, setFreeTextRows, setQuestionLayout, setQuestionText, setTextAfter, setTextBefore, setUploadType, setValidator, setValidator, setValidator, setValidator, setWeight, updateAttribute, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAYOUT_IMAGE_LEFT

public static final int LAYOUT_IMAGE_LEFT
Option layout: Image is placed to the left of the text

See Also:
Constant Field Values

LAYOUT_IMAGE_RIGHT

public static final int LAYOUT_IMAGE_RIGHT
Option layout: Image is placed to the tight of the text

See Also:
Constant Field Values

LAYOUT_IMAGE_TOP

public static final int LAYOUT_IMAGE_TOP
Option layout: Image is placed over the text

See Also:
Constant Field Values

LAYOUT_IMAGE_BOTTOM

public static final int LAYOUT_IMAGE_BOTTOM
Option layout: Image is placed under the text

See Also:
Constant Field Values

LAYOUT_BUTTON_LEFT

public static final int LAYOUT_BUTTON_LEFT
Option layout: Button is placed to the left of the text/image

See Also:
Constant Field Values

LAYOUT_BUTTON_RIGHT

public static final int LAYOUT_BUTTON_RIGHT
Option layout: Button is placed to the right of the text/image

See Also:
Constant Field Values

LAYOUT_BUTTON_TOP

public static final int LAYOUT_BUTTON_TOP
Option layout: Button is placed over the text/image

See Also:
Constant Field Values

LAYOUT_BUTTON_BOTTOM

public static final int LAYOUT_BUTTON_BOTTOM
Option layout: Button is placed under the text/image

See Also:
Constant Field Values
Method Detail

setMultipleOn

public void setMultipleOn(boolean MultipleOn)
                   throws LockException,
                          RespondentsExistException,
                          SurveySecurityException,
                          SurveySystemException
Sets multiple selections.

Parameters:
MultipleOn - Multiple selections value
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setColumnCount

public void setColumnCount(int columnCount)
                    throws LockException,
                           RespondentsExistException,
                           SurveySecurityException,
                           SurveySystemException
Sets the number of columns

Parameters:
columnCount - The number of columns
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

setOtherField

public void setOtherField(boolean otherOn)
                   throws java.lang.IllegalArgumentException,
                          LockException,
                          RespondentsExistException,
                          SurveySecurityException,
                          SurveySystemException
Sets text-field for entering "other", if none of the other choices apply. This method requires that some multiple options exist. Otherwise IllegalArgumentException will be thrown.

Parameters:
otherOn - True if other is on.
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
java.lang.IllegalArgumentException - If no multiple options exist..
SurveySystemException - If an error occurs in the system.

getMultipleOn

public boolean getMultipleOn()
                      throws SurveySystemException
Gets the multipleOn

Returns:
True if multiple answers can be chosen
Throws:
SurveySystemException - If an error occurs in the system.

getColumnCount

public int getColumnCount()
                   throws SurveySystemException
Gets the number of columns

Returns:
The number of columns
Throws:
SurveySystemException - If an error occurs in the system.

getOptionCount

public int getOptionCount()
                   throws SurveySystemException
Gets the optionCount

Returns:
The optionCount
Throws:
SurveySystemException - If an error occurs in the system.

getOtherField

public boolean getOtherField()
                      throws SurveySystemException
Gets text-field for entering "other".

Returns:
The other value
Throws:
SurveySystemException - If an error occurs in the system.

getOptionText

public java.lang.String getOptionText(int index)
                               throws java.lang.IllegalArgumentException,
                                      SurveySystemException
Gets option text.

Parameters:
index - Index of the option
Returns:
The option text
Throws:
java.lang.IllegalArgumentException - If illegal index
SurveySystemException - If an error occurs in the system.

getOptionImage

public java.lang.String getOptionImage(int index)
                                throws java.lang.IllegalArgumentException,
                                       SurveySystemException
Gets option image

Parameters:
index - Index of the option
Returns:
The option image url
Throws:
java.lang.IllegalArgumentException - If illegal index
SurveySystemException - If an error occurs in the system.

getOptionButtonLayout

public int getOptionButtonLayout(int index)
                          throws java.lang.IllegalArgumentException,
                                 SurveySystemException
Gets option button layout (position relative to the text/image)

Parameters:
index - Index of the option
Returns:
The option button position, one of the constants above.
Throws:
java.lang.IllegalArgumentException - If illegal index
SurveySystemException - If an error occurs in the system.

getOptionImageLayout

public int getOptionImageLayout(int index)
                         throws java.lang.IllegalArgumentException,
                                SurveySystemException
Gets option image layout (position relative to the text)

Parameters:
index - Index of the option
Returns:
The option image position, one of the constants above.
Throws:
java.lang.IllegalArgumentException - If illegal index
SurveySystemException - If an error occurs in the system.

addOption

public void addOption(java.lang.String optionText)
               throws LockException,
                      RespondentsExistException,
                      SurveySecurityException,
                      SurveySystemException
Adds an option to the end of the multiple choice question.

Parameters:
optionText - Option text
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

addOption

public void addOption(int optionIndex,
                      java.lang.String optionText)
               throws LockException,
                      RespondentsExistException,
                      SurveySecurityException,
                      SurveySystemException
Adds an option to the end of the multiple choice question.

Parameters:
optionIndex - Index of the option, starts at 0
optionText - Option text
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

addOption

public void addOption(java.lang.String optionText,
                      java.lang.String imageUrl,
                      int buttonLayout,
                      int imageLayout)
               throws LockException,
                      RespondentsExistException,
                      SurveySecurityException,
                      SurveySystemException
Adds an option to the end of the multiple choice question.

Parameters:
optionText - Option text
imageUrl - Relative image url.
buttonLayout - Position of the button, relative to the text and image
imageLayout - Position of the image, relative to the text
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

addOption

public void addOption(int optionIndex,
                      java.lang.String optionText,
                      java.lang.String imageUrl,
                      int buttonLayout,
                      int imageLayout)
               throws LockException,
                      RespondentsExistException,
                      SurveySecurityException,
                      SurveySystemException
Adds an option to the the multiple choice question.

Parameters:
optionIndex - Index of the option, starts at 0
optionText - Option text
imageUrl - Relative image url.
buttonLayout - Position of the button, relative to the text and image
imageLayout - Position of the image, relative to the text
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

removeOption

public void removeOption(int optionIndex)
                  throws LockException,
                         RespondentsExistException,
                         SurveySecurityException,
                         SurveySystemException
Removes one option

Parameters:
optionIndex - Index of the option, from 0 to optionCount-1
Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

removeOptions

public void removeOptions()
                   throws LockException,
                          RespondentsExistException,
                          SurveySecurityException,
                          SurveySystemException
Removes all options.

Throws:
LockException - Thrown if the survey is locked and can't be edited. Not yet implemented. Use survey.isLocked() to be sure that the survey can be updated.
RespondentsExistException - Thrown if the survey has responses and can't be edited. Not yet implemented. Use survey.hasRespondents() to be sure that the survey can be updated.
SurveySecurityException - Thrown if the user is not authorized to call this method.
SurveySystemException - If an error occurs in the system.

keepBusinessObject

public void keepBusinessObject()
                        throws SurveySystemException
Get and keep business object. See ATTENTION .

Overrides:
keepBusinessObject in class Question
Throws:
SurveySystemException - If an error occurs in the system.

releaseBusinessObject

public void releaseBusinessObject()
Release business object. See ATTENTION .

Overrides:
releaseBusinessObject in class Question

Copyright ? ObjectPlanet Inc. All Rights Reserved.

Built on December 20 2016