GamifiedQuiz component
Component Visuals
To unlock early access to the component Get Access
Installation
To use the GamifiedQuiz
component, you need to install the Quest Labs React SDK:
Open your terminal/command prompt.
Navigate to your project's root directory using the
cd
command if you're not already there.Run the following command to install the
quest-sdk
package using npm:
This command will download and install the package and its dependencies into your project.
Make sure your project has npm and Node.js installed, and that you have the necessary permissions to install packages in your project directory.
GamifiedQuiz Component Features
Interactive GamifiedQuiz: The component guides users through a sequence of screens, collects their responses, and provides customization options for a dynamic gamifiedQuiz experience.
Customization Options: You can customize various aspects of the GamifiedQuiz process, including colors, input styles, button sizes, font sizes, and more.
Data Collection: The component collects user responses, allowing you to set and update answers as users progress through the GamifiedQuiz flow.
Dynamic Content: Customize the content and appearance of GamifiedQuiz question section screens based on the
design
andheadingScreen
props.Integration with API: The component integrates with your API to retrieve gamifiedQuiz criteria and eligibility data, enhancing the user experience.
GamifiedQuiz Component Props
The GamifiedQuiz
component accepts a variety of props to configure and customize the gamifiedQuiz process:
Prop Name | Type | Required | Details |
---|---|---|---|
userId | string | required | The unique identifier for the user participating in the gamifiedQuiz process. |
token | string | required | An authentication token used for authorization. |
questId | string | required | The unique identifier for the gamifiedQuiz quest that defines the sequence of screens and questions. |
heading | string | optional | set the main heading |
showFooter | boolean | optional | true: show quest footer false: hide quest footer |
thanksPopUpFooter | boolean | optional | true: show footer false: hide footer |
uniqueUserId | string | optional | Unique user identifier. |
uniqueEmailId | string | optional | Unique email identifier. |
questionSections | array of arrays | optional | Specifies the layout of screens within the gamified process. |
sectionHeading | array of strings | optional | Defines the headings for each screen in the gamified process. |
sectionSubHeading | array of strings | optional | Defines the sub headings for each screen in the gamified process. |
feedbackContent | object | optional | To define the Heading and description of the submit page. |
getAnswers | function | optional | A callback function to retrieve user answers during the onboarding process. |
questionPerSection | number | optional | To define the number of questions in a section |
variation | boolean | optional | To enable variations |
customComponents | array | optional | An array of custom components to be included within the onboarding screens. |
customComponentPositions | number | optional | Defines the positions within the onboarding process where custom components can be inserted. |
setGamifiedQuiz | function | optional | Function to perform any task. |
gamifiedQuiz | boolean | optional | Boolean indicating whether the gamified is active or not. |
functionOnSubmit | function | optional | Function to be execute on submitting the questions. |
heading | string | optional | Heading of the component |
isV1Api | boolean | optional | To define the V1 api or not |
showFooter | true | optional | To show & hide the footer |
thanksPopUpFooter | boolean | optional | To show & hide the thanks pop up footer |
EmailError | object | optional | take two properties 1. text: string type 2. errorStyle: CSS property |
styleConfig | object | optional | An object containing CSS properties for styling various components within the onboarding process, including form, headings, descriptions, inputs, labels, buttons, single-choice options, multi-choice options, and progress bar. |
You can customize the UI with type of styleConfig would be
GamifiedQuiz Component Usage
To use the GamifiedQuiz
component in your React application, follow these steps:
Import the necessary components and dependencies:
Include the GamifiedQuiz
component within your application, passing the required and optional props:
Customize the onboarding experience by adjusting the props to meet your application's requirements.
Utilize the
getAnswers
andsetAnswer
functions to manage user responses and data collection.Integrate the
GamifiedQuiz
component with your API to retrieve relevant gmaifiedQuiz criteria and eligibility data.
By following these steps, you can seamlessly integrate and customize the GamifiedQuiz
component within your React application to create dynamic and interactive user gamifiedQuiz experiences.
Example Usage
Last updated