cmu.survey.jsp.tags
Class QuestionsFromDatabase
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
cmu.survey.jsp.tags.TagSupportAndMore
cmu.survey.jsp.tags.QuestionTagStub
cmu.survey.jsp.tags.QuestionContainerTagStub
cmu.survey.jsp.tags.QuestionsFromDatabase
- All Implemented Interfaces:
- QuestionContainerTag, QuestionTag, java.io.Serializable, java.lang.Cloneable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
public class QuestionsFromDatabase
- extends QuestionContainerTagStub
- 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.TagSupportAndMore |
breakDownToArray, convertDayNameToNum, convertDayNumToName, convertDayNumToName, convertMonthNumToName, doCatch, doFinally, formatDateTimeViewable, formatDateTimeViewable, formatDateViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, formatTimeNoSecondsViewable, getNumDaysInWeek, parseTimeNoSecondsFromViewable, print, 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 |
QuestionsFromDatabase
public QuestionsFromDatabase()
setRandomizeQuestionOrder
public void setRandomizeQuestionOrder(boolean theRandomize)
getCacheRandomQuestionOrder
public boolean getCacheRandomQuestionOrder()
- Returns:
- Returns whether the random question order is cached -- if it's cached, as it is by default, the order will only randomize once per user login, so for each user that logs in they will only see the questions in one order (this is cached by session, so if they log out and log back in, they'll get a different order). Useful when you have a set of randomized questions showing more than once.
setCacheRandomQuestionOrder
public void setCacheRandomQuestionOrder(boolean cacheRandomQuestionOrder)
- Parameters:
cacheRandomQuestionOrder
- The cacheRandomQuestionOrder to set.
setTable
public void setTable(java.lang.String theTable)
- Deprecated. Do not use this anymore. It is obsolete and will be ignored -- there is only one table now.
- Parameters:
theTable
-
addQuestionNumbers
public void addQuestionNumbers(int from,
int to)
setPage
public void setPage(int thePage)
setPageName
public void setPageName(java.lang.String pageName)
setQuestionNumbers
public void setQuestionNumbers(java.lang.String questionNumbersString)
doStartTag
public int doStartTag()
- Specified by:
doStartTag
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in class QuestionContainerTagStub
getNewDatabaseQuery
protected DatabaseQuery getNewDatabaseQuery()
- We pass in addQuestionToList so that the method can add multiple questions if it wants to.
- Parameters:
questionData
- addQuestionToList
-
doQuestionSet
protected int doQuestionSet(java.util.Vector<QuestionTag> questionsFromDB)
getQuestionsFromPage
protected java.util.Vector<QuestionTag> getQuestionsFromPage(java.lang.String pageName)
getQuestionsFromPage
protected java.util.Vector<QuestionTag> getQuestionsFromPage(int page)
getQuestionsFromQuestionNumbers
protected java.util.Vector<QuestionTag> getQuestionsFromQuestionNumbers(java.util.Vector<java.lang.Integer> questionNumbers)
doQuestion
public void doQuestion()
- Specified by:
doQuestion
in interface QuestionTag
- Overrides:
doQuestion
in class QuestionContainerTagStub
getNumQuestionsDone
public int getNumQuestionsDone()
reinit
public void reinit()
- Overrides:
reinit
in class QuestionContainerTagStub
doEndTag
public int doEndTag()
- Specified by:
doEndTag
in interface javax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in class QuestionContainerTagStub