Class: Google::Apis::FormsV1::CorrectAnswers

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

The answer key for a question.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CorrectAnswers

Returns a new instance of CorrectAnswers.



220
221
222
# File 'lib/google/apis/forms_v1/classes.rb', line 220

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

Instance Attribute Details

#answersArray<Google::Apis::FormsV1::CorrectAnswer>

A list of correct answers. A quiz response can be automatically graded based on these answers. For single-valued questions, a response is marked correct if it matches any value in this list (in other words, multiple correct answers are possible). For multiple-valued (CHECKBOX) questions, a response is marked correct if it contains exactly the values in this list. Corresponds to the JSON property answers



218
219
220
# File 'lib/google/apis/forms_v1/classes.rb', line 218

def answers
  @answers
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



225
226
227
# File 'lib/google/apis/forms_v1/classes.rb', line 225

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