Class: Google::Apis::SurveysV2::SurveyQuestion
- Inherits:
-
Object
- Object
- Google::Apis::SurveysV2::SurveyQuestion
- 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
-
#answer_order ⇒ String
The randomization option for multiple choice and multi-select questions.
-
#answers ⇒ Array<String>
Required list of answer options for a question.
-
#has_other ⇒ Boolean
(also: #has_other?)
Option to allow open-ended text box for Single Answer and Multiple Answer question types.
-
#high_value_label ⇒ String
For rating questions, the text for the higher end of the scale, such as 'Best'.
-
#images ⇒ Array<Google::Apis::SurveysV2::SurveyQuestionImage>
Corresponds to the JSON property
images
. -
#last_answer_position_pinned ⇒ Boolean
(also: #last_answer_position_pinned?)
Currently only support pinning an answer option to the last position.
-
#low_value_label ⇒ String
For rating questions, the text for the lower end of the scale, such as 'Worst'.
-
#must_pick_suggestion ⇒ Boolean
(also: #must_pick_suggestion?)
Option to force the user to pick one of the open text suggestions.
-
#num_stars ⇒ String
Number of stars to use for ratings questions.
-
#open_text_placeholder ⇒ String
Placeholder text for an open text question.
-
#open_text_suggestions ⇒ Array<String>
A list of suggested answers for open text question auto-complete.
-
#question ⇒ String
Required question text shown to the respondent.
-
#sentiment_text ⇒ String
Used by the Rating Scale with Text question type.
-
#single_line_response ⇒ Boolean
(also: #single_line_response?)
Option to allow multiple line open text responses instead of a single line response.
-
#threshold_answers ⇒ Array<String>
The threshold/screener answer options, which will screen a user into the rest of the survey.
-
#type ⇒ String
Required field defining the question type.
-
#unit_of_measurement_label ⇒ String
Optional unit of measurement for display (for example: hours, people, miles).
-
#video_id ⇒ String
The YouTube video ID to be show in video questions.
Instance Method Summary collapse
-
#initialize(**args) ⇒ SurveyQuestion
constructor
A new instance of SurveyQuestion.
-
#update!(**args) ⇒ Object
Update properties of this object.
Methods included from Core::JsonObjectSupport
Methods included from Core::Hashable
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_order ⇒ String
The randomization option for multiple choice and multi-select questions. If
not specified, this option defaults to randomize.
Corresponds to the JSON property answerOrder
330 331 332 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 330 def answer_order @answer_order end |
#answers ⇒ Array<String>
Required list of answer options for a question.
Corresponds to the JSON property answers
335 336 337 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 335 def answers @answers end |
#has_other ⇒ Boolean 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
342 343 344 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 342 def has_other @has_other end |
#high_value_label ⇒ String
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
350 351 352 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 350 def high_value_label @high_value_label end |
#images ⇒ Array<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_pinned ⇒ Boolean Also known as: last_answer_position_pinned?
Currently only support pinning an answer option to the last position.
Corresponds to the JSON property lastAnswerPositionPinned
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_label ⇒ String
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
368 369 370 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 368 def low_value_label @low_value_label end |
#must_pick_suggestion ⇒ Boolean 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
374 375 376 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 374 def must_pick_suggestion @must_pick_suggestion end |
#num_stars ⇒ String
Number of stars to use for ratings questions.
Corresponds to the JSON property numStars
380 381 382 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 380 def num_stars @num_stars end |
#open_text_placeholder ⇒ String
Placeholder text for an open text question.
Corresponds to the JSON property openTextPlaceholder
385 386 387 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 385 def open_text_placeholder @open_text_placeholder end |
#open_text_suggestions ⇒ Array<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
391 392 393 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 391 def open_text_suggestions @open_text_suggestions end |
#question ⇒ String
Required question text shown to the respondent.
Corresponds to the JSON property question
396 397 398 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 396 def question @question end |
#sentiment_text ⇒ String
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
403 404 405 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 403 def sentiment_text @sentiment_text end |
#single_line_response ⇒ Boolean 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
410 411 412 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 410 def single_line_response @single_line_response end |
#threshold_answers ⇒ Array<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
417 418 419 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 417 def threshold_answers @threshold_answers end |
#type ⇒ String
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
423 424 425 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 423 def type @type end |
#unit_of_measurement_label ⇒ String
Optional unit of measurement for display (for example: hours, people, miles).
Corresponds to the JSON property unitOfMeasurementLabel
428 429 430 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 428 def unit_of_measurement_label @unit_of_measurement_label end |
#video_id ⇒ String
The YouTube video ID to be show in video questions.
Corresponds to the JSON property videoId
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 |