問題項目,可讓受訪者從編號的圓形按鈕序列中選擇一個選項。您可以透過 Form 存取或建立項目。在測驗中使用這些項目時,系統會評分。
// Open a form by ID and add a new scale item. const form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); const item = form.addScaleItem(); item.setTitle('Pick a number between 1 and 10').setBounds(1, 10);
方法
內容詳盡的說明文件
create Response(response)
為這個比例項目建立新的 Item。如果 response 引數超出項目設定的界限,就會擲回例外狀況。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
response | Integer | 這個評量項目的值答案 |
回攻員
Item - 項目回應
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
duplicate()
get General Feedback()
傳回受訪者回答可評分問題時看到的意見回饋。
回攻員
Quiz:意見回饋 (如有)。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Help Text()
取得項目的說明文字 (有時稱為版面配置項目的說明文字,例如 Image、Page 和 Section)。
回攻員
String:項目的說明文字
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Id()
取得項目的專屬 ID。
回攻員
Integer:商品的 ID
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Index()
取得表單中所有項目中的項目索引。
回攻員
Integer:項目的索引
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Left Label()
取得比例下限的標籤 (如有)。
回攻員
String:比例下限的標籤
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Lower Bound()
取得比例的下限。
回攻員
Integer:比例尺的下限
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Points()
傳回可評分項目的點數值。
回攻員
Integer:問題的分數。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Right Label()
取得刻度上限的標籤 (如有)。
回攻員
String:比例上限的標籤
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Title()
取得項目的標題 (如果是 Section,有時稱為標頭文字)。
回攻員
String:項目的標題或標頭文字
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
get Type()
get Upper Bound()
取得比例尺的上限。
回攻員
Integer:範圍上限
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
is Required()
決定受訪者是否必須回答問題。
回攻員
Boolean - 受訪者是否必須回答問題
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Bounds(lower, upper)
設定比例的上下界限。下限必須是 0 或 1。上限必須介於 3 至 10 之間 (含首尾)。新刻度的預設下限為 1,上限為 5。
如果指定值超出允許範圍,系統會擲回指令碼例外狀況。小數會截斷為前一個整數。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
lower | Integer | 新的下限 |
upper | Integer | 新的上限 |
回攻員
Scale - this Scale,用於鏈結
擲回
Error:如果下限或上限無效
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set General Feedback(feedback)
設定作答者回答沒有正確或錯誤答案的評分問題時,系統顯示的意見回饋 (即需要手動評分的問題)。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
feedback | Quiz | 新的意見回饋 |
回攻員
Scale - this Scale,用於鏈結
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Help Text(text)
設定項目的說明文字 (有時稱為版面配置項目的說明文字,例如 Image、Page 和 Section)。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
text | String | 新的說明文字 |
回攻員
Scale - this Scale,用於鏈結
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms
set Labels(lower, upper)
set Points(points)
set Required(enabled)
set Title(title)
設定項目的標題 (如果是 Section,有時也稱為標題文字)。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
title | String | 新標題或標頭文字 |
回攻員
Scale - this Scale,用於鏈結
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/forms.currentonly -
https://www.googleapis.com/auth/forms