Now that all the issues are on the table, on with the show....

Basic JSP Randomization example:

In this example we will randomize the order of 3 pages (page1.jsp, page2.jsp, and page3.jsp). There are 4 options for what type of random you can use. For this example we will use redirectRandomOrderTo, of just plain random.

  1. Create 3 pages in the Survey Manager and make 3 long answer questions on each page. Name the pages Page 1, Page 2, and Page 3.
  2. Make the JSP pages for each of the three pages you created in the Survey Manager.
<%@include file="include_questionnaire.jsp"%>

<survey:surveypage
	pageName="Page 1"
	pageWidth="600"
	nextPage="random.jsp"
	submitButtonText="Next"
	showSubmitButton="true"
	timeResponses="false"
	rememberPageUserIsOn="true"
	pageToLoginTo="index.jsp"
	tableToVerifyLoginTo="Users"
	isLoginPage="false"
	/>

<%@include file="survey_end.jsp"%>
<%@include file="include_questionnaire.jsp"%>

<survey:surveypage
	pageName="Page 2"
	pageWidth="600"
	nextPage="random.jsp"
	submitButtonText="Next"
	showSubmitButton="true"
	timeResponses="false"
	rememberPageUserIsOn="true"
	pageToLoginTo="index.jsp"
	tableToVerifyLoginTo="Users"
	isLoginPage="false"
	/>

<%@include file="survey_end.jsp"%>
<%@include file="include_questionnaire.jsp"%>

<survey:surveypage
	pageName="Page 3"
	pageWidth="600"
	nextPage="random.jsp"
	submitButtonText="Next"
	showSubmitButton="true"
	timeResponses="false"
	rememberPageUserIsOn="true"
	pageToLoginTo="index.jsp"
	tableToVerifyLoginTo="Users"
	isLoginPage="false"
	/>

<%@include file="survey_end.jsp"%>

3. Create a new document in you favorite text editor (e.g. Word Pad, SimpleText, etc.) with the following (you can simply copy and paste this) :

<%@include file="include_questionnaire.jsp"%>

<%
if (redirectRandomOrderTo("Users", "RandomPageOrder", new String[]{"page1.jsp", "page2.jsp", "page3.jsp", " })) {
} else {
redirectTo("doneWithSurvey.jsp");
}
%>

<%@include file="survey_end.jsp"%>

General Code Explanation:
In general, this is an if statement that says, in the randomPageOrder column of the Users table, keep track of the order of pages the participant has visited. When the participant has randomly visited all of these listed pages, send them to the doneWithSurvey.jsp page.

Each part explained: