| java.lang.Object com.xoetrope.survey.Question
Question | public class Question (Code) | | A data store for a question, its ID and the response options
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.8 $
|
DEFAULT_TYPE | final public static int DEFAULT_TYPE(Code) | | |
FREE_TEXT | final public static int FREE_TEXT(Code) | | Flag identifying a question that is a edit type of question.
|
MAX_RANGE | final public static int MAX_RANGE(Code) | | The maximum value range for the question
|
MULTIPLE_CHOICE | final public static int MULTIPLE_CHOICE(Code) | | Flag identifying a question that is a multiple choice question
|
MUTUALLY_EXCLUSIVE | final public static int MUTUALLY_EXCLUSIVE(Code) | | Flag identifying a questions whose options are mutually exclusive of one another
|
QUESTION_TYPES | final public static String[] QUESTION_TYPES(Code) | | |
Question | public Question(int qId, QuestionGroup g, int type, String caption)(Code) | | Creates a new question
Parameters: type - The Question type Parameters: qId - The question id Parameters: range - The number of response Parameters: caption - The question text |
Question | public Question(int qId, QuestionGroup g)(Code) | | Creates a new question
Parameters: type - the question type Parameters: qId - the id of the question Parameters: g - the question group that this question will belong to |
addOption | public void addOption(int id, String caption)(Code) | | Add a response option
Parameters: id - the response id or value Parameters: caption - the response text |
addOption | public void addOption(Option o)(Code) | | Adds the option to this question
Parameters: o - the option which is to be added |
deleteOption | public void deleteOption(int optionIdx)(Code) | | Deletes the option with the specified index
Parameters: optionIdx - the index of the option |
getDEFAULT_TYPE | public int getDEFAULT_TYPE()(Code) | | Gets the default question type
the default type |
getGroup | public QuestionGroup getGroup()(Code) | | Gets the question group that this
question belongs to
the question group |
getId | public int getId()(Code) | | Gets the question ID
teh ID |
getNumOptions | public int getNumOptions()(Code) | | Gets the number of response options
the number of options |
getOption | public Option getOption(int index)(Code) | | Gets the option of this question with the specified index
Parameters: index - the index of the option the wanted option |
getOptionById | public Option getOptionById(int optionId)(Code) | | Gets the option with the specified id
Parameters: optionId - the id of the option option |
getOptionId | public int getOptionId(int index)(Code) | | Gets the Id or values of am option
Parameters: index - the option index the value |
getOptionIdByText | public int getOptionIdByText(String text)(Code) | | Gets the id of the option with the specified
text
Parameters: text - the text of the option the id of the wanted option |
getOptionIdx | public int getOptionIdx(int optionId)(Code) | | Gets the index of the specified option
of this question
Parameters: optionId - the id of the option the localization of the option |
getOptionText | public String getOptionText(int index)(Code) | | Gets the text of the option with the specified index
Parameters: index - the index of the option the text or caption of the option |
getOptions | public Vector getOptions()(Code) | | Gets this question's options
Vector containing optionsof this question |
getQuestionType | public int getQuestionType()(Code) | | Gets the question type
the type |
getQuestionTypeText | public String getQuestionTypeText()(Code) | | Gets the type of this question
String descrinbing this question's type |
getText | public String getText()(Code) | | Gets the question text
the text |
getType | public static int getType(String typeText)(Code) | | Gets the type of the passed question
Parameters: typeText - String describing the type of the question the type of the question |
setGroup | public void setGroup(QuestionGroup g)(Code) | | Sets the group of this question
Parameters: g - the question group |
setId | public void setId(int newId)(Code) | | Set the question ID
Parameters: newId - the new ID |
setOption | public void setOption(int idx, int id, String caption)(Code) | | Set an option for this questions
Parameters: idx - the option index Parameters: id - the id or value of the option Parameters: caption - the text of the question |
setQuestionType | public void setQuestionType(int qt)(Code) | | Sets the new type of this question
Parameters: qt - the new type of this question |
setSize | public void setSize(int s)(Code) | | |
setText | public void setText(String newText)(Code) | | Set the question text
Parameters: newText - the new text |
setType | public void setType(String typeName)(Code) | | Sets the new type of this question
Parameters: typeName - String describing the new type of this question |
|
|