Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titlerandom.jsp
borderStylesolid
<%@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 random.jsp 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.

...

  • Tip - Please note that jsp is very unforgiving, if a comma, or quote is missing or duplicated you will get an ugly error message complaining about what ever you missed, or wrongfully included. Luckily, it will usually provide some useful clues as to what is wrong. Make your changes, and re-upload, and test again if there are errors

4. Save the random page as random.jsp and upload it.

5 Testing. Open up your survey on the web, and log in. Run through each of the pages until the survey ends. You may need to do this more then once to see the randomization effect. This is especially true of the other types of randomization such as redirectToRandomOrderAndBalanced.