使用Google Apps脚本在Google表单中的多选项目中插入图片 [英] Insert image in multiplechoiceitem in Google Forms with Google Apps Script

查看:84
本文介绍了使用Google Apps脚本在Google表单中的多选项目中插入图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I need to insert a Google Drive image in each choice of the multiple choice item. Upon checking the documentation, the Class .addMultipleChoiceItem() doesn't support the method .setImage(). Is there another way to insert an image from 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')
]);

推荐答案

基于此功能请求提交.

Based from this link, you can add image for multiple choice using the Google Form UI. But in the Apps Script, you can only add text. This is also filed as a feature request.

这篇关于使用Google Apps脚本在Google表单中的多选项目中插入图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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