[英]How to get slider value in qualtrics survey using javascript?
In Qualtrics, I am trying to get the slider value of the response when the next button is clicked using javascript. 在Qualtrics中,我尝试使用javascript单击下一个按钮时获取响应的滑块值。 I have tried many proposed solutions including everything in this question.
我尝试了许多建议的解决方案,包括此问题中的所有内容。 But none of them worked.
但是他们都不起作用。
Update: I also tried the following, did not work: 更新:我也尝试了以下方法,但是没有用:
Qualtrics.SurveyEngine.addOnload(function()
{
var q = this.getQuestionInfo();
$('NextButton').onclick =function(event,element)
{
alert("${q://1_QID1/ChoiceNumericEntryValue/1}");
alert(this. questionId+","+q.QuestionID);
var p = "q://"+q.QuestionID+"/ChoiceNumericEntryValue/1";
var v = "${p}";
alert(v);
}
});
Since you don't need the slider value until after the Next Button is clicked, you don't need any JavaScript. 由于在单击“下一步”按钮之后才需要滑块值,因此不需要任何JavaScript。 You can just pipe the answer where you need it (another question, the survey flow, a JavaScript, etc.).
您可以仅在需要的地方使用答案(另一个问题,调查流程,JavaScript等)。 To get the piped string, just click on the question text to any question, then select Piped Text/Survey Question/the question/the loop/the choice.
要获取管道字符串,只需在任何问题上单击问题文本,然后选择管道文本/调查问题/问题/循环/选择。 The pipe string will look like ${q://1_QID1/ChoiceNumericEntryValue/1} where 1_ is the loop number, QID1 is the question id, and /1 is the choice.
管道字符串看起来像$ {q:// 1_QID1 / ChoiceNumericEntryValue / 1},其中1_是循环号,QID1是问题ID,/ 1是选择。
我知道这已经很晚了,但是我正在搜索相同的问题,并且通过对他人调查的深入研究,发现以下代码段有效,并将其复制到HTML视图的问题文本中(您替换了QID29以及您的问题是什么QIDxx)(“ value =“””是这样的,在响应者移动滑块上的句柄之前,显示滑块值的文本框为空;可以将其设置为value =“ x”,其中x是您想要的值,例如,滑块上的默认值):
<input class="SumInput InputText QID29 QWatchTimer" data-runtime- value="runtime.Choices.1.Value" id="QID29" name="QID29" type="text" value="">
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.