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
539 540 541 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 539 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
434 435 436 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 434 def answer_order @answer_order end |
#answers ⇒ Array<String>
Required list of answer options for a question.
Corresponds to the JSON property answers
439 440 441 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 439 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
446 447 448 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 446 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
454 455 456 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 454 def high_value_label @high_value_label end |
#images ⇒ Array<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_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
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_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
472 473 474 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 472 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
478 479 480 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 478 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
484 485 486 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 484 def num_stars @num_stars end |
#open_text_placeholder ⇒ String
Placeholder text for an open text question.
Corresponds to the JSON property openTextPlaceholder
489 490 491 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 489 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
495 496 497 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 495 def open_text_suggestions @open_text_suggestions end |
#question ⇒ String
Required question text shown to the respondent.
Corresponds to the JSON property question
500 501 502 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 500 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
507 508 509 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 507 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
514 515 516 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 514 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
521 522 523 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 521 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
527 528 529 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 527 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
532 533 534 |
# File 'generated/google/apis/surveys_v2/classes.rb', line 532 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
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 |