简体   繁体   English

如何使用JavaScript在定性测量中获取滑块值?

[英]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.

相关问题 如何获取Qualtrics上的滑块值? - How to get slider's value on Qualtrics? Qualtrics Javascript:获取所有回复和调查文本 - Qualtrics Javascript: Get all responses and survey text 如何使用Javascript获得Qualtrics拖放选择的价值 - How to get value of Qualtrics Drag & Drop Choice using Javascript 在 Qualtrics 调查中使用 Javascript 日期选择器 - 将日期传送到调查字段 - Using a Javascript Date Selector in Qualtrics survey - carry date to the survey field 我可以在 Qualtrics 调查中使用 javascript 捕获验证错误吗? - Can I capture validation errors using javascript in a Qualtrics survey? Qualtrics:使用 javascript 嵌入数据的自定义 slider 范围 - Qualtrics: Custom slider range with embedded data using javascript 在Qualtrics调查的滑块中将百分比符号添加到索引之前? - Adding the percentage symbol before the index in a slider block in a Qualtrics survey? 您如何将相同的 javascript 代码应用于 Qualtrics 调查中的多个问题? - How do you apply the same javascript code to multiple questions in Qualtrics survey? Qualtrics | 保存调查期间通过JavaScript生成的图片 - Qualtrics | Save Pictures that are generated via JavaScript during the Survey Qualtrics:将问题导入到新调查中时,自定义JavaScript停止工作 - Qualtrics: Custom JavaScript ceases to work when importing questions to a new survey
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM