Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Please also note that at the time posting, I have not yet tested all the code. Will do so shortly.

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

Basic JSP Randomization example:

*Please note before following these examples, make sure your survey is setup for jsp. And you are familiar with how to use the Web Survey Toolbox GUI

In this example we will randomize 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.

• Download page1.jsp and change the nextPage variable to random.jsp (see Code Example 1 below). For help with uploading or downloading see here.
• Save page1.jsp as page2.jsp and repeat for page3.jsp.
• Change the pageName parameter in page2.jsp to "Page 2"
• Then change the nextPage variable to "random.jsp" (see code example 2 below)
• Change the pageName parameter in page3.jsp to "Page 3"
• Then change the nextPage variable to "random.jsp" (see code example 3 below)
• Then upload all thee pages.