本文介绍了选择选择代码自动前进不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Qualtrics提供了一些JavaScript,它声称在选择答案选项时会自动将参与者移至下一个调查问题。他们可以选择单一答案和多答案选择题,但我只需要前者进行我的调查。我把他们的代码放在正确的地方,但我无法使它工作。注意:我正在尝试进行移动兼容性调查(不仅兼容,而且非常适合移动应用)。 Qualtrics的代码不适用于移动设备或笔记本电脑。我不确定他们的代码是否不正确,或者我需要做其他事情才能正确实现它。



以下是自动提前单次应答多选Qualtrics提供的问题:

  var that = this; 
this.questionclick = function(event,element){
if(element.type =='radio'){
that.clickNextButton();


$ / code $ / pre

这里是自动前进MULTIPLE-Answer Multiple选择问题Qualtrics提供:

  var that = this; 
this.questionclick = function(event,element){
if(element.type =='checkbox'){
that.clickNextButton();
}
}

再一次,我只用前者作为我的调查,但我想我会包括这两个。我非常了解Java和C,但我从来没有学过JavaScript,所以我不确定它们如何与Qualtrics一起工作,以及这些代码是否正确,或者有什么我没有做的。



另外,如果有人有一个不在JavaScript中的解决方案(就像在CSS或HTML中有一个或者奇怪的东西),我会很感激其他选项。



在此先感谢!

解决方案

我真的不确定代码之前为什么不起作用,因为现在它工作得很好:

  Qualtrics.SurveyEngine.addOnload(function()
{
var that = this;
this.questionclick = function(event,element){
if(element.type =='radio'){
that.clickNextButton();
}
}


});

我猜这是Qualtrics的一部分错误,因为它与现在的代码完全相同工作。


Qualtrics provides some JavaScript that it claims will automatically move participants to the next survey question when they select an answer choice. They have options for single-answer and multiple-answer multiple choice questions, but I only need the former for my survey. I put their code in the correct place, but I can't get it to work. NOTE: I'm trying to make a mobile compatible survey (not just compatible, but very well made for mobile use). Qualtrics' code does not work on mobile devices or on my laptop. I'm not sure if their code is incorrect or if I have to do something else to implement it correctly.

Here's the code for Auto-Advance SINGLE-Answer Multiple Choice questions Qualtrics provides:

    var that = this;
    this.questionclick = function(event,element){
        if (element.type == 'radio')  {
           that.clickNextButton();
        }
    }

Here's the code for Auto-Advance MULTIPLE-Answer Multiple Choice questions Qualtrics provides:

    var that = this;
    this.questionclick = function(event,element){
        if (element.type == 'checkbox')  {
            that.clickNextButton();
        }
    }

Again, I'm only using the former for my survey, but I thought I'd include both anyway. I know Java and C fairly well but I've never learned JavaScript, so I'm not sure how these work with Qualtrics and if this code is correct or if there's something I'm not doing.

Also, if anyone has a solution that isn't in JavaScript (like if there's one in CSS or HTML or something weird) I would appreciate the other options.

Thanks in advance!

解决方案

I'm really not sure why the code did not work before, because now it works perfectly fine:

Qualtrics.SurveyEngine.addOnload(function()
{
    var that = this;
    this.questionclick = function(event,element){
        if (element.type == 'radio')  {
            that.clickNextButton();
        }
    }


});

I'm guessing it was some error on Qualtrics' part because it's the same exact code which is now working.

这篇关于选择选择代码自动前进不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 20:17