Class: WhopSDK::Models::Lesson::AssessmentQuestion

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/lesson.rb

Defined Under Namespace

Classes: Image, Option

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id: , content_type: , filename: , url: ) ⇒ Object

Some parameter documentations has been truncated, see Image for more details.

Optional image attachment for the question

Parameters:

  • id (String) (defaults to: )

    The ID of the attachment

  • content_type (String, nil) (defaults to: )

    The attachment’s content type (e.g., image/jpg, video/mp4)

  • filename (String, nil) (defaults to: )

    The name of the file

  • url (String, nil) (defaults to: )

    This is the URL you use to render optimized attachments on the client. This shou



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# File 'lib/whop_sdk/models/lesson.rb', line 103

class AssessmentQuestion < WhopSDK::Internal::Type::BaseModel
  # @!attribute id
  #   The ID of the assessment question
  #
  #   @return [String]
  required :id, String

  # @!attribute correct_answer
  #   The correct answer for the question. Used for short answer questions
  #
  #   @return [String]
  required :correct_answer, String

  # @!attribute created_at
  #   When the question was created
  #
  #   @return [Time]
  required :created_at, Time

  # @!attribute image
  #   Optional image attachment for the question
  #
  #   @return [WhopSDK::Models::Lesson::AssessmentQuestion::Image, nil]
  required :image, -> { WhopSDK::Lesson::AssessmentQuestion::Image }, nil?: true

  # @!attribute options
  #   The answer options for multiple choice/select questions
  #
  #   @return [Array<WhopSDK::Models::Lesson::AssessmentQuestion::Option>]
  required :options, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Lesson::AssessmentQuestion::Option] }

  # @!attribute order
  #   The order of the question within its lesson
  #
  #   @return [Integer]
  required :order, Integer

  # @!attribute question_text
  #   The text of the question
  #
  #   @return [String]
  required :question_text, String

  # @!attribute question_type
  #   The type of the question
  #
  #   @return [Symbol, WhopSDK::Models::AssessmentQuestionTypes]
  required :question_type, enum: -> { WhopSDK::AssessmentQuestionTypes }

  # @!method initialize(id:, correct_answer:, created_at:, image:, options:, order:, question_text:, question_type:)
  #   An assessment question in a course quiz or knowledge check
  #
  #   @param id [String] The ID of the assessment question
  #
  #   @param correct_answer [String] The correct answer for the question. Used for short answer questions
  #
  #   @param created_at [Time] When the question was created
  #
  #   @param image [WhopSDK::Models::Lesson::AssessmentQuestion::Image, nil] Optional image attachment for the question
  #
  #   @param options [Array<WhopSDK::Models::Lesson::AssessmentQuestion::Option>] The answer options for multiple choice/select questions
  #
  #   @param order [Integer] The order of the question within its lesson
  #
  #   @param question_text [String] The text of the question
  #
  #   @param question_type [Symbol, WhopSDK::Models::AssessmentQuestionTypes] The type of the question

  # @see WhopSDK::Models::Lesson::AssessmentQuestion#image
  class Image < WhopSDK::Internal::Type::BaseModel
    # @!attribute id
    #   The ID of the attachment
    #
    #   @return [String]
    required :id, String

    # @!attribute content_type
    #   The attachment's content type (e.g., image/jpg, video/mp4)
    #
    #   @return [String, nil]
    required :content_type, String, nil?: true

    # @!attribute filename
    #   The name of the file
    #
    #   @return [String, nil]
    required :filename, String, nil?: true

    # @!attribute url
    #   This is the URL you use to render optimized attachments on the client. This
    #   should be used for apps.
    #
    #   @return [String, nil]
    required :url, String, nil?: true

    # @!method initialize(id:, content_type:, filename:, url:)
    #   Some parameter documentations has been truncated, see
    #   {WhopSDK::Models::Lesson::AssessmentQuestion::Image} for more details.
    #
    #   Optional image attachment for the question
    #
    #   @param id [String] The ID of the attachment
    #
    #   @param content_type [String, nil] The attachment's content type (e.g., image/jpg, video/mp4)
    #
    #   @param filename [String, nil] The name of the file
    #
    #   @param url [String, nil] This is the URL you use to render optimized attachments on the client. This shou
  end

  class Option < WhopSDK::Internal::Type::BaseModel
    # @!attribute id
    #   The ID of the assessment question option
    #
    #   @return [String]
    required :id, String

    # @!attribute is_correct
    #   Whether this option is a correct answer
    #
    #   @return [Boolean]
    required :is_correct, WhopSDK::Internal::Type::Boolean

    # @!attribute option_text
    #   The text of the answer option
    #
    #   @return [String]
    required :option_text, String

    # @!attribute order
    #   The order of this option within the question
    #
    #   @return [Integer]
    required :order, Integer

    # @!method initialize(id:, is_correct:, option_text:, order:)
    #   An answer option for a multiple choice or multiple select assessment question
    #
    #   @param id [String] The ID of the assessment question option
    #
    #   @param is_correct [Boolean] Whether this option is a correct answer
    #
    #   @param option_text [String] The text of the answer option
    #
    #   @param order [Integer] The order of this option within the question
  end
end

Instance Attribute Details

#correct_answerString

The correct answer for the question. Used for short answer questions

Returns:

  • (String)


114
# File 'lib/whop_sdk/models/lesson.rb', line 114

required :correct_answer, String

#created_atTime

When the question was created

Returns:

  • (Time)


120
# File 'lib/whop_sdk/models/lesson.rb', line 120

required :created_at, Time

#idString

The ID of the assessment question

Returns:

  • (String)


108
# File 'lib/whop_sdk/models/lesson.rb', line 108

required :id, String

#imageWhopSDK::Models::Lesson::AssessmentQuestion::Image?

Optional image attachment for the question



126
# File 'lib/whop_sdk/models/lesson.rb', line 126

required :image, -> { WhopSDK::Lesson::AssessmentQuestion::Image }, nil?: true

#optionsArray<WhopSDK::Models::Lesson::AssessmentQuestion::Option>

The answer options for multiple choice/select questions



132
# File 'lib/whop_sdk/models/lesson.rb', line 132

required :options, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Lesson::AssessmentQuestion::Option] }

#orderInteger

The order of the question within its lesson

Returns:

  • (Integer)


138
# File 'lib/whop_sdk/models/lesson.rb', line 138

required :order, Integer

#question_textString

The text of the question

Returns:

  • (String)


144
# File 'lib/whop_sdk/models/lesson.rb', line 144

required :question_text, String

#question_typeSymbol, WhopSDK::Models::AssessmentQuestionTypes

The type of the question



150
# File 'lib/whop_sdk/models/lesson.rb', line 150

required :question_type, enum: -> { WhopSDK::AssessmentQuestionTypes }