StoryQuizComponent
@objc(StoryQuizComponent)
public final class StoryQuizComponent : StoryComponent
This class represents the Quiz component.
-
Title of the quiz if exists
Declaration
Swift
@objc public let title: String
-
List of options in the quiz
Declaration
Swift
@objc public let options: [String]
-
Index of the right answer if exists
Declaration
Swift
@objc public let rightAnswerIndex: NSNumber?
-
Option index that the user selected
Declaration
Swift
@objc public let selectedOptionIndex: Int
-
StoryQuizComponent initialization
Declaration
Swift
@objc public init(id: String, title: String, options: [String], rightAnswerIndex: NSNumber?, selectedOptionIndex: Int, customPayload: String?)
Parameters
id
Id of the interactive component
title
Title of the quiz if exists
options
List of options in the quiz
rightAnswerIndex
Index of the right answer if exists
selectedOptionIndex
Option index that the user selected
customPayload
Custom payload for this quiz if exists