Class QuizFeedbackBuilder

Quiz Feedback Builder

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
Quiz Feedback Builder Adds a link to the feedback's supplemental material.
Quiz Feedback Builder Adds a link to the feedback's supplemental material.
Quiz Feedback Builds a Feedback of the corresponding type for this builder.
Quiz Feedback Builder Returns a copy of this builder.
Quiz Feedback Builder Sets the feedback text.

Detailed documentation

add Link(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 Feedback Builder — this Quiz Feedback Builder , for chaining


add Link(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 Text
String the text to display for the link

Return

Quiz Feedback Builder — this Quiz Feedback Builder , for chaining


build()

Builds a Feedback of the corresponding type for this builder.

Return

Quiz Feedback Quiz Feedback


copy()

Returns a copy of this builder.

Return

Quiz Feedback Builder Quiz Feedback Builder


set Text(text)

Sets the feedback text.

Parameters

Name Type Description
text
String the new text

Return

Quiz Feedback Builder — this Quiz Feedback Builder , for chaining

Create a Mobile Website
View Site in Mobile | Classic
Share by: