const QUIZ_FOLDER_ID = 'YOUR_FOLDER_ID'
function myFunction() {
addFormItems()
}
function addFormItems() {
const formTitle = 'TestQuiz';
const form = FormApp.create(formTitle).setIsQuiz(true)
//const item = FormApp.openById(form.getId()).addMultipleChoiceItem()
const item = form.addMultipleChoiceItem()
item
.setTitle('1+4')
.setChoices([
item.createChoice('1', false),
item.createChoice('3', false),
item.createChoice('5', true),
item.createChoice('2', false),
]).setPoints(10).setRequired(true)
const formFile = DriveApp.getFileById(form.getId())
DriveApp.getFolderById(QUIZ_FOLDER_ID).addFile(formFile)
}
Created
September 9, 2020 06:08
-
-
Save nrm176/41df4f1c45e16a45522e1c783e3a471e to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment