Dynamic number of blocks | XM Community
Skip to main content

Hi,

 

I’m new to Qualtrics. Hope someone can shed some light on me.

Each student has <=5 lecturers and <=10 tutors. My data file hence has 15 columns for the names of the lecturers and the tutors (L01, L02, … T15). Certainly some columns are empty. Each lecturer (and tutor) is asked the same questions.  I can possibly add a column with the count of the lecturers and the count of the tutors respectively.

I’d like to use Loop and Merge for the blocks of lecturers and tutors for simplicity but how can I implement this?

It seems that I cannot create a block (show only if the current lecturer/tutor is not empty using branching) inside a block (loop and merge).

Thank you very much!

Hi. I managed to find a workaround:

  1. Add a column with the number of lecturers and another with the number of tutors in the data file. Import them as embedded data with others.
  2. Before the block of lecturers, add a Text question with the number of lecturers as the default value.
  3. Hide the question with JavaScript.  Add
    var q = jQuery("#"+this.questionId).hide();
    under AddOnReady.
  4. In the Loop & Merge setting of the block, loop based on the answer of the Text question with a maximum number of the lecturers (5 in this case).
  5. Field 1 is the loop index.  Fill Field 2 with the fields of the lecturer names.  Note that the Piped Text still works but you need to manually enter the fields, e.g. $(e://Field/L01).
  6. You can embed the names of the lecturers in the questions of the block.

Hope this helps!


Leave a Reply