cmu.survey.jsp.tags
Class RandomizeQuestionOrder

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.RandomizeQuestionOrder
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 RandomizeQuestionOrder
extends QuestionContainerTagStub

Randomizes the order of questions.
RandomizeQuestionOrder go inside a set of Survey tags, and you put a bunch of Question tags inside of it. Then it will randomize the order that those questions appear in the survey every time someone visits the page.

 So, for example,
 <%@ taglib uri="/WEB-INF/SurveyTags.tld" prefix="survey" %>.
 <survey:survey databaseName="databaseName" table="tableName" >.
 <survey:randomizeQuestionOrder>.
     <survey:textQuestion question="Question A" dbField="fieldNameInTableNameA"/>.
     <survey:textQuestion question="Question B" dbField="fieldNameInTableNameB"/>.
 </survey:randomizeQuestionOrder>.
 </survey:survey>.
 
Sometimes this will look like this:

Question A


Question B


And sometimes like this:

Question B


Question A


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, debug, 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
RandomizeQuestionOrder()
           
 
Method Summary
 void addQuestion(QuestionTag q)
           
 
Methods inherited from class cmu.survey.jsp.tags.QuestionContainerTagStub
doEndTag, doQuestion, doStartTag, reinit
 
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

RandomizeQuestionOrder

public RandomizeQuestionOrder()
Method Detail

addQuestion

public void addQuestion(QuestionTag q)
Specified by:
addQuestion in interface QuestionContainerTag
Overrides:
addQuestion in class QuestionContainerTagStub