我正在尝试为我的Google表单添加额外的内容,即。当用户点击提交时,我想将他引导到另一个页面,但只有当他在线性比例答案上选择多于4时。
提前谢谢!
这是我的代码:
var form = FormApp.openById('1PXav2ChPZjYU0qEuKCE_fabv6B4jyPAF5VeGZfz3PYg');
var formResponses = form.getResponses();
for (var i = 0; i < formResponses.length; i++) {
var formResponse = formResponses[i];
var itemResponses = formResponse.getItemResponses();
for (var j = 0; j < itemResponses.length; j++) {
var itemResponse = itemResponses[j];
}
}
if(itemResponses[0].getResponse() >= 4){
Logger.log('more then 4')
window.open('https://www.google.pl') //here it'd direct user to different page
}else{
Logger.log('less then 4')
}