Include a ternary questionnaire in a survey | XM Community
Skip to main content

Hello,
I want to include a ternary question where the user can move the marker inside the triangle and each corner of the triangle has a label (not shown here) like the following:
Screen Shot 2022-02-26 at 5.05.01 PM.pngHere is the link to my codepen: https://codepen.io/badijabbour/pen/ZEaWxMz
When putting this in qualtrics, the circle is suddenly out of place and the dragging does not work anymore. For the triangle and marker, I'm using divs. Would it be better to use a graphic (like .png) and somehow map the coordinates to that graphic?
Are there any alternatives to include such type of questionnaires in qualtrics? (like a ready-made javascript library)
Any help is greatly appreciated as this is very important for our surveys!
Thank you!

Hi there, I think the 2nd approach (using a graphic and mapping coordinates to that graphic) can be accomplished using the Hot Spot question type:
https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/question-types-guide/specialty-questions/hot-spot/
You can upload the triangle picture and then define a Hot Spot Region for each point on the triangle.


https://community.qualtrics.com/XMcommunity/discussion/comment/44397#Comment_44397Thank you Tom, I guess I could do that. The thing is what if I wanted a continuous range? And not just discrete points in the output? For example, I want an x,y,z values for each triangle selection like this: x: 0.23, y: 0.44, z: 0.33 (these barycentric coordinates sum up to 1). Is there a way to do that without custom code? I find custom code a bit finicky in qualtrics.


I think you could do this without custom code by using a Heat Map question type and Math Operations. Within the Heat Map question, set the number of Clicks to be 1 and also create a Region that is exactly the size of the triangle. Add Validation that requires that the Click be placed inside this Region.
In the data, one column will include the x-coordinate of the Click (from the top-left of the image), and the other will include the y-coordinate of the Click (from the top-left of the image), both measured in pixels.
Then, within the survey flow, you can use Math Operations to somehow convert this XY coordinate into the ternary coordinates your are looking for.
triangle_validation.pngtriangle_mathoperations.pnghttps://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/question-types-guide/specialty-questions/heat-map/
https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/piped-text/math-operations/


https://community.qualtrics.com/XMcommunity/discussion/comment/44416#Comment_44416Thanks a lot this seems very likely to work. Is there a way to force a default click (just to show the marker in the middle of the triangle) without actually embedding a value? Just as a visual indicator for the user to drag (instead of click).


Hi badi, glad to hear it! While I think a default click can somehow be put in place with JavaScript, I am unfortunately not sure how to implement it for heat map questions.
Displaying a picture of a 'clicked' triangle to the respondents in a prior Text/Graphic question could work as a visual indicator. The respondent also will not be able to pass the Validation unless the triangle region is clicked, so including clear instructions in both the Question Text and the Validation Error Message text should put respondents on the right track.


https://community.qualtrics.com/XMcommunity/discussion/comment/44434#Comment_44434That makes sense! Thank you so much Tom!! Adding a prior clicked triangle along with clear instructions should do the job. Now the difficult part is to figure out how to convert the pixels coordinates into barycentric coordinates.


Leave a Reply