一個問題項目,可讓作答者從編號的圓形按鈕序列中選擇其中一個選項。您可以透過 Form
存取或建立項目。在測驗中使用時,這些項目會評分。
// Open a form by ID and add a new scale item. var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); var item = form.addScaleItem(); item.setTitle('Pick a number between 1 and 10') .setBounds(1, 10);
方法
內容詳盡的說明文件
createResponse(response)
針對這個擴充項目建立新的 ItemResponse
。如果 response
引數不在該項目設定的邊界內,就會擲回例外狀況。
參數
名稱 | 類型 | 說明 |
---|---|---|
response | Integer | 這個量表的值解答 |
Return 鍵
ItemResponse
:項目回應
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
duplicate()
getGeneralFeedback()
傳回作答者在可評分成績時看到的回應。
Return 鍵
QuizFeedback
:意見回饋 (如果有的話)。
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getHelpText()
取得商品的說明文字 (有時為版面配置項目的說明文字,例如 ImageItems
、PageBreakItems
和 SectionHeaderItems
)。
Return 鍵
String
:項目的說明文字或說明文字
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getId()
取得商品的專屬 ID。
Return 鍵
Integer
:該項目的 ID
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getIndex()
取得表單中所有商品的索引。
Return 鍵
Integer
:項目的索引
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getLeftLabel()
取得比例下限標籤 (如果有的話)。
Return 鍵
String
:縮放比例標籤的下限
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getLowerBound()
取得比例範圍的下限。
Return 鍵
Integer
— 量表的下限
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getPoints()
傳回可評分項目的分數值。
Return 鍵
Integer
:每個問題的相關價值。
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getRightLabel()
取得縮放比例上限標籤 (如果有的話)。
Return 鍵
String
:縮放比例上限的標籤
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getTitle()
取得商品標題 (有時為 SectionHeaderItem
標頭)。
Return 鍵
String
:項目的標題或標題文字
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
getType()
getUpperBound()
取得體重計的上限。
Return 鍵
Integer
:縮放比例上限
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
isRequired()
判斷作答者是否需要回答問題。
Return 鍵
Boolean
— 作答者必須回答問題
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setBounds(lower, upper)
setGeneralFeedback(feedback)
讓作答者在沒有正確答案或正確答案 (例如需要手動評分的問題) 的情況下,針對作答者顯示意見回饋。
參數
名稱 | 類型 | 說明 |
---|---|---|
feedback | QuizFeedback | 新的意見回饋 |
Return 鍵
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setHelpText(text)
設定項目的說明文字 (有時是指 ImageItems
、PageBreakItems
和 SectionHeaderItems
等版面配置項目的說明文字)。
參數
名稱 | 類型 | 說明 |
---|---|---|
text | String | 新的說明文字 |
Return 鍵
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms
setLabels(lower, upper)
setPoints(points)
setRequired(enabled)
setTitle(title)
設定項目標題 (有時在 SectionHeaderItem
中稱為標題文字)。
參數
名稱 | 類型 | 說明 |
---|---|---|
title | String | 新的標題或標題文字 |
Return 鍵
授權
如果指令碼使用這個方法,就必須符合下列一或多個範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly
-
https://www.googleapis.com/auth/forms