I want to add a math question that requires the subject to answer in proportions, so I want to add something like ___ out of ___ or similar to this, anyone knows how can I do it?
Page 1 / 1
There’s no defined question type for this.
What you can do is to create a form question with two fields which you can then move to the question HTML.
Example:
Question HTML:
<div><span class="dest" id="v1"></span> out of <span class="dest" id="v2"></span></div>
Question JS:
Qualtrics.SurveyEngine.addOnReady(function () {
const quest = this;
const qc = quest.getQuestionContainer();
const sources = qc.querySelectorAll(".InputText");
const destinations = qc.querySelectorAll(".dest");
destinations.forEach((dest, index) => {
const src = sourcescindex];
dest.insertAdjacentElement("afterbegin", src);
// To enforce only numbers
src.type = "number";
});
});
You can style the text boxes by using the selector .dest .InputText
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.