问题
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