This service allows scripts to create, access, and modify Google Forms.
// Create a new form, then add a checkbox question, a multiple choice question, // a page break, then a date question and a grid of questions. var form = FormApp.create('New Form'); var item = form.addCheckboxItem(); item.setTitle('What condiments would you like on your hot dog?'); item.setChoices([ item.createChoice('Ketchup'), item.createChoice('Mustard'), item.createChoice('Relish') ]); form.addMultipleChoiceItem() .setTitle('Do you prefer cats or dogs?') .setChoiceValues(['Cats','Dogs']) .showOtherOption(true); form.addPageBreakItem() .setTitle('Getting to know you'); form.addDateItem() .setTitle('When were you born?'); form.addGridItem() .setTitle('Rate your interests') .setRows(['Cars', 'Computers', 'Celebrities']) .setColumns(['Boring', 'So-so', 'Interesting']); Logger.log('Published URL: ' + form.getPublishedUrl()); Logger.log('Editor URL: ' + form.getEditUrl());
Classes
Name | Brief description |
---|---|
Alignment | An enum representing the supported types of image alignment. |
Checkbox | A question item, presented as a grid of columns and rows, that allows the respondent to select multiple choices per row from a sequence of checkboxes. |
Checkbox | A DataValidation for a Checkbox . |
Checkbox | A DataValidationBuilder for a Checkbox . |
Checkbox | A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
Checkbox | A DataValidation for a Checkbox . |
Checkbox | A DataValidationBuilder for a Checkbox . |
Choice | A single choice associated with a type of Item that supports choices, like Checkbox , List , or Multiple . |
Date | A question item that allows the respondent to indicate a date. |
Date | A question item that allows the respondent to indicate a date and time. |
Destination | An enum representing the supported types of form-response destinations. |
Duration | A question item that allows the respondent to indicate a length of time. |
Feedback | An enum representing the supported types of feedback. |
Form | A form that contains overall properties and items. |
Form | Allows a script to open an existing Form or create a new one. |
Form | A response to the form as a whole. |
Grid | A question item, presented as a grid of columns and rows, that allows the respondent to select one choice per row from a sequence of radio buttons. |
Grid | A DataValidation for a Grid . |
Grid | A DataValidationBuilder for a Grid . |
Image | A layout item that displays an image. |
Item | A generic form item that contains properties common to all items, such as title and help text. |
Item | A response to one question item within a form. |
Item | An enum representing the supported types of form items. |
List | A question item that allows the respondent to select one choice from a drop-down list. |
Multiple | A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. |
Page | A layout item that marks the start of a page. |
Page | An enum representing the supported types of page navigation. |
Paragraph | A question item that allows the respondent to enter a block of text. |
Paragraph | A DataValidation for a Paragraph . |
Paragraph | A DataValidationBuilder for a Paragraph . |
Quiz | The bean implementation of a Feedback, which contains properties common to all feedback, such as display text or links. |
Quiz | The base FeedbackBuilder that contains setters for properties common to all feedback, such as display text. |
Rating | An enum representing the supported types of rating icons. |
Rating | A question item that allows the respondent to give a rating. |
Scale | A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
Section | A layout item that visually indicates the start of a section. |
Text | A question item that allows the respondent to enter a single line of text. |
Text | A DataValidation for a Text . |
Text | A DataValidationBuilder for a Text . |
Time | A question item that allows the respondent to indicate a time of day. |
Video | A layout item that displays a video. |
Alignment
Properties
Property | Type | Description |
---|---|---|
LEFT | Enum | Align the image to the left side of the form. |
CENTER | Enum | Align the image to the center of the form. |
RIGHT | Enum | Align the image to the right side of the form. |
CheckboxGridItem
Methods
Method | Return type | Brief description |
---|---|---|
clear | Checkbox | Removes any data validation for this grid item. |
create | Item | Creates a new Item for this checkbox grid item. |
duplicate() | Checkbox | Creates a copy of this item and appends it to the end of the form. |
get | String[] | Gets the values for every column in the grid. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | String[] | Gets the values for every row in the grid. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
is | Boolean | Determines whether the respondent must answer the question. |
set | Checkbox | Sets the columns of the grid based on an array of values. |
set | Checkbox | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Checkbox | Sets whether the respondent must answer the question. |
set | Checkbox | Sets the rows of the grid based on an array of values. |
set | Checkbox | Sets the item's title (sometimes called header text, in the case of a Section ). |
set | Checkbox | Sets the data validation for this checkbox grid item. |
CheckboxGridValidation
CheckboxGridValidationBuilder
Methods
Method | Return type | Brief description |
---|---|---|
require | Checkbox | Requires limit of one response per column for a grid item. |
CheckboxItem
Methods
Method | Return type | Brief description |
---|---|---|
clear | Checkbox | Removes any data validation for this checkbox item. |
create | Choice | Creates a new choice. |
create | Choice | Creates a new choice. |
create | Item | Creates a new Item for this checkbox item. |
duplicate() | Checkbox | Creates a copy of this item and appends it to the end of the form. |
get | Choice[] | Gets all choices for an item. |
get | Quiz | Returns the feedback that is shown to respondents when they respond correctly to a question. |
get | Quiz | Returns the feedback that is shown to respondents when they respond incorrectly to a question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
has | Boolean | Determines whether the item has an "other" option. |
is | Boolean | Determines whether the respondent must answer the question. |
set | Checkbox | Sets the choices for an item from an array of strings. |
set | Checkbox | Sets an array of choices for an item. |
set | Checkbox | Sets the feedback to be shown to respondents when they respond correctly to a question. |
set | Checkbox | Sets the feedback to be shown to respondents when they respond incorrectly to a question. |
set | Checkbox | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Checkbox | Sets the number of points a gradeable item is worth. |
set | Checkbox | Sets whether the respondent must answer the question. |
set | Checkbox | Sets the item's title (sometimes called header text, in the case of a Section ). |
set | Checkbox | Sets the data validation for this checkbox item. |
show | Checkbox | Sets whether the item has an "other" option. |
CheckboxValidation
CheckboxValidationBuilder
Methods
Method | Return type | Brief description |
---|---|---|
require | Checkbox | Require at least this many choices to be selected. |
require | Checkbox | Require at most this many choices to be selected. |
require | Checkbox | Require exactly this many choices to be selected. |
Choice
Methods
Method | Return type | Brief description |
---|---|---|
get | Page | Gets the Page set as a GO_TO_PAGE destination
if the responder selects this choice and completes the current page. |
get | Page | Gets the Page that occurs if the responder selects this choice and
completes the current page. |
get | String | Gets the choice's value, which respondents see as a label when viewing the form. |
is | Boolean | Gets whether the choice is a correct answer for the question. |
DateItem
Methods
Method | Return type | Brief description |
---|---|---|
create | Item | Creates a new Item for this date item. |
duplicate() | Date | Creates a copy of this item and appends it to the end of the form. |
get | Quiz | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
includes | Boolean | Determines whether the date item includes a year option. |
is | Boolean | Determines whether the respondent must answer the question. |
set | Date | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
set | Date | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Date | Sets whether the date item includes a year setting. |
set | Date | Sets the number of points a gradeable item is worth. |
set | Date | Sets whether the respondent must answer the question. |
set | Date | Sets the item's title (sometimes called header text, in the case of a Section ). |
DateTimeItem
Methods
Method | Return type | Brief description |
---|---|---|
create | Item | Creates a new Item for this date-time item. |
duplicate() | Date | Creates a copy of this item and appends it to the end of the form. |
get | Quiz | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
includes | Boolean | Determines whether the date item includes a year option. |
is | Boolean | Determines whether the respondent must answer the question. |
set | Date | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
set | Date | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Date | Sets whether the date item includes a year setting. |
set | Date | Sets the number of points a gradeable item is worth. |
set | Date | Sets whether the respondent must answer the question. |
set | Date | Sets the item's title (sometimes called header text, in the case of a Section ). |
DestinationType
Properties
Property | Type | Description |
---|---|---|
SPREADSHEET | Enum | A Google Sheets spreadsheet as a destination for form responses. |
DurationItem
Methods
Method | Return type | Brief description |
---|---|---|
create | Item | Creates a new Item for this date item. |
duplicate() | Duration | Creates a copy of this item and appends it to the end of the form. |
get | Quiz | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
is | Boolean | Determines whether the respondent must answer the question. |
set | Duration | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
set | Duration | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Duration | Sets the number of points a gradeable item is worth. |
set | Duration | Sets whether the respondent must answer the question. |
set | Duration | Sets the item's title (sometimes called header text, in the case of a Section ). |
FeedbackType
Properties
Property | Type | Description |
---|---|---|
CORRECT | Enum | Feedback that is automatically displayed to respondents for a question answered correctly. |
INCORRECT | Enum | Feedback that is automatically displayed to respondents for a question answered incorrectly. |
GENERAL | Enum | Feedback that is automatically displayed to respondents when they submit their response. |
Form
Methods
Method | Return type | Brief description |
---|---|---|
add | Checkbox | Appends a new question item, presented as a grid of columns and rows, that allows the respondent to select multiple choices per row from a sequence of checkboxes. |
add | Checkbox | Appends a new question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
add | Date | Appends a new question item that allows the respondent to indicate a date. |
add | Date | Appends a new question item that allows the respondent to indicate a date and time. |
add | Duration | Appends a new question item that allows the respondent to indicate a length of time. |
add | Form | Adds the given user to the list of editors for the Form . |
add | Form | Adds the given user to the list of editors for the Form . |
add | Form | Adds the given array of users to the list of editors for the Form . |
add | Grid | Appends a new question item, presented as a grid of columns and rows, that allows the respondent to select one choice per row from a sequence of radio buttons. |
add | Image | Appends a new layout item that displays an image. |
add | List | Appends a new question item that allows the respondent to select one choice from a dropdown list. |
add | Multiple | Adds a new question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. |
add | Page | Adds a new layout item that marks the start of a page. |
add | Paragraph | Adds a new question item that allows the respondent to enter a block of text. |
add | RatingItem | Appends a new question item that allows the respondent to give a rating. |
add | ScaleItem | Appends a new question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
add | Section | Appends a new layout item that visually indicates the start of a section. |
add | Text | Appends a new question item that allows the respondent to enter a single line of text. |
add | Time | Appends a new question item that allows the respondent to indicate a time of day. |
add | Video | Appends a new layout item that displays a video. |
can | Boolean | Determines whether the form displays a link to edit a response after submitting it. |
collects | Boolean | Determines whether the form collects respondents' email addresses. |
create | Form | Creates a new response to the form. |
delete | Form | Deletes all submitted responses from the form's response store. |
delete | void | Deletes the item at a given index among all the items in the form. |
delete | void | Deletes the given item. |
delete | Form | Deletes a single response from the form's response store. |
get | String | Gets the form's confirmation message. |
get | String | Gets the custom message that is displayed if the form is not accepting responses, or an empty string if no custom message is set. |
get | String | Gets the form's description. |
get | String | Gets the ID of the form's response destination. |
get | Destination | Gets the type of the form's response destination. |
get | String | Gets the URL that can be used to access the form's edit mode. |
get | User[] | Gets the list of editors for this Form . |
get | String | Gets the ID of the form. |
get | Item | Gets the item with a given ID. |
get | Item[] | Gets an array of all items in the form. |
get | Item[] | Gets an array of all items of a given type. |
get | String | Gets the URL that can be used to respond to the form. |
get | Form | Gets a single form response based on its response ID. |
get | Form | Gets an array of all of the form's responses. |
get | Form | Gets an array of all of the form's responses after a given date and time. |
get | Boolean | Determines whether the order of the questions on each page of the form is randomized. |
get | String | Gets the URL that can be used to view a summary of the form's responses. |
get | String | Gets the form's title. |
has | Boolean | Determines whether the form allows only one response per respondent. |
has | Boolean | Determines whether the form displays a progress bar. |
has | Boolean | Determines whether the form displays a link to submit another response after a respondent completes the form. |
is | Boolean | Determines whether the form is currently accepting responses. |
is | Boolean | Determines whether the form displays a link to view a summary of responses after a respondent completes the form. |
is | Boolean | Determines whether the form is a quiz. |
move | Item | Moves an item at a given index among all the items in the form to another given index. |
move | Item | Moves a given item to a given index among all the items in the form. |
remove | Form | Unlinks the form from its current response destination. |
remove | Form | Removes the given user from the list of editors for the Form . |
remove | Form | Removes the given user from the list of editors for the Form . |
set | Form | Sets whether the form is currently accepting responses. |
set | Form | Sets whether the form displays a link to edit a response after submitting it. |
set | Form | Sets whether the form collects respondents' email addresses. |
set | Form | Sets the form's confirmation message. |
set | Form | Sets the message to display if the form is not accepting responses. |
set | Form | Sets the form's description. |
set | Form | Sets the destination where form responses are saved. |
set | Form | Sets whether the form is a quiz. |
set | Form | Sets whether the form allows only one response per respondent. |
set | Form | Sets whether the form has a progress bar. |
set | Form | Sets whether the form displays a link to view a summary of responses after a respondent submits the form. |
set | Form | Sets whether the form displays a link to submit another response after a respondent completes the form. |
set | Form | Sets whether the order of the questions on each page of the form is randomized. |
set | Form | Sets the form's title. |
shorten | String | Converts a long URL for a form to a short URL. |
submit | Form | Submits grades for the given FormResponses. |
FormApp
Properties
Property | Type | Description |
---|---|---|
Alignment | Alignment | An enumeration of types of image alignment. |
Destination | Destination | An enumeration of types of destinations that can store form responses. |
Feedback | Feedback | An enumeration of types of form Feedbacks . |
Item | Item | An enumeration of types of form Items . |
Page | Page | An enumeration of possible behaviors for navigating pages. |
RatingIconType | RatingIconType | An enumeration of rating icon types RatingIcons |
Methods
Method | Return type | Brief description |
---|---|---|
create(title) | Form | Creates and returns a new Form . |
create | Checkbox | Returns an instance of a CheckboxGridValidationBuilder which can be used to set validation on a
Checkbox . |
create | Checkbox | Returns an instance of a CheckboxValidationBuilder which can be used to set validation on a
Checkbox . |
create | Quiz | Returns an instance of a QuizFeedbackBuilder which can be used to set feedback on a gradeable
Item . |
create | Grid | Returns an instance of a GridValidationBuilder which can be used to set validation on a Grid . |
create | Paragraph | Returns an instance of a ParagraphTextValidationBuilder which can be used to set validation on
a Paragraph . |
create | Text | Returns an instance of a TextValidationBuilder which can be used to set validation on a Text . |
get | Form | Returns the form to which the script is container-bound. |
get | Ui | Returns an instance of the form editor's user-interface environment that allows the script to add features like menus, dialogs, and sidebars. |
open | Form | Returns the Form with the specified ID. |
open | Form | Returns the Form with the specified URL. |
FormResponse
Methods
Method | Return type | Brief description |
---|---|---|
get | String | Generates a URL that can be used to edit a response that has already been submitted. |
get | Item | Gets all item responses contained in a form response, in the same order that the items appear in the form. |
get | Item | Gets the item response contained in a form response for a given item. |
get | String | Gets the ID of the form response. |
get | Item | Gets all item responses contained in a form response, in the same order that the items appear in the form. |
get | String | Gets the email address of the person who submitted a response, if the Form.setCollectEmail(collect) setting is enabled. |
get | Item | Gets the item response contained in this form response for a given item. |
get | Date | Gets the timestamp for a form response submission. |
submit() | Form | Submits the response. |
to | String | Generates a URL for the form in which the answers are pre-filled based on the answers in this form response. |
with | Form | Adds the given item response's grades to a form response. |
with | Form | Adds the given item response to a form response. |
GridItem
Methods
Method | Return type | Brief description |
---|---|---|
clear | Grid | Removes any data validation for this grid item. |
create | Item | Creates a new Item for this grid item. |
duplicate() | Grid | Creates a copy of this item and appends it to the end of the form. |
get | String[] | Gets the values for every column in the grid. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | String[] | Gets the values for every row in the grid. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
is | Boolean | Determines whether the respondent must answer the question. |
set | Grid | Sets the columns of the grid based on an array of values. |
set | Grid | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Grid | Sets whether the respondent must answer the question. |
set | Grid | Sets the rows of the grid based on an array of values. |
set | Grid | Sets the item's title (sometimes called header text, in the case of a Section ). |
set | Grid | Sets the data validation for this grid item. |
GridValidation
GridValidationBuilder
Methods
Method | Return type | Brief description |
---|---|---|
require | Grid | Requires limit of one response per column for a grid item. |
ImageItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | Image | Creates a copy of this item and appends it to the end of the form. |
get | Alignment | Gets the image's horizontal alignment. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Blob | Gets the image that is currently assigned to the item. |
get | Integer | Gets the index of the item among all the items in the form. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
get | Integer | Gets the image's width in pixels. |
set | Image | Sets the image's horizontal alignment. |
set | Image | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Image | Sets the image itself. |
set | Image | Sets the item's title (sometimes called header text, in the case of a Section ). |
set | Image | Sets the image's width in pixels. |
Item
Methods
Method | Return type | Brief description |
---|---|---|
as | Checkbox | Returns the item as a checkbox grid item. |
as | Checkbox | Returns the item as a checkbox item. |
as | Date | Returns the item as a date item. |
as | Date | Returns the item as a date-time item. |
as | Duration | Returns the item as a duration item. |
as | Grid | Returns the item as a grid item. |
as | Image | Returns the item as an image item. |
as | List | Returns the item as a list item. |
as | Multiple | Returns the item as a multiple-choice item. |
as | Page | Returns the item as a page-break item. |
as | Paragraph | Returns the item as a paragraph-text item. |
as | RatingItem | Returns the item as a rating item. |
as | Scale | Returns the item as a scale item. |
as | Section | Returns the item as a section-header item. |
as | Text | Returns the item as a text item. |
as | Time | Returns the item as a time item. |
as | Video | Returns the item as a video item. |
duplicate() | Item | Creates a copy of this item and appends it to the end of the form. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
set | Item | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Item | Sets the item's title (sometimes called header text, in the case of a Section ). |
ItemResponse
Methods
Method | Return type | Brief description |
---|---|---|
get | Object | Gets the feedback that was given for the respondent's submitted answer. |
get | Item | Gets the question item that this response answers. |
get | Object | Gets the answer that the respondent submitted. |
get | Object | Gets the score for the respondent's submitted answer. |
set | Item | Sets the feedback that should be displayed for the respondent's submitted answer. |
set | Item | Sets the score for the respondent's submitted answer. |
ItemType
Properties
Property | Type | Description |
---|---|---|
CHECKBOX | Enum | A question item that allows the respondent to select one or more checkboxes, as well as an optional "other" field. |
CHECKBOX_GRID | Enum | A question item, presented as a grid of columns and rows, that allows the respondent to select multiple choices per row from a sequence of checkboxes. |
DATE | Enum | A question item that allows the respondent to indicate a date. |
DATETIME | Enum | A question item that allows the respondent to indicate a date and time. |
DURATION | Enum | A question item that allows the respondent to indicate a length of time. |
GRID | Enum | A question item, presented as a grid of columns and rows, that allows the respondent to select one choice per row from a sequence of radio buttons. |
IMAGE | Enum | A layout item that displays an image. |
LIST | Enum | A question item that allows the respondent to select one choice from a drop-down list. |
MULTIPLE_CHOICE | Enum | A question item that allows the respondent to select one choice from a list of radio buttons or an optional "other" field. |
PAGE_BREAK | Enum | A layout item that marks the start of a page. |
PARAGRAPH_TEXT | Enum | A question item that allows the respondent to enter a block of text. |
RATING | Enum | A question item that allows the respondent to give a rating. |
SCALE | Enum | A question item that allows the respondent to choose one option from a numbered sequence of radio buttons. |
SECTION_HEADER | Enum | A layout item that visually indicates the start of a section. |
TEXT | Enum | A question item that allows the respondent to enter a single line of text. |
TIME | Enum | A question item that allows the respondent to indicate a time of day. |
VIDEO | Enum | A layout item that displays a YouTube video. |
FILE_UPLOAD | Enum | A question item that lets the respondent upload a file. |
UNSUPPORTED | Enum | An item that is currently not supported through APIs. |
ListItem
Methods
Method | Return type | Brief description |
---|---|---|
create | Choice | Creates a new choice. |
create | Choice | Creates a new choice. |
create | Choice | Creates a new choice with a page-navigation option that jumps to a given page-break item. |
create | Choice | Creates a new choice with a page-navigation option. |
create | Item | Creates a new Item for this list item. |
duplicate() | List | Creates a copy of this item and appends it to the end of the form. |
get | Choice[] | Gets all choices for an item. |
get | Quiz | Returns the feedback that is shown to respondents when they respond correctly to a question. |
get | Quiz | Returns the feedback that is shown to respondents when they respond incorrectly to a question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
is | Boolean | Determines whether the respondent must answer the question. |
set | List | Sets the choices for an item from an array of strings. |
set | List | Sets an array of choices for an item. |
set | List | Sets the feedback to be shown to respondents when they respond correctly to a question. |
set | List | Sets the feedback to be shown to respondents when they respond incorrectly to a question. |
set | List | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | List | Sets the number of points a gradeable item is worth. |
set | List | Sets whether the respondent must answer the question. |
set | List | Sets the item's title (sometimes called header text, in the case of a Section ). |
MultipleChoiceItem
Methods
Method | Return type | Brief description |
---|---|---|
create | Choice | Creates a new choice. |
create | Choice | Creates a new choice. |
create | Choice | Creates a new choice with a page-navigation option that jumps to a given page-break item. |
create | Choice | Creates a new choice with a page-navigation option. |
create | Item | Creates a new Item for this multiple-choice item. |
duplicate() | Multiple | Creates a copy of this item and appends it to the end of the form. |
get | Choice[] | Gets all choices for an item. |
get | Quiz | Returns the feedback that is shown to respondents when they respond correctly to a question. |
get | Quiz | Returns the feedback that is shown to respondents when they respond incorrectly to a question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
has | Boolean | Determines whether the item has an "other" option. |
is | Boolean | Determines whether the respondent must answer the question. |
set | Multiple | Sets the choices for an item from an array of strings. |
set | Multiple | Sets an array of choices for an item. |
set | Multiple | Sets the feedback to be shown to respondents when they respond correctly to a question. |
set | Multiple | Sets the feedback to be shown to respondents when they respond incorrectly to a question. |
set | Multiple | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Multiple | Sets the number of points a gradeable item is worth. |
set | Multiple | Sets whether the respondent must answer the question. |
set | Multiple | Sets the item's title (sometimes called header text, in the case of a Section ). |
show | Multiple | Sets whether the item has an "other" option. |
PageBreakItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | Page | Creates a copy of this item and appends it to the end of the form. |
get | Page | Gets the Page that the form will jump to after completing the page before this
page break (that is, upon reaching this page break by normal linear progression through the
form). |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Page | Gets the type of page navigation that occurs after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
set | Page | Sets the page to jump to after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). |
set | Page | Sets the type of page navigation that occurs after completing the page before this page break (that is, upon reaching this page break by normal linear progression through the form). |
set | Page | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Page | Sets the item's title (sometimes called header text, in the case of a Section ). |
PageNavigationType
Properties
Property | Type | Description |
---|---|---|
CONTINUE | Enum | Continue to the next page of the form after completing the current page. |
GO_TO_PAGE | Enum | Jump to a specified page of the form after completing the current page. |
RESTART | Enum | Restart the form from the beginning, without clearing answers entered so far, after completing the current page. |
SUBMIT | Enum | Submit the form response after completing the current page. |
ParagraphTextItem
Methods
Method | Return type | Brief description |
---|---|---|
clear | Paragraph | Removes any data validation for this paragraph text item. |
create | Item | Creates a new Item for this paragraph text item. |
duplicate() | Paragraph | Creates a copy of this item and appends it to the end of the form. |
get | Quiz | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
is | Boolean | Determines whether the respondent must answer the question. |
set | Paragraph | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
set | Paragraph | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Paragraph | Sets the number of points a gradeable item is worth. |
set | Paragraph | Sets whether the respondent must answer the question. |
set | Paragraph | Sets the item's title (sometimes called header text, in the case of a Section ). |
set | Paragraph | Sets the data validation for this paragraph text item. |
ParagraphTextValidation
ParagraphTextValidationBuilder
Methods
Method | Return type | Brief description |
---|---|---|
require | Paragraph | Requires response to contain pattern. |
require | Paragraph | Requires response to not contain pattern. |
require | Paragraph | Requires response to not match pattern. |
require | Paragraph | Requires response length to be greater than or equal to value. |
require | Paragraph | Requires response length to be less than value. |
require | Paragraph | Requires response to match pattern. |
QuizFeedback
Methods
Method | Return type | Brief description |
---|---|---|
get | String[] | Gets a list of the URLs associated with the Feedback. |
get | String | Gets the Feedback's display text. |
QuizFeedbackBuilder
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. |
RatingIconType
Properties
Property | Type | Description |
---|---|---|
STAR | Enum | A star icon. |
HEART | Enum | A heart icon. |
THUMB_UP | Enum | A thumb up icon. |
RatingItem
Methods
Method | Return type | Brief description |
---|---|---|
createResponse(response) | ItemResponse | Creates a new ItemResponse for this rating item. |
duplicate() | RatingItem | Creates a copy of this item and appends it to the end of the form. |
getGeneralFeedback() | QuizFeedback | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
getHelpText() | String | Gets the item's help text (sometimes called description text for layout items like ImageItems , PageBreakItems , and SectionHeaderItems ). |
getId() | Integer | Gets the item's unique identifier. |
getIndex() | Integer | Gets the index of the item among all the items in the form. |
getPoints() | Integer | Returns the point value of a gradeable item. |
getRatingIcon() | RatingIconType | Gets the icon chosen for the rating. |
getRatingScaleLevel() | Integer | Gets the rating's scale level. |
getTitle() | String | Gets the item's title (sometimes called header text, in the case of a SectionHeaderItem ). |
getType() | ItemType | Gets the item's type, represented as an ItemType . |
isRequired() | Boolean | Determines whether the respondent must answer the question. |
setGeneralFeedback(feedback) | RatingItem | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
setHelpText(text) | RatingItem | Sets the item's help text (sometimes called description text for layout items like ImageItems , PageBreakItems , and SectionHeaderItems ). |
setPoints(points) | RatingItem | Sets the number of points a gradeable item is worth. |
setRatingIcon(ratingIcon) | RatingItem | Sets the rating's icon. |
setRatingScaleLevel(ratingScaleLevel) | RatingItem | Sets the rating's scale level. |
setRequired(enabled) | RatingItem | Sets whether the respondent must answer the question. |
setTitle(title) | RatingItem | Sets the item's title (sometimes called header text, in the case of a SectionHeaderItem ). |
ScaleItem
Methods
Method | Return type | Brief description |
---|---|---|
create | Item | Creates a new Item for this scale item. |
duplicate() | Scale | Creates a copy of this item and appends it to the end of the form. |
get | Quiz | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | String | Gets the label for the scale's lower bound, if any. |
get | Integer | Gets the scale's lower bound. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the label for the scale's upper bound, if any. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
get | Integer | Gets the scale's upper bound. |
is | Boolean | Determines whether the respondent must answer the question. |
set | Scale | Sets the scale's lower and upper bounds. |
set | Scale | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
set | Scale | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Scale | Sets labels for the scale's lower and upper bounds. |
set | Scale | Sets the number of points a gradeable item is worth. |
set | Scale | Sets whether the respondent must answer the question. |
set | Scale | Sets the item's title (sometimes called header text, in the case of a Section ). |
SectionHeaderItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | Section | Creates a copy of this item and appends it to the end of the form. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
set | Section | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Section | Sets the item's title (sometimes called header text, in the case of a Section ). |
TextItem
Methods
Method | Return type | Brief description |
---|---|---|
clear | Text | Removes any data validation for this text item. |
create | Item | Creates a new Item for this text item. |
duplicate() | Text | Creates a copy of this item and appends it to the end of the form. |
get | Quiz | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
is | Boolean | Determines whether the respondent must answer the question. |
set | Text | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
set | Text | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Text | Sets the number of points a gradeable item is worth. |
set | Text | Sets whether the respondent must answer the question. |
set | Text | Sets the item's title (sometimes called header text, in the case of a Section ). |
set | Text | Sets the data validation for this text item. |
TextValidation
TextValidationBuilder
Methods
Method | Return type | Brief description |
---|---|---|
require | Text | Requires text item to be a number. |
require | Text | Requires text item to be a number between start and end, inclusive. |
require | Text | Requires text item to be a number equal to value specified. |
require | Text | Requires text item to be a number greater than the value specified. |
require | Text | Requires text item to be a number greater than or equal to the value specified. |
require | Text | Requires text item to be a number less than the value specified. |
require | Text | Requires text item to be a number less than or equal to the value specified. |
require | Text | Requires text item to be a number not between start and end, inclusive. |
require | Text | Requires text item to be a number not equal to the value specified. |
require | Text | Requires response to contain pattern. |
require | Text | Requires response to not contain pattern. |
require | Text | Requires response to not match pattern. |
require | Text | Requires text item to be an email address. |
require | Text | Requires text item to be a URL. |
require | Text | Requires response length to be greater than or equal to value. |
require | Text | Requires response length to be less than value. |
require | Text | Requires response to match pattern. |
require | Text | Requires text item to be a whole number. |
TimeItem
Methods
Method | Return type | Brief description |
---|---|---|
create | Item | Creates a new Item for this time item. |
duplicate() | Time | Creates a copy of this item and appends it to the end of the form. |
get | Quiz | Returns the feedback that is shown to respondents when they respond to a gradeable question. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | Integer | Returns the point value of a gradeable item. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
is | Boolean | Determines whether the respondent must answer the question. |
set | Time | Sets the feedback to be shown to respondents when they respond to a gradeable question that doesn't have a correct or incorrect answer (ie questions that require manual grading). |
set | Time | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Time | Sets the number of points a gradeable item is worth. |
set | Time | Sets whether the respondent must answer the question. |
set | Time | Sets the item's title (sometimes called header text, in the case of a Section ). |
VideoItem
Methods
Method | Return type | Brief description |
---|---|---|
duplicate() | Video | Creates a copy of this item and appends it to the end of the form. |
get | Alignment | Gets the video's horizontal alignment. |
get | String | Gets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
get | Integer | Gets the item's unique identifier. |
get | Integer | Gets the index of the item among all the items in the form. |
get | String | Gets the item's title (sometimes called header text, in the case of a Section ). |
get | Item | Gets the item's type, represented as an Item . |
get | Integer | Gets the video's width in pixels. |
set | Video | Sets the video's horizontal alignment. |
set | Video | Sets the item's help text (sometimes called description text for layout items like Image , Page , and Section ). |
set | Video | Sets the item's title (sometimes called header text, in the case of a Section ). |
set | Video | Sets the video itself from a given YouTube URL or YouTube video ID. |
set | Video | Sets the video's width in pixels. |