google-apps-script - 使用 Google Apps 脚本在 Google 表单中的多项选择项中插入图像

标签 google-apps-script google-forms

我需要在多项选择项的每个选项中插入一个 Google Drive 图像。检查文档后,类 .addMultipleChoiceItem() 不支持方法 .setImage() 。还有另一种方法可以从 Google Drive 插入图片吗?

例子:

var form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');
var item = form.addListItem();
item.setTitle('Do you prefer cats or dogs?')
.setChoices([
    item.createChoice('Cats'), <------ I need to insert an imagen of a cat 
in this choice with code.
    item.createChoice('Dogs')
]);

最佳答案

基于此 link ,您可以使用 Google 表单用户界面为多项选择添加图像。但在 Apps 脚本中,您只能添加文本。这也被归档为 feature request .

关于google-apps-script - 使用 Google Apps 脚本在 Google 表单中的多项选择项中插入图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49022122/

相关文章:

google-apps-script - "Service Spreadsheets failed"调用insertCells方法时出错

javascript - 有没有办法将基于 Javascript 的签名板添加到 Google 表单以捕获响应者的签名?

javascript - 使用 Google Script 在 Google Forms 中提交时获取地理位置

google-apps-script - 如果存在文本,则为相邻单元格设置公式

google-apps-script - Google Apps 脚本 - 将数据提取到带有参数的模板中

google-apps-script - Utilities.formatDate 显示错误的日期 - 日期格式不正确

google-apps-script - Google Drive API 上传到父文件夹

google-apps-script - 提交 Google 表单后显示自定义消息

google-apps-script - 如何向谷歌表单添加简单的计算字段?

google-apps-script - Google Script - 如何使用 unzip