AI-generated Key Takeaways
-
QuizFeedbackBuilder is used to create custom feedback for quiz responses in Google Forms.
-
It allows you to set feedback text, add links to supplemental material, and build a Feedback object.
-
The
setText()
,addLink()
, andbuild()
methods are key to using this class. -
This class is specifically designed for quiz feedback within Google Forms.
The base FeedbackBuilder that contains setters for properties common to all feedback, such as display text. Used to build Feedback objects.
// Open a form by ID and add a new list item. const form = FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz'); const item = form.addListItem(); item.setTitle('Do you prefer cats or dogs?'); item.setChoices([ item.createChoice('Dogs', true), item.createChoice('Cats', false), ]); // Add feedback which will be shown for correct responses; ie "Dogs". item.setFeedbackForCorrect( FormApp.createFeedback().setText('Dogs rule, cats drool.').build(), );
Methods
Method | Return type | Brief description |
---|---|---|
add | Quiz | Adds a link to the feedback's supplemental material. |
add | Quiz | Adds a link to the feedback's supplemental material. |
build() | Quiz | Builds a Feedback of the corresponding type for this builder. |
copy() | Quiz | Returns a copy of this builder. |
set | Quiz | Sets the feedback text. |
Detailed documentation
addLink(url)
Adds a link to the feedback's supplemental material.
Parameters
Name | Type | Description |
---|---|---|
url | String | the link to display under the display text |
Return
Quiz
— this Quiz
, for chaining
addLink(url, displayText)
Adds a link to the feedback's supplemental material.
Parameters
Name | Type | Description |
---|---|---|
url | String | the link to display under the display text |
display | String | the text to display for the link |
Return
Quiz
— this Quiz
, for chaining
build()
copy()
setText(text)
Sets the feedback text.
Parameters
Name | Type | Description |
---|---|---|
text | String | the new text |
Return
Quiz
— this Quiz
, for chaining