我必须激活属性才能改变多选类型questoin的问题,但找不到属性.我发现这段代码随机分配了问题,但没有给出答案.
I have to activate the properties to shuffle the question of a multiple choice type questoin, but I can't find the properties. I found this code that randomizes questions, but not the answers.
form.setShuffleQuestions(true);视觉组件的图像
推荐答案问题跟踪程序:
目前无法实现.考虑在以下功能请求中添加一个星号(在左上方),以供Google优先考虑该问题:
Issuetracker:
This isn't currently possible. Consider adding a star (on top left) to the following feature requests for Google to prioritize the issue:
-
issuetracker.google/issues/36764938
issuetracker.google/issues/64134484
在此答案中已经提到的 的部分解决方法是改组数组创建选项并使用 setChoiceValues().这种服务器端随机化的缺点是
Partial Workaround as already mentioned in this answer is to shuffle the array creating options and setback the array using setChoiceValues(). The drawback of such server side randomizing is
-
只能在运行服务器脚本时执行,而不能在客户端打开表单时执行
It can only be done whenever the server script runs and not when client opens the form
即使您每分钟随机进行一次,也可能同时打开表格的用户会看到相同顺序的选项
Even if you randomize each minute, it is possible that users opening the form simultaneously will see the same order of options
const form = FormApp.openById('/*form id*/'); const item = form.addMultipleChoiceItem(); item.setTitle('Car or truck?'); const options = ['Truck', 'Car']; //Durstenfeld algo for (let i = options.length - 1; i > 0; i--) { let rand = Math.floor(Math.random() * i); [options[i], options[rand]] = [options[rand], options[i]]; } item.setChoiceValues(options);更多推荐
随机播放答案属性
发布评论