cmu.survey.jsp.tags
Class QuestionsFromDatabase

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by cmu.survey.jsp.tags.TagSupportAndMore
          extended by cmu.survey.jsp.tags.QuestionTagStub
              extended by cmu.survey.jsp.tags.QuestionContainerTagStub
                  extended by 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

Field Summary
 
Fields inherited from class cmu.survey.jsp.tags.QuestionContainerTagStub
questions
 
Fields inherited from class cmu.survey.jsp.tags.TagSupportAndMore
dateFormatAmerican, dateTimeFormatAmerican, DAYS_OF_THE_WEEK, MONTHS_OF_THE_YEAR, timeFormatAmerican
 
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
 
Constructor Summary
QuestionsFromDatabase()
           
 
Method Summary
 void addQuestionNumbers(int from, int to)
           
 int doEndTag()
           
 void doQuestion()
           
protected  int doQuestionSet(java.util.Vector<QuestionTag> questionsFromDB)
           
 int doStartTag()
           
 boolean getCacheRandomQuestionOrder()
           
protected  DatabaseQuery getNewDatabaseQuery()
          We pass in addQuestionToList so that the method can add multiple questions if it wants to.
 int getNumQuestionsDone()
           
protected  java.util.Vector<QuestionTag> getQuestionsFromPage(int page)
           
protected  java.util.Vector<QuestionTag> getQuestionsFromPage(java.lang.String pageName)
           
protected  java.util.Vector<QuestionTag> getQuestionsFromQuestionNumbers(java.util.Vector<java.lang.Integer> questionNumbers)
           
 void reinit()
           
 void setCacheRandomQuestionOrder(boolean cacheRandomQuestionOrder)
           
 void setPage(int thePage)
           
 void setPageName(java.lang.String pageName)
           
 void setQuestionNumbers(java.lang.String questionNumbersString)
           
 void setRandomizeQuestionOrder(boolean theRandomize)
           
 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.
 
Methods inherited from class cmu.survey.jsp.tags.QuestionContainerTagStub
addQuestion
 
Methods inherited from class cmu.survey.jsp.tags.QuestionTagStub
clone, getErrorInfo, getExtraErrorInfo, getID, getSurvey, initSurvey, saveErrorInfo, setID
 
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
 
Methods inherited from interface cmu.survey.jsp.tags.QuestionTag
clone, getID
 

Constructor Detail

QuestionsFromDatabase

public QuestionsFromDatabase()
Method Detail

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