getQuizNextQuestion

fun getQuizNextQuestion(    quizId: String,     answers: List<List<String>>? = null,     quizVersionId: String? = null,     quizSessionId: String? = null,     sectionName: String? = null): Observable<ConstructorData<QuizQuestionResponse>>

Returns the next quiz question including options and attributes.

Example:

val answers = listOf(
listOf("1"),
listOf("1", "2"),
listOf("true"),
listOf("seen"),
)
ConstructorIo.getQuizNextQuestion("quiz-id", answers, "version-id")

Parameters

quizId

id of the quiz you want to retrieve

answers

list of answers to send

quizVersionId

version identifier for the quiz. version ID will be returned with the first request and it should be passed with subsequent requests. more information can be found: https://docs.constructor.com/reference/configuration-quizzes

quizSessionId

session identifier for the quiz. session ID will be returned with the first request and it should be passed with subsequent requests. more information can be found: https://docs.constructor.com/reference/configuration-quizzes

sectionName

the section the quiz and results come from. defaults to "Products"


fun getQuizNextQuestion(request: QuizRequest): Observable<ConstructorData<QuizQuestionResponse>>

Returns the next quiz question including options and attributes utilizing a request object.

Example:

val answers = listOf(
listOf("1"),
listOf("1", "2"),
listOf("true"),
listOf("seen"),
)
val request = QuizRequest.Builder("quiz-id")
.setAnswers(answers)
.setVersionId("version-id")
.build()
ConstructorIo.getQuizNextQuestion(request)

Parameters

request

the quiz request object