Script: Complex Grid - Conditional Split Screen Text

This article will help you setup conditional text in Complex Grids when using the Split Screen feature 


Background

You may be using a 'Complex Grid' and splitting the grid across X screens. By default, the question text will remain the same the entire time. If you want to conditionalize the question text, the instructions below will help you set this up. 


Instructions

  1. Program your 'Complex Grid' making sure to set it up to display the grid accross X rows or screens.
  2. Access the HTML editor tied to the 'Instructions' field
  3. Access the Source Code Editor
    • See article: Source Code Editor
    • Add the following code to this field
      <script type="text/javascript">cmSurvey.onPageLoad(function(){gotoSplitResponsesBatch(getCurrentSplitResponseBatch());});</script>
      		
  4. Keep the following in mind:
    • You will also need to wrap conditional text in an HTML tag like a span, div, etc. and add a "data-response-batch" attribute.
    • The value of this attribute should an integer that represents the iteration/split/screen.
    • These numbers are zero indexed so the first iteration/split/screen is "0".
    • You will add the conditionalized text/code to the Source Code Editor withing the question text

Examples

  1. You can use completely different text for each screen/iteration.
    1. This would be the text/code you would add to the Source Code Editor in the question text field for the first screen/iteration:
      <div data-response-batch="0">For this next exercise...</div>
    2. This is the text/code you would add for the second screen/iteration:
      <div data-response-batch="1">Just like the last page...</div>
    3. You can continue the pattern for as many screens/iterations as is applicable to your exercise
  2. You can have the same text and just change one word/phrase
    1. You can use the same code as above but just wrap it around the word/phrase that needs changing:
      For this <span data-response-batch="0">first</span><span data-response-batch="1">next</span><span data-response-batch="2">next</span><span data-response-batch="3">next</span><span data-response-batch="4">next</span> set of statements...
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us