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.



1239
1240
1241
# File 'lib/google/apis/forms_v1/classes.rb', line 1239

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



1183
1184
1185
# File 'lib/google/apis/forms_v1/classes.rb', line 1183

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



1188
1189
1190
# File 'lib/google/apis/forms_v1/classes.rb', line 1188

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



1194
1195
1196
# File 'lib/google/apis/forms_v1/classes.rb', line 1194

def file_upload_question
  @file_upload_question
end

#gradingGoogle::Apis::FormsV1::Grading

Grading for a single question Corresponds to the JSON property grading



1199
1200
1201
# File 'lib/google/apis/forms_v1/classes.rb', line 1199

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)


1205
1206
1207
# File 'lib/google/apis/forms_v1/classes.rb', line 1205

def question_id
  @question_id
end

#rating_questionGoogle::Apis::FormsV1::RatingQuestion

A rating question. The user has a range of icons to choose from. Corresponds to the JSON property ratingQuestion



1210
1211
1212
# File 'lib/google/apis/forms_v1/classes.rb', line 1210

def rating_question
  @rating_question
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)


1216
1217
1218
# File 'lib/google/apis/forms_v1/classes.rb', line 1216

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



1222
1223
1224
# File 'lib/google/apis/forms_v1/classes.rb', line 1222

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



1227
1228
1229
# File 'lib/google/apis/forms_v1/classes.rb', line 1227

def scale_question
  @scale_question
end

#text_questionGoogle::Apis::FormsV1::TextQuestion

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



1232
1233
1234
# File 'lib/google/apis/forms_v1/classes.rb', line 1232

def text_question
  @text_question
end

#time_questionGoogle::Apis::FormsV1::TimeQuestion

A time question. Corresponds to the JSON property timeQuestion



1237
1238
1239
# File 'lib/google/apis/forms_v1/classes.rb', line 1237

def time_question
  @time_question
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
# File 'lib/google/apis/forms_v1/classes.rb', line 1244

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)
  @rating_question = args[:rating_question] if args.key?(:rating_question)
  @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