It is straigt forward to include the answer keys for a multiple choice question , as evident from following code.
var item = Form.addCheckBoxItem();
item.setTitle("What is 1 + 2?");
item.setChoices([item.createChoice("1", false),
item.CreateChoice("2",false),
item.CreateChoice("3",true)
I am looking a similar function for text item questions. something similar
var textitem = Form.addTextITem()
item.setTitle("What is the capital of Japan?")
item.setAnswer("tokyo") // looking for something similar
I am aware that I can create an add-on , that dynamically check the submitted response against the answer-keys stored in a spreadsheet . But is there any simple way to hard code the answers for the text questions in the form itself?