Hello!
I would like respondents to see a seating chart with the distribution of booked/available seats drawn from different distributions, which vary with the treatment they are in. This means that two respondents in the same treatment will not necessarily get to see the exact same seating chart--rather, the chart has to be generated for each respondent (from the distribution for the respective treatment).
The number of possible seating arrangements is too big for it to be efficient to generate all images, include them in Files and then link them in the question. It seems that the only efficient way to do this is using JavaScript and jQuery. I do not know JavaScript; however, I have managed to find and run pieces of code to draw "true" random numbers from random.org (to generate the embedded data necessary for the distributions of booked/available seats). I have also found script that creates the seating chart here: https://www.jqueryscript.net/chart-graph/Minimalist-Seating-Chart-Plugin-with-jQuery-flexiSeats.html. I need a hand to understand how I can use this linked code in Qualtrics, as my attempts until now have failed.
Thanks in advance!
Solved
Seating chart with seat color depending on embedded data
Best answer by wscampbell
Here's a very hacky way you could do this that is *definitely* not ideal but may help if you can't find anything better:
- Upload 2 image files to your Qualtrics library, 1 for the available seat and 1 for the occupied seat.
- In the Image Library, find each picture and click the Gear icon to get the image URL.
- Generate a matrix of distributions.* (will return to this below)
- In your survey, wherever you want the seating chart image to appear, turn on Loop & Merge for that block, and paste in your Matrix from (3) to the L&M table. Set the L&M options to Randomize and present only 1 row.
- In that block, create a question to display the seating chart. If, for instance, you had 20 seats, you could use Rich Text Editor to make a 4x5 table.
- In each cell of the table, input the placeholder for a L&M data: ${lm://Field/n}. In other words, in the first cell you'd put ${lm://Field/1}, in the second cell ${lm://Field/2}....${lm://Field/20}
That should get you what you want, but it's a terribly tedious and inelegant solution. Hopefully someone will chime in with a JS solution for you!
*3. Generating your seating matrix
You can use L&M to present images using the following code:
Use a program (R, Excel, whatever) to randomly generate distributions of available & unavailable seats. Each seat option (available or unavailable) will have its associated
Then, copy>paste this matrix into your L&M table. Each row represents a distribution of seats, each cell is filled with a link to a corresponding image, and each participant will only see 1 row (i.e., 1 distribution).
Good luck!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
