Class: Google::Apis::FormsV1::ChoiceQuestion

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

A radio/checkbox/dropdown question.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ ChoiceQuestion

Returns a new instance of ChoiceQuestion.



153
154
155
# File 'lib/google/apis/forms_v1/classes.rb', line 153

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

Instance Attribute Details

#optionsArray<Google::Apis::FormsV1::Option>

Required. List of options that a respondent must choose from. Corresponds to the JSON property options

Returns:



136
137
138
# File 'lib/google/apis/forms_v1/classes.rb', line 136

def options
  @options
end

#shuffleBoolean Also known as: shuffle?

Whether the options should be displayed in random order for different instances of the quiz. This is often used to prevent cheating by respondents who might be looking at another respondent's screen, or to address bias in a survey that might be introduced by always putting the same options first or last. Corresponds to the JSON property shuffle

Returns:

  • (Boolean)


145
146
147
# File 'lib/google/apis/forms_v1/classes.rb', line 145

def shuffle
  @shuffle
end

#typeString

Required. The type of choice question. Corresponds to the JSON property type

Returns:

  • (String)


151
152
153
# File 'lib/google/apis/forms_v1/classes.rb', line 151

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



158
159
160
161
162
# File 'lib/google/apis/forms_v1/classes.rb', line 158

def update!(**args)
  @options = args[:options] if args.key?(:options)
  @shuffle = args[:shuffle] if args.key?(:shuffle)
  @type = args[:type] if args.key?(:type)
end