【发布时间】:2018-07-20 18:49:54
【问题描述】:
我让 Qualtrics 使用 setChoiceValueByRecode Javascript 从嵌入式数据字段自动填充问题选择。对于单选和多选多项选择题,我已经能够成功地做到这一点,但对于 matrix 问题却无法解决。
这是一个使用 ( recodeValue [subID] value ) 在选择题中有效的示例,没有 subID,因为选择题不需要它:
Qualtrics.SurveyEngine.addOnload(function()
{
var answer = "${e://Field/DEMOGRAPHICs_Gender}";
var that = this;
switch(answer){
case "Male":
that.setChoiceValueByRecodeValue(1, true);
break;
case "Female":
that.setChoiceValueByRecodeValue(2, true);
break;
case "Non-binary":
that.setChoiceValueByRecodeValue(3, true);
break;
case "Prefer not to answer":
that.setChoiceValueByRecodeValue(4, true);
break;
default:
break;
}
});
围绕此的documentation from Qualtrics 表明,对于矩阵,我需要指定一个 [subID] 来告知要引用矩阵的哪一行,但 我无法弄清楚这个 [subID] 是什么或在哪里找到它。
例如对于this question...我尝试使用“Amazon”作为子ID,但没有成功。有任何想法吗?
【问题讨论】:
标签: javascript qualtrics