Class: Google::Apis::SurveysV2::SurveyQuestion

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

Overview

Message defining the question specifications.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ SurveyQuestion

Returns a new instance of SurveyQuestion



435
436
437
# File 'generated/google/apis/surveys_v2/classes.rb', line 435

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

Instance Attribute Details

#answer_orderString

The randomization option for multiple choice and multi-select questions. If not specified, this option defaults to randomize. Corresponds to the JSON property answerOrder

Returns:

  • (String)


330
331
332
# File 'generated/google/apis/surveys_v2/classes.rb', line 330

def answer_order
  @answer_order
end

#answersArray<String>

Required list of answer options for a question. Corresponds to the JSON property answers

Returns:

  • (Array<String>)


335
336
337
# File 'generated/google/apis/surveys_v2/classes.rb', line 335

def answers
  @answers
end

#has_otherBoolean Also known as: has_other?

Option to allow open-ended text box for Single Answer and Multiple Answer question types. This can be used with SINGLE_ANSWER, SINGLE_ANSWER_WITH_IMAGE, MULTIPLE_ANSWERS, and MULTIPLE_ANSWERS_WITH_IMAGE question types. Corresponds to the JSON property hasOther

Returns:

  • (Boolean)


342
343
344
# File 'generated/google/apis/surveys_v2/classes.rb', line 342

def has_other
  @has_other
end

#high_value_labelString

For rating questions, the text for the higher end of the scale, such as 'Best'. For numeric questions, a string representing a floating-point that is the maximum allowed number for a response. Corresponds to the JSON property highValueLabel

Returns:

  • (String)


350
351
352
# File 'generated/google/apis/surveys_v2/classes.rb', line 350

def high_value_label
  @high_value_label
end

#imagesArray<Google::Apis::SurveysV2::SurveyQuestionImage>

Corresponds to the JSON property images



355
356
357
# File 'generated/google/apis/surveys_v2/classes.rb', line 355

def images
  @images
end

#last_answer_position_pinnedBoolean Also known as: last_answer_position_pinned?

Currently only support pinning an answer option to the last position. Corresponds to the JSON property lastAnswerPositionPinned

Returns:

  • (Boolean)


360
361
362
# File 'generated/google/apis/surveys_v2/classes.rb', line 360

def last_answer_position_pinned
  @last_answer_position_pinned
end

#low_value_labelString

For rating questions, the text for the lower end of the scale, such as 'Worst'. For numeric questions, a string representing a floating-point that is the minimum allowed number for a response. Corresponds to the JSON property lowValueLabel

Returns:

  • (String)


368
369
370
# File 'generated/google/apis/surveys_v2/classes.rb', line 368

def low_value_label
  @low_value_label
end

#must_pick_suggestionBoolean Also known as: must_pick_suggestion?

Option to force the user to pick one of the open text suggestions. This requires that suggestions are provided for this question. Corresponds to the JSON property mustPickSuggestion

Returns:

  • (Boolean)


374
375
376
# File 'generated/google/apis/surveys_v2/classes.rb', line 374

def must_pick_suggestion
  @must_pick_suggestion
end

#num_starsString

Number of stars to use for ratings questions. Corresponds to the JSON property numStars

Returns:

  • (String)


380
381
382
# File 'generated/google/apis/surveys_v2/classes.rb', line 380

def num_stars
  @num_stars
end

#open_text_placeholderString

Placeholder text for an open text question. Corresponds to the JSON property openTextPlaceholder

Returns:

  • (String)


385
386
387
# File 'generated/google/apis/surveys_v2/classes.rb', line 385

def open_text_placeholder
  @open_text_placeholder
end

#open_text_suggestionsArray<String>

A list of suggested answers for open text question auto-complete. This is only valid if single_line_response is true. Corresponds to the JSON property openTextSuggestions

Returns:

  • (Array<String>)


391
392
393
# File 'generated/google/apis/surveys_v2/classes.rb', line 391

def open_text_suggestions
  @open_text_suggestions
end

#questionString

Required question text shown to the respondent. Corresponds to the JSON property question

Returns:

  • (String)


396
397
398
# File 'generated/google/apis/surveys_v2/classes.rb', line 396

def question
  @question
end

#sentiment_textString

Used by the Rating Scale with Text question type. This text goes along with the question field that is presented to the respondent, and is the actual text that the respondent is asked to rate. Corresponds to the JSON property sentimentText

Returns:

  • (String)


403
404
405
# File 'generated/google/apis/surveys_v2/classes.rb', line 403

def sentiment_text
  @sentiment_text
end

#single_line_responseBoolean Also known as: single_line_response?

Option to allow multiple line open text responses instead of a single line response. Note that we don't show auto-complete suggestions with multiple line responses. Corresponds to the JSON property singleLineResponse

Returns:

  • (Boolean)


410
411
412
# File 'generated/google/apis/surveys_v2/classes.rb', line 410

def single_line_response
  @single_line_response
end

#threshold_answersArray<String>

The threshold/screener answer options, which will screen a user into the rest of the survey. These will be a subset of the answer option strings. Corresponds to the JSON property thresholdAnswers

Returns:

  • (Array<String>)


417
418
419
# File 'generated/google/apis/surveys_v2/classes.rb', line 417

def threshold_answers
  @threshold_answers
end

#typeString

Required field defining the question type. For details about configuring different type of questions, consult the question configuration guide. Corresponds to the JSON property type

Returns:

  • (String)


423
424
425
# File 'generated/google/apis/surveys_v2/classes.rb', line 423

def type
  @type
end

#unit_of_measurement_labelString

Optional unit of measurement for display (for example: hours, people, miles). Corresponds to the JSON property unitOfMeasurementLabel

Returns:

  • (String)


428
429
430
# File 'generated/google/apis/surveys_v2/classes.rb', line 428

def unit_of_measurement_label
  @unit_of_measurement_label
end

#video_idString

The YouTube video ID to be show in video questions. Corresponds to the JSON property videoId

Returns:

  • (String)


433
434
435
# File 'generated/google/apis/surveys_v2/classes.rb', line 433

def video_id
  @video_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'generated/google/apis/surveys_v2/classes.rb', line 440

def update!(**args)
  @answer_order = args[:answer_order] if args.key?(:answer_order)
  @answers = args[:answers] if args.key?(:answers)
  @has_other = args[:has_other] if args.key?(:has_other)
  @high_value_label = args[:high_value_label] if args.key?(:high_value_label)
  @images = args[:images] if args.key?(:images)
  @last_answer_position_pinned = args[:last_answer_position_pinned] if args.key?(:last_answer_position_pinned)
  @low_value_label = args[:low_value_label] if args.key?(:low_value_label)
  @must_pick_suggestion = args[:must_pick_suggestion] if args.key?(:must_pick_suggestion)
  @num_stars = args[:num_stars] if args.key?(:num_stars)
  @open_text_placeholder = args[:open_text_placeholder] if args.key?(:open_text_placeholder)
  @open_text_suggestions = args[:open_text_suggestions] if args.key?(:open_text_suggestions)
  @question = args[:question] if args.key?(:question)
  @sentiment_text = args[:sentiment_text] if args.key?(:sentiment_text)
  @single_line_response = args[:single_line_response] if args.key?(:single_line_response)
  @threshold_answers = args[:threshold_answers] if args.key?(:threshold_answers)
  @type = args[:type] if args.key?(:type)
  @unit_of_measurement_label = args[:unit_of_measurement_label] if args.key?(:unit_of_measurement_label)
  @video_id = args[:video_id] if args.key?(:video_id)
end