记录完成Google表单所需的时间 [英] Record Time taken to complete a google form

查看:166
本文介绍了记录完成Google表单所需的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试记录完成和提交Google表单所花费的总时间. 我的逻辑很简单,以下代码将记录时间戳并将其作为多选选项. 然后,提交表单后,无论如何我们都会获得一个时间戳记,但与此同时,我们将获得最初记录的时间戳记作为对该问题的答案.

I am trying to record the total time taken to complete and submit a Google form. My logic is simple that the following code would record and put the timestamp as a multiple choice option. Then upon submitting the form, we get a time stamp anyway but along with that, we would get the initially recorded timestamp as an answer to that question.

这是我可爱的小代码:

function initial() {
  var form = FormApp.getActiveForm();
  form.getItemById(1589920082).asMultipleChoiceItem().setChoiceValues([new Date()]);
}

我将触发器设置为OnOpen,但是令人惊讶的是,它不会在每次打开表单时更新时间戳.从理论上讲,它应该记录打开表单的时间,但是我想我在这里丢失了一些东西.

I have set the trigger as OnOpen but surprisingly, it does not renew the timestamp every time I open the form. Theoretically, it should record the time when the form was open but I think I am missing something here.

另一方面,如果将触发器更改为OnSubmit,则每次我提交表单时,它将开始记录新的时间戳.但是我不希望那样,因为无论如何我们都会获得提交时间戳.我要记录的是表单打开的时间.

On the other hand, if I change the trigger to OnSubmit, it starts recording fresh timestamps every time I submit the form. But I don't want that as we get submission timestamps anyway. What I am trying to record is the time the form was open.

推荐答案

我知道这个问题是一年前提出的,但这是我刚想出的解决方法.

I know this question was asked a year ago, but here is a workaround I just came up with.

有2种形式!第一种形式可以是免责声明,说明等.第二种形式是您希望用户填写的原始形式.开启这两种电子邮件收集功能,这样您就可以知道哪个用户提交了测试.

Have 2 forms! The first form can be a disclaimer, instructions, etc. The second form is the original form you intended for the users to fill out. Turn on email collection for both, so you can know which user submitted the test.

获取共享链接,并在第一个表单的设置中将该链接添加到确认消息中:

Get the sharing link and in the settings of the first form add the link in the confirmation message:

然后将两个表单链接到电子表格中,您将看到每个提交的时间戳.从那里,您可以轻松地进行计算以确定持续时间.

Then link both forms into a spreadsheet and you will see the time stamp of each submissions. From there you can easily do a calculation to determine the duration.

这篇关于记录完成Google表单所需的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆