【问题标题】:Programmatically allow View Score in Quiz in Google Apps Scripts以编程方式允许在 Google Apps 脚本中的测验中查看分数
【发布时间】:2018-02-28 20:20:41
【问题描述】:

Google 最近添加了在 Google Apps 脚本中编写测验的功能

var form = FormApp.create('Ice cream Quiz').setIsQuiz(true);
form.set
  // Make a 10 point question and set feedback on it
  var item = form.addCheckboxItem();
  item.setTitle("What flavors are in neapolitan ice cream?");
  item.setPoints(10);
  // chocolate, vanilla, and strawberry are the correct answers
  item.setChoices([
    item.createChoice("chocolate", true),
    item.createChoice("vanilla", true),
    item.createChoice("rum raisin", false),
    item.createChoice("strawberry", true),
    item.createChoice("mint", false)
  ]);
  // If the respondent answers correctly, they'll see this feedback when they view 
  //scores.
  var correctFeedback = FormApp.createFeedback()
      .setText("You're an ice cream expert!")
      .build();
  item.setFeedbackForCorrect(correctFeedback);

  // If they respond incorrectly, they'll see this feedback with helpful links to 
  //read more about ice cream.
  var incorrectFeedback = FormApp.createFeedback()
      .setText("Sorry, wrong answer")
      .addLink(
        "https://en.wikipedia.org/wiki/Neapolitan_ice_cream",
        "Read more")
      .build();
  item.setFeedbackForIncorrect(incorrectFeedback);

我希望测验的收件人自动查看他们自己的分数。我看不到如何以编程方式执行此操作。相反,我需要通过进入测验设置手动执行此操作,然后将发布等级设置为“提交后立即”,并且受访者可以看到“错过的问题”、“正确答案”、“点值”

是否可以通过编程方式设置这些?

【问题讨论】:

    标签: google-apps-script google-forms google-form-quiz


    【解决方案1】:

    之前有人问过这个问题here(但我的回答尚未被投票或接受,因此我无法将其标记为重复)。这是我建议的解决方法:

    AFAIAA,目前无法直接使用 Google Apps 脚本方法执行此操作。

    一种可能的解决方法是创建一个最小的 Google 表单,将其作为测验,并将其配置为“每次提交后立即”。无需在脚本中创建表单,只需复制此表单文件(使用您的脚本)并继续在副本中以编程方式构建您的测验。

    值得注意的是,Google Apps 脚本中的这一遗漏可能会导致已完成的测验出现错误。当使用脚本创建表单并使用 .setIsQuiz(true) 方法将其转换为测验时,“发布标记”设置默认为“稍后,人工审核后”。在表单设置用户界面中,此选项包括注释“打开电子邮件收集” - 这样当手动发布结果时,就有一个电子邮件地址可以将结果发送到。使用上述步骤创建测验时,电子邮件收集未启用。这意味着无法手动发布结果。上述解决方法可以缓解此问题。

    【讨论】:

      猜你喜欢
      • 2021-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-28
      • 2021-09-24
      • 1970-01-01
      相关资源
      最近更新 更多