Enum PageNavigationType

頁面導覽類型

列舉代表支援的網頁導覽類型。您可以透過 FormApp.PageNavigationType 存取頁面導覽類型。

只有在受訪者選擇該選項時,系統才會在受訪者完成含有該選項的頁面後,進行頁面導覽。如果受訪者在同一頁面上選擇多個選項,且有頁面導覽操作說明,則只有最後一個導覽選項會生效。頁面導覽對表單的最後一個頁面也沒有任何影響。

使用頁面導覽的選項,無法與不使用頁面導覽的選項,在同一項中合併使用。

如要呼叫列舉,請呼叫其父項類別、名稱和屬性。例如 FormApp.PageNavigationType.CONTINUE

// Create a form and add a new multiple-choice item and a page-break item.
const form = FormApp.create('Form Name');
const item = form.addMultipleChoiceItem();
const pageBreak = form.addPageBreakItem();

// Set some choices with go-to-page logic.
const rightChoice = item.createChoice(
    'Vanilla',
    FormApp.PageNavigationType.SUBMIT,
);
const wrongChoice = item.createChoice(
    'Chocolate',
    FormApp.PageNavigationType.RESTART,
);

// For GO_TO_PAGE, just pass in the page break item. For CONTINUE (normally the
// default), pass in CONTINUE explicitly because page navigation cannot be mixed
// with non-navigation choices.
const iffyChoice = item.createChoice('Peanut', pageBreak);
const otherChoice = item.createChoice(
    'Strawberry',
    FormApp.PageNavigationType.CONTINUE,
);
item.setChoices([rightChoice, wrongChoice, iffyChoice, otherChoice]);

屬性

屬性類型說明
CONTINUEEnum填寫完目前的頁面後,請繼續填寫表單的下一頁。
GO_TO_PAGEEnum在完成目前頁面後,跳至表單的指定頁面。
RESTARTEnum在完成目前頁面後,從一開始重新開始填寫表單,但不要清除先前輸入的答案。
SUBMITEnum填妥目前頁面後,提交表單回覆。