Answer
The submitted answer for a question.Fields | |
---|---|
fileUploadAnswers |
Output only. The answers to a file upload question. |
grade |
Output only. The grade for the answer if the form was a quiz. |
questionId |
Output only. The question's ID. See also Question.question_id. |
textAnswers |
Output only. The specific answers as text. |
BatchUpdateFormRequest
A batch of updates to perform on a form. All the specified updates are made or none of them are.Fields | |
---|---|
includeFormInResponse |
Whether to return an updated version of the model in the response. |
requests[] |
Required. The update requests of this batch. |
writeControl |
Provides control over how write requests are executed. |
BatchUpdateFormResponse
Response to a BatchUpdateFormRequest.Fields | |
---|---|
form |
Based on the bool request field |
replies[] |
The reply of the updates. This maps 1:1 with the update requests, although replies to some requests may be empty. |
writeControl |
The updated write control after applying the request. |
ChoiceQuestion
A radio/checkbox/dropdown question.Fields | |
---|---|
options[] |
Required. List of options that a respondent must choose from. |
shuffle |
Whether the options should be displayed in random order for different instances of the quiz. This is often used to prevent cheating by respondents who might be looking at another respondent's screen, or to address bias in a survey that might be introduced by always putting the same options first or last. |
type |
Required. The type of choice question. |
Enum type. Can be one of the following: | |
CHOICE_TYPE_UNSPECIFIED |
Default value. Unused. |
RADIO |
Radio buttons: All choices are shown to the user, who can only pick one of them. |
CHECKBOX |
Checkboxes: All choices are shown to the user, who can pick any number of them. |
DROP_DOWN |
Drop-down menu: The choices are only shown to the user on demand, otherwise only the current choice is shown. Only one option can be chosen. |
CloudPubsubTopic
A Pub/Sub topic.Fields | |
---|---|
topicName |
Required. A fully qualified Pub/Sub topic name to publish the events to. This topic must be owned by the calling project and already exist in Pub/Sub. |
CorrectAnswer
A single correct answer for a question. For multiple-valued (CHECKBOX
) questions, several CorrectAnswer
s may be needed to represent a single correct response option.
Fields | |
---|---|
value |
Required. The correct answer value. See the documentation for TextAnswer.value for details on how various value types are formatted. |
CorrectAnswers
The answer key for a question.Fields | |
---|---|
answers[] |
A list of correct answers. A quiz response can be automatically graded based on these answers. For single-valued questions, a response is marked correct if it matches any value in this list (in other words, multiple correct answers are possible). For multiple-valued ( |
CreateItemRequest
Create an item in a form.Fields | |
---|---|
item |
Required. The item to create. |
location |
Required. Where to place the new item. |
CreateItemResponse
The result of creating an item.Fields | |
---|---|
itemId |
The ID of the created item. |
questionId[] |
The ID of the question created as part of this item, for a question group it lists IDs of all the questions created for this item. |
CreateWatchRequest
Create a new watch.Fields | |
---|---|
watch |
Required. The watch object. No ID should be set on this object; use |
watchId |
The ID to use for the watch. If specified, the ID must not already be in use. If not specified, an ID is generated. This value should be 4-63 characters, and valid characters are /a-z-/. |
DateQuestion
A date question. Date questions default to just month + day.Fields | |
---|---|
includeTime |
Whether to include the time as part of the question. |
includeYear |
Whether to include the year as part of the question. |
DeleteItemRequest
Delete an item in a form.Fields | |
---|---|
location |
Required. The location of the item to delete. |
ExtraMaterial
Supplementary material to the feedback.Fields | |
---|---|
link |
Text feedback. |
video |
Video feedback. |
Feedback
Feedback for a respondent about their response to a question.Fields | |
---|---|
material[] |
Additional information provided as part of the feedback, often used to point the respondent to more reading and resources. |
text |
Required. The main text of the feedback. |
FileUploadAnswer
Info for a single file submitted to a file upload question.Fields | |
---|---|
fileId |
Output only. The ID of the Google Drive file. |
fileName |
Output only. The file name, as stored in Google Drive on upload. |
mimeType |
Output only. The MIME type of the file, as stored in Google Drive on upload. |
FileUploadAnswers
All submitted files for a FileUpload question.Fields | |
---|---|
answers[] |
Output only. All submitted files for a FileUpload question. |
FileUploadQuestion
A file upload question. The API currently does not support creating file upload questions.Fields | |
---|---|
folderId |
Required. The ID of the Drive folder where uploaded files are stored. |
maxFileSize |
Maximum number of bytes allowed for any single file uploaded to this question. |
maxFiles |
Maximum number of files that can be uploaded for this question in a single response. |
types[] |
File types accepted by this question. |
Form
A Google Forms document. A form is created in Drive, and deleting a form or changing its access protections is done via the Drive API.Fields | |
---|---|
formId |
Output only. The form ID. |
info |
Required. The title and description of the form. |
items[] |
Required. A list of the form's items, which can include section headers, questions, embedded media, etc. |
linkedSheetId |
Output only. The ID of the linked Google Sheet which is accumulating responses from this Form (if such a Sheet exists). |
responderUri |
Output only. The form URI to share with responders. This opens a page that allows the user to submit responses but not edit the questions. |
revisionId |
Output only. The revision ID of the form. Used in the WriteControl in update requests to identify the revision on which the changes are based. The format of the revision ID may change over time, so it should be treated opaquely. A returned revision ID is only guaranteed to be valid for 24 hours after it has been returned and cannot be shared across users. If the revision ID is unchanged between calls, then the form has not changed. Conversely, a changed ID (for the same form and user) usually means the form has been updated; however, a changed ID can also be due to internal factors such as ID format changes. |
settings |
The form's settings. This must be updated with UpdateSettingsRequest; it is ignored during |
FormResponse
A form response.Fields | |
---|---|
answers |
Output only. The actual answers to the questions, keyed by question_id. |
createTime |
Output only. Timestamp for the first time the response was submitted. |
formId |
Output only. The form ID. |
lastSubmittedTime |
Output only. Timestamp for the most recent time the response was submitted. Does not track changes to grades. |
respondentEmail |
Output only. The email address (if collected) for the respondent. |
responseId |
Output only. The response ID. |
totalScore |
Output only. The total number of points the respondent received for their submission Only set if the form was a quiz and the response was graded. This includes points automatically awarded via autograding adjusted by any manual corrections entered by the form owner. |
FormSettings
A form's settings.Fields | |
---|---|
quizSettings |
Settings related to quiz forms and grading. |
Grade
Grade information associated with a respondent's answer to a question.Fields | |
---|---|
correct |
Output only. Whether the question was answered correctly or not. A zero-point score is not enough to infer incorrectness, since a correctly answered question could be worth zero points. |
feedback |
Output only. Additional feedback given for an answer. |
score |
Output only. The numeric score awarded for the answer. |
Grading
Grading for a single questionFields | |
---|---|
correctAnswers |
Required. The answer key for the question. Responses are automatically graded based on this field. |
generalFeedback |
The feedback displayed for all answers. This is commonly used for short answer questions when a quiz owner wants to quickly give respondents some sense of whether they answered the question correctly before they've had a chance to officially grade the response. General feedback cannot be set for automatically graded multiple choice questions. |
pointValue |
Required. The maximum number of points a respondent can automatically get for a correct answer. This must not be negative. |
whenRight |
The feedback displayed for correct responses. This feedback can only be set for multiple choice questions that have correct answers provided. |
whenWrong |
The feedback displayed for incorrect responses. This feedback can only be set for multiple choice questions that have correct answers provided. |
Grid
A grid of choices (radio or check boxes) with each row constituting a separate question. Each row has the same choices, which are shown as the columns.Fields | |
---|---|
columns |
Required. The choices shared by each question in the grid. In other words, the values of the columns. Only |
shuffleQuestions |
If |
Image
Data representing an image.Fields | |
---|---|
altText |
A description of the image that is shown on hover and read by screenreaders. |
contentUri |
Output only. A URI from which you can download the image; this is valid only for a limited time. |
properties |
Properties of an image. |
sourceUri |
Input only. The source URI is the URI used to insert the image. The source URI can be empty when fetched. |
ImageItem
An item containing an image.Fields | |
---|---|
image |
Required. The image displayed in the item. |
Info
The general information for a form.Fields | |
---|---|
description |
The description of the form. |
documentTitle |
Output only. The title of the document which is visible in Drive. If |
title |
Required. The title of the form which is visible to responders. |
Item
A single item of the form.kind
defines which kind of item it is.
Fields | |
---|---|
description |
The description of the item. |
imageItem |
Displays an image on the page. |
itemId |
The item ID. On creation, it can be provided but the ID must not be already used in the form. If not provided, a new ID is assigned. |
pageBreakItem |
Starts a new page with a title. |
questionGroupItem |
Poses one or more questions to the user with a single major prompt. |
questionItem |
Poses a question to the user. |
textItem |
Displays a title and description on the page. |
title |
The title of the item. |
videoItem |
Displays a video on the page. |
ListFormResponsesResponse
Response to a ListFormResponsesRequest.Fields | |
---|---|
nextPageToken |
If set, there are more responses. To get the next page of responses, provide this as |
responses[] |
The returned responses. |
ListWatchesResponse
The response of a ListWatchesRequest.Fields | |
---|---|
watches[] |
The returned watches. |
Location
A specific location in a form.Fields | |
---|---|
index |
The index of an item in the form. This must be in the range [0..N), where N is the number of items in the form. |
MediaProperties
Properties of the media.Fields | |
---|---|
alignment |
Position of the media. |
Enum type. Can be one of the following: | |
ALIGNMENT_UNSPECIFIED |
Default value. Unused. |
LEFT |
Left align. |
RIGHT |
Right align. |
CENTER |
Center. |
width |
The width of the media in pixels. When the media is displayed, it is scaled to the smaller of this value or the width of the displayed form. The original aspect ratio of the media is preserved. If a width is not specified when the media is added to the form, it is set to the width of the media source. Width must be between 0 and 740, inclusive. Setting width to 0 or unspecified is only permitted when updating the media source. |
MoveItemRequest
Move an item in a form.Fields | |
---|---|
newLocation |
Required. The new location for the item. |
originalLocation |
Required. The location of the item to move. |
Option
An option for a Choice question.Fields | |
---|---|
goToAction |
Section navigation type. |
Enum type. Can be one of the following: | |
GO_TO_ACTION_UNSPECIFIED |
Default value. Unused. |
NEXT_SECTION |
Go to the next section. |
RESTART_FORM |
Go back to the beginning of the form. |
SUBMIT_FORM |
Submit form immediately. |
goToSectionId |
Item ID of section header to go to. |
image |
Display image as an option. |
isOther |
Whether the option is "other". Currently only applies to |
value |
Required. The choice as presented to the user. |
Question
Any question. The specific type of question is known by itskind
.
Fields | |
---|---|
choiceQuestion |
A respondent can choose from a pre-defined set of options. |
dateQuestion |
A respondent can enter a date. |
fileUploadQuestion |
A respondent can upload one or more files. |
grading |
Grading setup for the question. |
questionId |
Read only. The question ID. On creation, it can be provided but the ID must not be already used in the form. If not provided, a new ID is assigned. |
required |
Whether the question must be answered in order for a respondent to submit their response. |
rowQuestion |
A row of a QuestionGroupItem. |
scaleQuestion |
A respondent can choose a number from a range. |
textQuestion |
A respondent can enter a free text response. |
timeQuestion |
A respondent can enter a time. |
QuestionGroupItem
Defines a question that comprises multiple questions grouped together.Fields | |
---|---|
grid |
The question group is a grid with rows of multiple choice questions that share the same options. When |
image |
The image displayed within the question group above the specific questions. |
questions[] |
Required. A list of questions that belong in this question group. A question must only belong to one group. The |
QuestionItem
A form item containing a single question.Fields | |
---|---|
image |
The image displayed within the question. |
question |
Required. The displayed question. |
QuizSettings
Settings related to quiz forms and grading. These must be updated with the UpdateSettingsRequest.Fields | |
---|---|
isQuiz |
Whether this form is a quiz or not. When true, responses are graded based on question Grading. Upon setting to false, all question Grading is deleted. |
Request
The kinds of update requests that can be made.Fields | |
---|---|
createItem |
Create a new item. |
deleteItem |
Delete an item. |
moveItem |
Move an item to a specified location. |
updateFormInfo |
Update Form's Info. |
updateItem |
Update an item. |
updateSettings |
Updates the Form's settings. |
Response
A single response from an update.Fields | |
---|---|
createItem |
The result of creating an item. |
RowQuestion
Configuration for a question that is part of a question group.Fields | |
---|---|
title |
Required. The title for the single row in the QuestionGroupItem. |
ScaleQuestion
A scale question. The user has a range of numeric values to choose from.Fields | |
---|---|
high |
Required. The highest possible value for the scale. |
highLabel |
The label to display describing the highest point on the scale. |
low |
Required. The lowest possible value for the scale. |
lowLabel |
The label to display describing the lowest point on the scale. |
TextAnswer
An answer to a question represented as text.Fields | |
---|---|
value |
Output only. The answer value. Formatting used for different kinds of question: * ChoiceQuestion * |
TextAnswers
A question's answers as text.Fields | |
---|---|
answers[] |
Output only. Answers to a question. For multiple-value ChoiceQuestions, each answer is a separate value. |
TextLink
Link for text.Fields | |
---|---|
displayText |
Required. Display text for the URI. |
uri |
Required. The URI. |
TextQuestion
A text-based question.Fields | |
---|---|
paragraph |
Whether the question is a paragraph question or not. If not, the question is a short text question. |
TimeQuestion
A time question.Fields | |
---|---|
duration |
|
UpdateFormInfoRequest
Update Form's Info.Fields | |
---|---|
info |
The info to update. |
updateMask |
Required. Only values named in this mask are changed. At least one field must be specified. The root |
UpdateItemRequest
Update an item in a form.Fields | |
---|---|
item |
Required. New values for the item. Note that item and question IDs are used if they are provided (and are in the field mask). If an ID is blank (and in the field mask) a new ID is generated. This means you can modify an item by getting the form via forms.get, modifying your local copy of that item to be how you want it, and using UpdateItemRequest to write it back, with the IDs being the same (or not in the field mask). |
location |
Required. The location identifying the item to update. |
updateMask |
Required. Only values named in this mask are changed. |
UpdateSettingsRequest
Update Form's FormSettings.Fields | |
---|---|
settings |
Required. The settings to update with. |
updateMask |
Required. Only values named in this mask are changed. At least one field must be specified. The root |
Video
Data representing a video.Fields | |
---|---|
properties |
Properties of a video. |
youtubeUri |
Required. A YouTube URI. |
VideoItem
An item containing a video.Fields | |
---|---|
caption |
The text displayed below the video. |
video |
Required. The video displayed in the item. |
VideoLink
Link to a video.Fields | |
---|---|
displayText |
Required. The display text for the link. |
youtubeUri |
The URI of a YouTube video. |
Watch
A watch for events for a form. When the designated event happens, a notification will be published to the specified target. The notification's attributes will include aformId
key that has the ID of the watched form and an eventType
key that has the string of the type. Messages are sent with at-least-once delivery and are only dropped in extraordinary circumstances. Typically all notifications should be reliably delivered within a few seconds; however, in some situations notifications may be delayed. A watch expires seven days after it is created unless it is renewed with watches.renew
Fields | |
---|---|
createTime |
Output only. Timestamp of when this was created. |
errorType |
Output only. The most recent error type for an attempted delivery. To begin watching the form again a call can be made to watches.renew which also clears this error information. |
Enum type. Can be one of the following: | |
ERROR_TYPE_UNSPECIFIED |
Unspecified error type. |
PROJECT_NOT_AUTHORIZED |
The cloud project does not have access to the form being watched. This occurs if the user has revoked the authorization for your project to access their form(s). Watches with this error will not be retried. To attempt to begin watching the form again a call can be made to watches.renew |
NO_USER_ACCESS |
The user that granted access no longer has access to the form being watched. Watches with this error will not be retried. To attempt to begin watching the form again a call can be made to watches.renew |
OTHER_ERRORS |
Another type of error has occurred. Whether notifications will continue depends on the watch state. |
eventType |
Required. Which event type to watch for. |
Enum type. Can be one of the following: | |
EVENT_TYPE_UNSPECIFIED |
Unspecified event type. This value should not be used. |
SCHEMA |
The schema event type. A watch with this event type will be notified about changes to form content and settings. |
RESPONSES |
The responses event type. A watch with this event type will be notified when form responses are submitted. |
expireTime |
Output only. Timestamp for when this will expire. Each watches.renew call resets this to seven days in the future. |
id |
Output only. The ID of this watch. See notes on CreateWatchRequest.watch_id. |
state |
Output only. The current state of the watch. Additional details about suspended watches can be found by checking the |
Enum type. Can be one of the following: | |
STATE_UNSPECIFIED |
Unspecified state. |
ACTIVE |
Watch is active. |
SUSPENDED |
The watch is suspended due to an error that may be resolved. The watch will continue to exist until it expires. To attempt to reactivate the watch a call can be made to watches.renew |
target |
Required. Where to send the notification. |
WatchTarget
The target for notification delivery.Fields | |
---|---|
topic |
A Pub/Sub topic. To receive notifications, the topic must grant publish privileges to the Forms service account |
WriteControl
Provides control over how write requests are executed.Fields | |
---|---|
requiredRevisionId |
The revision ID of the form that the write request is applied to. If this is not the latest revision of the form, the request is not processed and returns a 400 bad request error. |
targetRevisionId |
The target revision ID of the form that the write request is applied to. If changes have occurred after this revision, the changes in this update request are transformed against those changes. This results in a new revision of the form that incorporates both the changes in the request and the intervening changes, with the server resolving conflicting changes. The target revision ID may only be used to write to recent versions of a form. If the target revision is too far behind the latest revision, the request is not processed and returns a 400 (Bad Request Error). The request may be retried after reading the latest version of the form. In most cases a target revision ID remains valid for several minutes after it is read, but for frequently-edited forms this window may be shorter. |