A react-based component that displays a drag-selectable matrix question on Qualtrics.
- A matrix question that users can select multiple answers at once by dragging the pointer.
- Can work with mobile devices (with some restrictions, please see below).
- In the survey edit screen, click "Look & Feel" on the top-left.
- Select the "General" tab and then edit the "Header".
- Click the "<>" icon to enter the coding view.
- Copy and paste the following code.
<script src="https://cdn.jsdelivr.net/gh/keita-makino/qualtrics-drag-matrix@0.3.1/dist/bundle.js"></script>
- The question type has to be set to "Matrix table" + "Likert" + "Allow multiple answers".
- Click the question text and click "Rich Content Editor...".
- Click the {A} button at the top-left and click "Survey Question".
- Search this question and click "Question Text".
- A code
${q://"Some ID"/QuestionText}
will be inserted so save the ID for later use. - Edit the text fields on the rows/columns as you need.
- Select the "JavaScript" option from the side menu or click </> icon next to the question text to enter the coding view.
- Copy and paste the code below.
- All done!
Qualtrics.SurveyEngine.addOnload(function () {
/*Place your JavaScript here to run when the page loads*/
});
Qualtrics.SurveyEngine.addOnReady(function () {
dragMatrixRender(
document.getElementById(
"The question ID, make sure the ID is surrounded by the double-quotation"
)
);
});
Qualtrics.SurveyEngine.addOnUnload(function () {
/*Place your JavaScript here to run when the page is unloaded*/
});
Due to the width limitation on mobile phones, it may not work if either
- You have many columns (basically at most 4 columns are recommended).
- You use a long text on the row/column text.