Looping Multiple Blocks or Calculating Score within Looped Block for Display Logic | XM Community
Skip to main content

Hi everyone. I am fairly new to Qualtrics and even newer to Javascript. I am looking for some assistance with a survey I am designing for parents to fill out. They need to respond to about ~20 questions per child. Certain questions appear based on the child's age and interests.
I originally had it set up for each block to have specific sets of questions (e.g., block three - science, block four - sports, etc). It appears that Qualtrics does not allow multiple blocks to be looped together.
Another idea I had was after a parent answers all the questions for one child, it shows a question asking "Do you want to answer the questions for another child?" and if they select 'Yes', it would start back at block one. I could not find a way for this to happen. I would rather not have the participant have to exit the survey and then enter again for a new child (this would be quite intensive for families with more than 2-3 children).
I then merged all of my questions into one block, separating the sections by page breaks. I individually applied display logic to each question based on the child's age and interests; this was very intensive (e.g., "What books does your child read?" only appears if the child is older than two years and answered 'Yes' to "Does your child read books?"). I have Javascript calculate the child's age from a date-of-birth question.
However, I have a set of questions that calculates a total score based on the child's interests - (e.g., "Does your child play sports?" - Yes scores a 1, No scores a 0; "Does your child play alone?" - Yes scores a 0, No scores a 1, etc). I wanted to use Scoring to create an embedded data called "score" for my display logic for further questions (e.g., more than 5 - show question "How much time does your child spend with friends?"; less than 5 - show question "How much time does your child spend alone?"). When I did so, my display logic does not work. I assume this is an issue with Scoring within looped blocks - can anyone advise on a solution or a way to do this through Javascript (similar to the age calculation)?
Any help is much appreciated, thank you!

Example:

  1. "Does your child read books?" Yes --> Display Q2. No --> Display Q3.

  2. "What kind of books does your child read?" Any answer --> Display Q3.

  3. "Does your child play sports?" Score: Yes = 1, No = 0

  4. "Does your child play alone?" Score: Yes = 0, No = 1

  5. Score 1 or less --> Display "How much time does your child spend with friends?"

  6. Score 2 or more --> Display "How much time does your child spend alone?"

  7. End of Survey.

Be the first to reply!

Leave a Reply