cmu.survey.jsp.tags
Class QuestionWithVariable
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
cmu.survey.jsp.tags.TagSupportAndMore
cmu.survey.jsp.tags.QuestionTagStub
cmu.survey.jsp.tags.Question
cmu.survey.jsp.tags.QuestionWithVariable
- All Implemented Interfaces:
- HasErrorInfo, HasErrorInfoAndSaves, QuestionTag, java.io.Serializable, java.lang.Cloneable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
- Direct Known Subclasses:
- AbstractQuestion, CheckboxQuestion, DateTimeQuestion, HiddenQuestion, QuestionWithChoices, TextAreaQuestion, TextQuestion
public abstract class QuestionWithVariable
- extends Question
- See Also:
- Serialized Form
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Methods inherited from class cmu.survey.jsp.tags.Question |
clone, doEndOfQuestion, doEndOfQuestionNoPrinting, doMiddleOfQuestion, doQuestion, doStartOfQuestion, doStartOfQuestion, getAutoSubmitWhenFinishedWithThisQuestion, getBackgroundColorHTMLText, getDatabaseQuery, getEndQuestion, getExtraErrorInfo, getHelpText, getID, getOtherQuestionInfoToSave, getQuestion, getSupplementalErrorInfo, print, print, printTimeSpentField, setAutoSubmitWhenFinishedWithThisQuestion, setBackgroundColor, setEndQuestion, setHelpText, setID, setNumberOfColumns, setOtherQuestionInfoToSave, setQuestion, setSupplementalErrorInfo |
Methods inherited from class cmu.survey.jsp.tags.TagSupportAndMore |
breakDownToArray, convertDayNameToNum, convertDayNumToName, convertDayNumToName, convertMonthNumToName, doCatch, doEndTag, doFinally, formatDateTimeViewable, formatDateTimeViewable, formatDateViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, getNumDaysInWeek, parseTimeNoSecondsFromViewable, println |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dbField
protected java.lang.String dbField
type
protected java.lang.String type
FieldTypes
public static final java.lang.String[] FieldTypes
FieldTypeIsNumeric
public static final boolean[] FieldTypeIsNumeric
FieldTypeIsKey
public static final boolean[] FieldTypeIsKey
QuestionWithVariable
public QuestionWithVariable()
QuestionWithVariable
public QuestionWithVariable(Survey survey)
setDbField
public void setDbField(java.lang.String newDbField)
- This is the field in the database that the answer to this question is saved.
It is stored in: Survey.getTable()+"."+Question.getDBField()
getDbField
protected java.lang.String getDbField()
isValidType
public static boolean isValidType(java.lang.String type)
setType
public void setType(java.lang.String newType)
getType
protected java.lang.String getType()
getAnswer
public Answer getAnswer()
isTypeNumeric
public boolean isTypeNumeric(java.lang.String type2)
isTypeNumeric
public boolean isTypeNumeric()
isTypeKey
public boolean isTypeKey()
getFieldAndType
public static java.lang.String getFieldAndType(java.lang.String type,
java.lang.String dbField)
getFieldAndType
public java.lang.String getFieldAndType()
setDefaultValue
public void setDefaultValue(java.lang.String defaultValueToSet)
getExtraJavaScripts
public java.lang.String getExtraJavaScripts(boolean thisIsWrittenInJavaScript,
java.lang.String type,
java.lang.String dbField)
getExtraJavaScripts
public java.lang.String getExtraJavaScripts(boolean thisIsWrittenInJavaScript)
getTimeSpentInOnClickOrPressed
public java.lang.String getTimeSpentInOnClickOrPressed(boolean thisIsWrittenInJavaScript,
java.lang.String dbField)
getTimeSpentInOnClickOrPressed
public java.lang.String getTimeSpentInOnClickOrPressed(boolean thisIsWrittenInJavaScript)
printTimeSpentField
public void printTimeSpentField()
hasVariable
public abstract boolean hasVariable()
- Whether this has a standard "answer" variable, i.e. whether the Question needs to call "getAnswer()" to load and save the answer.
For example, headers do not have variables, short answers do. More complicated, AbstractQuestions should return false, despite having some variables -- they don't have any standard variables.
- Returns:
saveQuestionInfo
protected void saveQuestionInfo()
- Description copied from class:
Question
- Designed to be overwritten by QuestionWithVariable.
- Overrides:
saveQuestionInfo
in class Question
reinit
public void reinit()
- Overrides:
reinit
in class Question