[英]Restrict Google Forms Responses in QuestionGrid
因此,我對Google Scripting相當陌生,但是我目前正在從事一個項目,利用它來創建表單。 它使用為表格中涉及的每個人自動生成的QuestionGrid。 每個4個問題可能有3個答案。 每個問題的選項是-1、0或1。我想要一種方法來限制每個成員在回答每個人的某個問題時可以給出多少個-1和1。 我的想法是,我可以通過某種方式檢查它們給出的響應,並跟蹤兩個變量中-1和1的數量。 如果變量超過我設置的數量,則會引發錯誤。
這是我能最好地解釋我的問題,但為了更加清楚起見,我提供了一個代碼片段和一個問題網格格式的圖片。 如果仍然不清楚,請告訴我。
感謝您提供的任何幫助!
代碼段:
function makeEvals(){
var form = FormApp.create('Winter 2016 Evals');
form.collectsEmail();
form.setCollectEmail(true);
var names = ['Person1','Person2','Person3','Person4'];
for(var i = 0; i<names.length; i++){
var questionGrid = form.addGridItem();
questionGrid.setTitle(names[i]);
questionGrid.setRows(['This person is actively engaged with floor','This person actively contributes time and energy to benefit House',
'This person reflects floor in a professional manner','This person is an overall good member of floor']);
questionGrid.setColumns(['-1 (Does not meet expectations)','0 (Meets expectations)','1 (Exceeds expectations)']);
questionGrid.setRequired(true);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.