quizzes

Description:
  • Interface to quiz related API calls
Source:
Interface to quiz related API calls

Methods

(inner) getQuizNextQuestion(quizId, parameters, userParametersopt, networkParametersopt) → {Promise}

Description:
  • Retrieve quiz question from Constructor.io API
Source:
See:
Example
constructorio.quizzes.getQuizNextQuestion('quizId', {
   answers: [[1,2],[1]],
   section: '123',
   quizVersionId: '123'
});
Parameters:
Name Type Attributes Description
quizId string The identifier of the quiz
parameters string Additional parameters to refine result set
Properties
Name Type Attributes Description
answers array An array of answers in the format [[1,2],[1]]
section string <optional>
Product catalog section
quizVersionId string <optional>
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 here
quizSessionId string <optional>
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 here
userParameters object <optional>
Parameters relevant to the user request
Properties
Name Type Attributes Description
sessionId number <optional>
Session ID, utilized to personalize results
clientId string <optional>
Client ID, utilized to personalize results
userId string <optional>
User ID, utilized to personalize results
segments Array.<string> <optional>
User segments
testCells object <optional>
User test cells
userIp string <optional>
Origin user IP, from client
userAgent string <optional>
Origin user agent, from client
networkParameters object <optional>
Parameters relevant to the network request
Properties
Name Type Attributes Description
timeout number <optional>
Request timeout (in milliseconds)
Returns:
Type
Promise

(inner) getQuizResults(quizId, parameters, userParametersopt, networkParametersopt) → {Promise}

Description:
  • Retrieve quiz recommendation and filter expression from Constructor.io API
Source:
See:
Example
constructorio.quizzes.getQuizResults('quizId', {
   answers: [[1,2],[1]],
   section: '123',
   quizVersionId: '123'
});
Parameters:
Name Type Attributes Description
quizId string The identifier of the quiz
parameters string Additional parameters to refine result set
Properties
Name Type Attributes Description
answers array An array of answers in the format [[1,2],[1]]
section string <optional>
Product catalog section
quizVersionId string <optional>
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 here
quizSessionId string <optional>
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 here
userParameters object <optional>
Parameters relevant to the user request
Properties
Name Type Attributes Description
sessionId number <optional>
Session ID, utilized to personalize results
clientId string <optional>
Client ID, utilized to personalize results
userId string <optional>
User ID, utilized to personalize results
segments Array.<string> <optional>
User segments
testCells object <optional>
User test cells
userIp string <optional>
Origin user IP, from client
userAgent string <optional>
Origin user agent, from client
networkParameters object <optional>
Parameters relevant to the network request
Properties
Name Type Attributes Description
timeout number <optional>
Request timeout (in milliseconds)
Returns:
Type
Promise