3

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?

Siva-Sg
  • 2,741
  • 19
  • 27

1 Answers1

1

EDIT - Sorry I completely misread your question. No, it is not possible to have automatic grading for short answer or paragraph type questions.

It is possible, as you said, to use an add-on like Flubaroo to grade text questions but if you have tried this you will quickly realise how many answer variations people can give for even a 1 word answer!

I did this before and ended up manually grading the answers anyway, things like capitalisation, white spaces before and after the word etc, etc, etc all need to be taken into account.

var textitem = Form.addTextITem()
    item.setTitle("What is the capital of Japan?")
    item.setAnswer("tokyo")

Take your own example, if you sent the answer as tokyo then Tokyo would be considered incorrect when it is actually correct and tokyo could be correct too if you're not marking on the spelling.

James D
  • 3,102
  • 1
  • 11
  • 21
  • How about grading ? Does the form automatically grade the response based on pre-filed answer link? – Siva-Sg Apr 04 '18 at 10:25
  • Please see my revised answer! – James D Apr 04 '18 at 12:25
  • 1
    Hmm... Handling white spaces and capitalization within app script is still easier than having to manually grade the responses, I think. Adding the answer key for text questions is enabled in the form builder. Only it is not available in the app script as a method. – Siva-Sg Apr 04 '18 at 13:18