1

I want to get the image url which is inserted when create a question into the classroom form.

Below is the code through we get the title , choices if available but i am not able to get the image url which is insert under the question title.

function getCourse() {
  var form = FormApp.openById(id);
  var formResponses = form.getItems();
  var type=formResponses[0].getType();
  var title = formResponses[0].getTitle();
  var image =formResponses[0].getImage();//no such method Logger.log(image);
}
Cooper
  • 59,616
  • 6
  • 23
  • 54

2 Answers2

0

That image is not available through the Forms Service, it's added through the /viewresponse source code which is generated some way by Google. You could get it by using the URL Fetch Service (UrlFetchApp).

Related

Rubén
  • 34,714
  • 9
  • 70
  • 166
0

var blob = questionType.getImage();
var b64 = blob.getContentType() + ';base64,'+ Utilities.base64Encode(blob.getBytes()); var html = "data:" + b64 ;