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



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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/whop_sdk/models/lesson.rb', line 135

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. Only
  #   visible to admins (users with courses:update permission)
  #
  #   @return [String, nil]
  required :correct_answer, String, nil?: true

  # @!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:)
  #   Some parameter documentations has been truncated, see
  #   {WhopSDK::Models::Lesson::AssessmentQuestion} for more details.
  #
  #   An assessment question in a course quiz or knowledge check
  #
  #   @param id [String] The ID of the assessment question
  #
  #   @param correct_answer [String, nil] The correct answer for the question. Used for short answer questions. Only visib
  #
  #   @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. Only visible to admins (users with
    #   courses:update permission)
    #
    #   @return [Boolean, nil]
    required :is_correct, WhopSDK::Internal::Type::Boolean, nil?: true

    # @!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:)
    #   Some parameter documentations has been truncated, see
    #   {WhopSDK::Models::Lesson::AssessmentQuestion::Option} for more details.
    #
    #   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, nil] Whether this option is a correct answer. Only visible to admins (users with cour
    #
    #   @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. Only visible to admins (users with courses:update permission)

Returns:

  • (String, nil)


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

required :correct_answer, String, nil?: true

#created_atTime

When the question was created

Returns:

  • (Time)


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

required :created_at, Time

#idString

The ID of the assessment question

Returns:

  • (String)


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

required :id, String

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

Optional image attachment for the question



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

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

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

The answer options for multiple choice/select questions



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

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

#orderInteger

The order of the question within its lesson

Returns:

  • (Integer)


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

required :order, Integer

#question_textString

The text of the question

Returns:

  • (String)


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

required :question_text, String

#question_typeSymbol, WhopSDK::Models::AssessmentQuestionTypes

The type of the question



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

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