I am wanting to set the value of a Answer Key to a specific quiz item using google app scripts. Looking through the docs, I could not find what I was looking for.
I can programmatically generate random questions, but need to now programmatically set the answer using a google forms- quiz.
function onOpen(e) {
var form = FormApp.getActiveForm();
var items = form.getItems();
for (var i in items) {
Logger.log(items[i].getTitle() + ': ' + items[i].getId());
}
var force1 = 10 + (Math.round(Math.random()*10));
var distance1 = 10 + (Math.round(Math.random()*10));
items[1].setTitle(' (W1) Given a force of ' + force1 + ', and a displacement of ' + distance1 + '. What is the value of Work?');
//Generate correct answer by quiz item variables
//Set correct answer to quiz item 1
//When the student clicks submit, the quiz is graded on the correct answers generated and set by the google app scripts.
}