Class: Google::Apis::FormsV1::Question

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/forms_v1/classes.rb,
lib/google/apis/forms_v1/representations.rb,
lib/google/apis/forms_v1/representations.rb

Overview

Any question. The specific type of question is known by its kind.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Question

Returns a new instance of Question.



1171
1172
1173
# File 'lib/google/apis/forms_v1/classes.rb', line 1171

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#choice_questionGoogle::Apis::FormsV1::ChoiceQuestion

A radio/checkbox/dropdown question. Corresponds to the JSON property choiceQuestion



1120
1121
1122
# File 'lib/google/apis/forms_v1/classes.rb', line 1120

def choice_question
  @choice_question
end

#date_questionGoogle::Apis::FormsV1::DateQuestion

A date question. Date questions default to just month + day. Corresponds to the JSON property dateQuestion



1125
1126
1127
# File 'lib/google/apis/forms_v1/classes.rb', line 1125

def date_question
  @date_question
end

#file_upload_questionGoogle::Apis::FormsV1::FileUploadQuestion

A file upload question. The API currently does not support creating file upload questions. Corresponds to the JSON property fileUploadQuestion



1131
1132
1133
# File 'lib/google/apis/forms_v1/classes.rb', line 1131

def file_upload_question
  @file_upload_question
end

#gradingGoogle::Apis::FormsV1::Grading

Grading for a single question Corresponds to the JSON property grading



1136
1137
1138
# File 'lib/google/apis/forms_v1/classes.rb', line 1136

def grading
  @grading
end

#question_idString

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. Corresponds to the JSON property questionId

Returns:

  • (String)


1142
1143
1144
# File 'lib/google/apis/forms_v1/classes.rb', line 1142

def question_id
  @question_id
end

#requiredBoolean Also known as: required?

Whether the question must be answered in order for a respondent to submit their response. Corresponds to the JSON property required

Returns:

  • (Boolean)


1148
1149
1150
# File 'lib/google/apis/forms_v1/classes.rb', line 1148

def required
  @required
end

#row_questionGoogle::Apis::FormsV1::RowQuestion

Configuration for a question that is part of a question group. Corresponds to the JSON property rowQuestion



1154
1155
1156
# File 'lib/google/apis/forms_v1/classes.rb', line 1154

def row_question
  @row_question
end

#scale_questionGoogle::Apis::FormsV1::ScaleQuestion

A scale question. The user has a range of numeric values to choose from. Corresponds to the JSON property scaleQuestion



1159
1160
1161
# File 'lib/google/apis/forms_v1/classes.rb', line 1159

def scale_question
  @scale_question
end

#text_questionGoogle::Apis::FormsV1::TextQuestion

A text-based question. Corresponds to the JSON property textQuestion



1164
1165
1166
# File 'lib/google/apis/forms_v1/classes.rb', line 1164

def text_question
  @text_question
end

#time_questionGoogle::Apis::FormsV1::TimeQuestion

A time question. Corresponds to the JSON property timeQuestion



1169
1170
1171
# File 'lib/google/apis/forms_v1/classes.rb', line 1169

def time_question
  @time_question
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
# File 'lib/google/apis/forms_v1/classes.rb', line 1176

def update!(**args)
  @choice_question = args[:choice_question] if args.key?(:choice_question)
  @date_question = args[:date_question] if args.key?(:date_question)
  @file_upload_question = args[:file_upload_question] if args.key?(:file_upload_question)
  @grading = args[:grading] if args.key?(:grading)
  @question_id = args[:question_id] if args.key?(:question_id)
  @required = args[:required] if args.key?(:required)
  @row_question = args[:row_question] if args.key?(:row_question)
  @scale_question = args[:scale_question] if args.key?(:scale_question)
  @text_question = args[:text_question] if args.key?(:text_question)
  @time_question = args[:time_question] if args.key?(:time_question)
end