How to set the answer key for a Forms Griditem using Google Apps Script?

Viewed 28

I'm writing a Google Apps Script to use data stored in a spreadsheet of multiple-choice question data to a Google Form Quiz, using a Griditem (Multiple-choice grid).

The questions are stored in questionList and answers in answerList.

// Create a MC Grid
var mcGrid = form.addGridItem()
  .setTitle('Your answer to MC Questions:')
  .setRequired(true)
  .setRows(questionList)
  .setColumns(['A','B','C','D','no idea, need help!']);

I'm able to create the form, but I'm having trouble setting the answer key to the Griditem. I can't find a method like setChoices (from MultipleChoiceItem) for these Griditem from the documentations.

Does anybody know how to do this?

Thank you!

0 Answers
Related