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



539
540
541
# File 'generated/google/apis/surveys_v2/classes.rb', line 539

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)


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

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>)


439
440
441
# File 'generated/google/apis/surveys_v2/classes.rb', line 439

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)


446
447
448
# File 'generated/google/apis/surveys_v2/classes.rb', line 446

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)


454
455
456
# File 'generated/google/apis/surveys_v2/classes.rb', line 454

def high_value_label
  @high_value_label
end

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

Corresponds to the JSON property images



459
460
461
# File 'generated/google/apis/surveys_v2/classes.rb', line 459

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)


464
465
466
# File 'generated/google/apis/surveys_v2/classes.rb', line 464

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)


472
473
474
# File 'generated/google/apis/surveys_v2/classes.rb', line 472

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)


478
479
480
# File 'generated/google/apis/surveys_v2/classes.rb', line 478

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)


484
485
486
# File 'generated/google/apis/surveys_v2/classes.rb', line 484

def num_stars
  @num_stars
end

#open_text_placeholderString

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

Returns:

  • (String)


489
490
491
# File 'generated/google/apis/surveys_v2/classes.rb', line 489

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>)


495
496
497
# File 'generated/google/apis/surveys_v2/classes.rb', line 495

def open_text_suggestions
  @open_text_suggestions
end

#questionString

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

Returns:

  • (String)


500
501
502
# File 'generated/google/apis/surveys_v2/classes.rb', line 500

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)


507
508
509
# File 'generated/google/apis/surveys_v2/classes.rb', line 507

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)


514
515
516
# File 'generated/google/apis/surveys_v2/classes.rb', line 514

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>)


521
522
523
# File 'generated/google/apis/surveys_v2/classes.rb', line 521

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)


527
528
529
# File 'generated/google/apis/surveys_v2/classes.rb', line 527

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)


532
533
534
# File 'generated/google/apis/surveys_v2/classes.rb', line 532

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)


537
538
539
# File 'generated/google/apis/surveys_v2/classes.rb', line 537

def video_id
  @video_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'generated/google/apis/surveys_v2/classes.rb', line 544

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