Dynamic questionnaire according to methodology

Compatibility: IdSurvey 6 IdSurvey 7

To display texts, questions or pages according to the methodology in use you have to save a variable in the contact. This data can then be used to create branching and logic according to the methodology.

The script can be used for CATI, CAWI and CAPI.

Note

  • If you are using mixed mode and the interview is completed with a different methodology than the one saved by the javascript, the variable will stay the same.

Step 1

Create the page of your questionnaire with a single select questions with three answer options:

  • Answer option one will be for the interview started with CAWI
  • Answer option two will be for the interview started with CATI
  • Answer option three will be for the interview started with CAPI

Step 2

For each of the answer options go on the gearwheel button and enable “Edit contact field” and select the field you will use to save the information from the dropdown (Field14 was used in the example).

Step 3

Then for Answer1 write on the box below “CAWI”, for Answer2 write “CATI” and for Answer3 write “CAPI”.

Step 4

Now go on the gearwheel button of the page and enable the “Client script” button. Copy the following code into the box:

<style>
      #page{
          display:none;
      }
  </style>
  <script type="text/javascript">
      var host = self.location.href;
      if(host.indexOf(".cawi.") > 0){
          $(".single-question-responses li:first-child input[type=radio]").trigger("click");
       }else if(host.indexOf(".cati.") > 0){
          $(".single-question-responses li:nth-child(2) input[type=radio]").trigger("click");
       }else{
          $(".single-question-responses li:last-child input[type=radio]").trigger("click");
       }
      $("#nextPage").trigger("click");
  </script>

module_script

The IdCode of your entire page will look like this:

/page Pstart1
  <clientscript>
  <style>
      #page{
          display:none;
      }
  </style>
  <script type="text/javascript">
      var host = self.location.href;
      if(host.indexOf(".cawi.") > 0){
          $(".single-question-responses li:first-child input[type=radio]").trigger("click");
       }else if(host.indexOf(".cati.") > 0){
          $(".single-question-responses li:nth-child(2) input[type=radio]").trigger("click");
       }else{
          $(".single-question-responses li:last-child input[type=radio]").trigger("click");
       }
      $("#nextPage").trigger("click");
  </script> </clientscript> start1   Marks if interview has started on CAWI or CATI 1 If CAWI marks CAWI on Field14 /UQ "Field14=CAWI" 2 If CATI marks CATI on Field14 /UQ "Field14=CATI" 3 If CAPI marks CAPI on Field14 /UQ "Campo14=CAPI"

Leave A Comment?