【问题标题】:Auto submit Google Form via google Forms API and Google App scripts通过 google Forms API 和 Google App 脚本自动提交 Google Form
【发布时间】:2020-05-24 16:06:32
【问题描述】:

我希望用户通过第三方应用回答 Google 表单测验。我想设置一个计时器来测验并在超过时间限制后自动提交 Google 表单。有没有办法通过使用 Google Forms API 和 Google App 脚本来做?

【问题讨论】:

标签: javascript django google-apps-script google-forms


【解决方案1】:

有一种方法可以在不涉及 Google 表单的情况下实现这一目标。 Google 不允许修改表单本身(在撰写本文时)。 由于我们可以在 Google 表格中分析结果,因此您可以尝试将提交的内容从第三方应用填充到表格中。

  1. 创建绑定 Google 表格的应用脚本
  2. 使用doGet()doPost() 使应用脚本成为Web 应用
  3. 创建一个脚本函数,以便在将数据接收到 Web 应用端点时将一行附加到工作表。

有一个SpreadsheetApp.getActiveSpreadsheet().getSheetByName('quiz').appendRow()方法

参考Google App Script Docs

【讨论】:

    【解决方案2】:

    在另一种方法中,使用 Google 表单,可以设置一个简单的 JavaScript,如下所示(定时器设置为 1 分钟):

    <script>
    setTimeout(function(){
    formFacade.submit(document.forms[0], 'root');
    }, 30*60*1000);
    </script>

    我已经使用 Google 表单设置了一个示例自动提交测验,并使用 Formfacade 插件将其转换为 HTML 表单。我添加了这个脚本并在这里设置了 15 秒。你可以在这里试试: https://sites.google.com/view/autoquiz/home

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-11-04
      • 1970-01-01
      • 2023-03-14
      • 1970-01-01
      • 2014-03-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多