2017-06-12 53 views
1

谷歌最近增加了在谷歌Apps脚本编程允许谷歌Apps脚本在测验视图得分

var form = FormApp.create('Ice cream Quiz').setIsQuiz(true); 
form.set 
    // Make a 10 point question and set feedback on it 
    var item = form.addCheckboxItem(); 
    item.setTitle("What flavors are in neapolitan ice cream?"); 
    item.setPoints(10); 
    // chocolate, vanilla, and strawberry are the correct answers 
    item.setChoices([ 
    item.createChoice("chocolate", true), 
    item.createChoice("vanilla", true), 
    item.createChoice("rum raisin", false), 
    item.createChoice("strawberry", true), 
    item.createChoice("mint", false) 
    ]); 
    // If the respondent answers correctly, they'll see this feedback when they view 
    //scores. 
    var correctFeedback = FormApp.createFeedback() 
     .setText("You're an ice cream expert!") 
     .build(); 
    item.setFeedbackForCorrect(correctFeedback); 

    // If they respond incorrectly, they'll see this feedback with helpful links to 
    //read more about ice cream. 
    var incorrectFeedback = FormApp.createFeedback() 
     .setText("Sorry, wrong answer") 
     .addLink(
     "https://en.wikipedia.org/wiki/Neapolitan_ice_cream", 
     "Read more") 
     .build(); 
    item.setFeedbackForIncorrect(incorrectFeedback); 

编程测验我想测验的收件人自动查看自己的得分能力。我没有看到如何以编程方式做到这一点。而是我需要由龚成测验设置手动执行此操作,然后将释放等级为“提交后,立即”与投诉人可以看到“鬼问题”,“正确答案”,“点值”

是否有可能以编程方式设置这些?

回答

0

这个问题先前被问here(但我的答案尚未upvoted或接受,所以我不能将其标记为重复)。这是我建议的解决方法:

AFAIAA,目前没有办法直接使用Google Apps脚本方法执行此操作。

可能的解决方法是创建一个最小的Google表单,将其作为测验,并将其配置为“每次提交后立即”。不要在脚本中创建表单,只需复制此表单文件(使用脚本),然后继续以编程方式在副本中构建测验。

值得注意的是,Google Apps脚本中的这一遗漏可能会导致已完成测验中的错误。当使用脚本创建表单并使用.setIsQuiz(true)方法将其转化为测验时,“发布标记”设置默认为“稍后,手动审查后”。在“表单”设置用户界面中,此选项包含注释“打开电子邮件收藏” - 这样当手动发布结果时,会有一个电子邮件地址将结果发送到。使用上述步骤创建测验时,未启用电子邮件收藏。这意味着无法手动发布结果。上述解决方法缓解了这个问题。