Apps Scriptリファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2025年5月8日木曜日

Google Formsで時刻の質問を作りたい


今回は「時刻」の質問について書いていきます


フォームの編集画面

質問の種類で「時刻」を選択します



入力項目に値を入力します




フォームの回答画面

時刻の入力欄が表示されます





Apps Script で作成する場合

以下の Code.gs で formName, description, title, helpText の値を書き換えて

createTimeQuestion() を実行すると

編集用のURLがログに出力されます



Code.gs
function createTimeQuestion() {
const formName = 'Motivation Survey';
const description = 'Please answer the following question.';
const title = 'What time do you usually start your self-motivated activity?';
const helpText = 'Please enter the time';

const form = FormApp.create(formName);
form.setDescription(description);
form.addTimeItem()
.setTitle(title)
.setHelpText(helpText)
.setRequired(false);
form.setPublished(false);
Logger.log('Form Edit URL: ' + form.getEditUrl());
}


Reference

addTimeItem() 



Latest post

Google Formsでクイズを作りたい

Googleフォームには回答を判定するクイズモードがあります 今回はそのクイズモードで回答の判定とフィードバックについて書いていきます 「クイズモード」の表記: 日本語の表記は「テストにする」ですが 英語の表記は「Make this a quiz」となっています この記事ではでは...