Class QuizFeedbackBuilder Stay organized with collections Save and categorize content based on your preferences.
Page Summary
QuizFeedbackBuilder is used to build Feedback objects and set common properties like display text.
It provides methods to add links, set text, build the feedback object, and create a copy.
The addLink method can include a display text for the link.
The build method finalizes the feedback object.
The base FeedbackBuilder that contains setters for properties common to all feedback, such asdisplay text. Used to build Feedback objects.
// Open a form by ID and add a new list item.constform=FormApp.openById('1234567890abcdefghijklmnopqrstuvwxyz');constitem=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 — thisQuiz, 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 — thisQuiz, for chaining
build()
copy()
setText(text)
Sets the feedback text.
Parameters
| Name | Type | Description |
|---|---|---|
text | String | the new text |
Return
Quiz — thisQuiz, for chaining
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-11 UTC.