简体   繁体   English

我可以在 Qualtrics 调查中使用 javascript 捕获验证错误吗?

[英]Can I capture validation errors using javascript in a Qualtrics survey?

I have a Qualtrics survey that has six multiple choice questions on one page.我有一个 Qualtrics 调查,在一页上有六个选择题。 I have set up custom validation for each question so that after the respondent clicks the next button, a message comes up if an incorrect answer was entered.我已经为每个问题设置了自定义验证,以便在受访者单击下一步按钮后,如果输入了不正确的答案,则会出现一条消息。 I used the Qualtrics validation feature to do this.我使用了 Qualtrics 验证功能来做到这一点。

My question is: How can I record the number of incorrect responses the first (and any subsequent times) the next button is clicked?我的问题是:如何记录第一次(以及任何后续时间)下一个按钮被点击时的错误响应数量? Qualtrics does not offer an option for this, so I will need to use Javascript. Qualtrics 没有为此提供选项,因此我需要使用 Javascript。

To count the number of times the next button is clicked on a page, create a next button counter embedded variable that you increment each time the next button is clicked in an onPageSubmit function.要计算页面上单击下一个按钮的次数,请创建一个下一个按钮计数器嵌入变量,每次在 onPageSubmit 函数中单击下一个按钮时,该变量都会递增。

To count the number of incorrect responses, count the number of visible validation messages and save the count in an embedded variable in an addOnload function.要计算错误响应的数量,请计算可见验证消息的数量,并将该计数保存在 addOnload 函数的嵌入变量中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM