【问题标题】:How do you insert newlines and hyperlinks into Google Forms question help text?如何在 Google 表单问题帮助文本中插入换行符和超链接?
【发布时间】:2020-02-24 21:32:49
【问题描述】:

我需要能够使用 Google 应用脚本将超链接和换行符插入到我的 Google 表单的帮助文本中。两者都不可能。

对于我尝试过的链接(无效):

  • http://link.com/path
  • <a href='http://link.com/path'>http://link.com/path</a>

对于我尝试过的换行符(无效):

  • \n
  • \\n
  • \n

我的代码如下:

function createForm() {
  var form = FormApp.create('Amazon Open Source Project Classification');

  form.setDescription("This form is for labeling open source projects using the project url and description with the following 4 categories:\n\n1) \
API - this is an API library that can only be used to access an Amazon Web Services (AWS) API\n2) EDUCATION - this is an educational project or example \
of how to use an AWS API\n3) GENERAL - this is a general purpose open source project with utility for the public\n4) DATASET - this is a dataset \
published by researchers as part of their researchz\n") 

  form.addMultipleChoiceItem()
    .setTitle("What category does the project fall under?")
    .setHelpText("<a href='http://github.com/alexa/alexa-skills-kit-sdk-for-nodejs'>http://github.com/alexa/alexa-skills-kit-sdk-for-nodejs</a>\n\nThe Alexa Skills Kit SDK for Node.js helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.")
    .setChoiceValues(['API','EDUCATION', 'GENERAL', 'DATASET'])

  Logger.log('Published URL: ' + form.getPublishedUrl());
  Logger.log('Editor URL: ' + form.getEditUrl());
}

【问题讨论】:

  • 手动可以吗?

标签: google-apps-script hyperlink newline google-apps google-forms


【解决方案1】:

无法在该字段中设置超链接,因为方法 setHelpText 需要字符串参数,并且表单 UI 不会将其解释为 HTML。

但是,您可以使用组件 Public Trackers &gt; G Suite Developers &gt; Apps Script 向 Google 的问题跟踪器 here 提交功能请求(因为这将用于应用程序脚本 FormApp Class)。

【讨论】:

    猜你喜欢
    • 2011-04-20
    • 2016-05-29
    • 2013-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多