Google Answers Logo
View Question
 
Q: Javscript- Random Sequence of Pages in Online Survey NEED ANSWER BY 8/5 2pm EST ( No Answer,   0 Comments )
Question  
Subject: Javscript- Random Sequence of Pages in Online Survey NEED ANSWER BY 8/5 2pm EST
Category: Computers > Programming
Asked by: sfarcher-ga
List Price: $40.00
Posted: 04 Aug 2003 21:02 PDT
Expires: 05 Aug 2003 07:32 PDT
Question ID: 240125
I am building an online survey, 11 questions in length. The survey is
comeplte, I just have one more piece of functionality to build into
it.

I wish to present a series of five questions(q5-q10) whose order will
be randomly rotated for each respondent. The survey engine collects
the data via a perl script, and javascript determines the path of the
survey.

The snippet below is what is already built in to the page. I need this
script altered to include on six pages, the first being the page
preceding the random sequence of 5(q4), and the 5 pages(q5-q10)
themselves. No one should get asked the same question twice, the
respondent should see each of q5-q10 in random order until all the
questions have been asked.

After being asked each of the five questions, all respondents will
proceed to q11.

Below is an example of how the survey currently determines the path
based upon the answer to the question. I would like to determine the
path of these 5 pages as illustrated above.

<script type="text/javascript" language="JavaScript1.2"><!--

  function PdcProcessPage(){
    
    NextPage();
    
    return true;
  }
  
  function NextPage(){
    document.PdcSurvey.PdcNextPage.value ="/mytest/mytest002.htm";
    
    // if Choice #1 of question Q1 selected then go to question Q3.
    if(document.PdcSurvey.QQ1[0].checked){document.PdcSurvey.PdcNextPage.value="/mytest/mytest003.htm";
return;}
    
  }
// --></script>

Clarification of Question by sfarcher-ga on 04 Aug 2003 21:15 PDT
Also- there is a hidden form variable on each page called
"PdcCurrentPage", in this fashion:

<input type="hidden" name="PdcCurrentPage" value="/mytest/mytest.htm"
/>


Not being a coder, but understading what it is I want to do, I think
that perhaps a cookie could be set on each page that store what pages
have been visited, so that the same page in the possible 5 won't be
reached twice.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy