Designing a Google Form to not accept responses for some hours everyday

我怕爱的太早我们不能终老 提交于 2021-02-05 12:27:06

问题


I want a Google Form for online attendance during the time from 10:15 AM to 14:30 PM, from Sunday to Friday. Google Form has an option "Stop Accepting Responses" which should be done manually every time. But it would be better if the same thing could be done automatically. I did some research on this. I didn't find any until I came across one, with similar situations but it too had no verified solution and everything looked gibberish.

My thought:

Extract the time the form was opened. If the opened time isn't between 10:15 AM and 14:30 PM, direct the user to empty page with header saying "Attendance Form closed". This could be one possible way but no idea where to start.


回答1:


It can be done automatically through setAcceptingResponses():

const openForm = () => FormApp.getActive().setAcceptingResponses(true);
const closeForm = () => FormApp.getActive().setAcceptingResponses(false);

Configure each function to run based on appropriate time triggers



来源:https://stackoverflow.com/questions/63850274/designing-a-google-form-to-not-accept-responses-for-some-hours-everyday

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!