Questera AI
  • Getting Started
    • Welcome to Questera Documentation
      • Overview of Questera
      • Why Choose Questera ?
      • Key Features & Benefits
      • How does it work?
  • Questera AI Platform
    • Data
      • Connect Data & Models
        • Data Ingestion
          • Snowflake
          • Amazon Redshift
          • Google BigQuery
          • Microsoft Azure
          • CSV
          • ESP (Email Service Provider)
          • CRM
        • Configure Models
          • Open AI
    • Dataset
      • Connecting an external data source
      • Uploading your own file
    • Campaigns
      • Channels Supported in Questera
        • UI Campaigns
        • Email Campaigns
        • SMS Campaigns
        • Push Notifications Campaigns
        • In-App Messages Campaigns
        • WhatsApp Campaigns
      • Campaigns in Questera: Drive Growth Across Every Touchpoint
      • Omnichannel Marketing with Questera AI
      • Why Questera’s AI-Driven Approach Wins?
    • Scores & Signals
    • Audience & segment
      • How to work with Users List
      • Create and Manage Segments
      • AI Audience Segments
    • AI Agents
      • What are AI Agents?
      • Types of AI Agents
        • ELMA - Email Lifecycle Marketing Agent
        • GRETA - Growth Engineering Agent
        • SEGA - Intelligent Segmentation Agent
        • OMNIA - Omni-Channel Journey Creator Agent
        • GIA - Data Analysis & Graphical Interpretation Agent
        • SARA - Smart Ads Retargeting Agent
        • BECCA - Personalized Email Content Agent
        • LEXA - Language Optimization Agent
      • Create & Configure an Agents
        • Create your own marketing agents
        • Chat with Agents
    • Analytics & Reporting
      • Analytics
        • Overview of Analytics.
          • Dashboard Walkthrough
          • Add dashboard
          • Chat with data
    • Playground
      • Simulating User Interactions.
        • Test and Run Campaigns
    • AI Variants
    • Journeys
      • How to Create a Journey
    • Track & Measurements
      • In-App Events
        • How to create and manage an in-App Event
      • Webhook & Alerts
        • How to create and manage Webhook & alters
      • User Attributes
        • How to create a user attribute
      • Feature Flags
        • How to add a feature flag
      • Signal
        • How to add signal
      • Counters
        • How to create and manage counter
    • Workflow
      • How to Create a Workflow in Questera
    • AI Flows
    • Settings in Questera
  • Questera AI SDKs
    • SDK Component Categories
      • Onboarding
      • Engagement
      • User Assistance
      • Expansion
      • Miscellaneous
    • All Components
      • Onboarding
        • Onboarding Quiz
        • Login Component
      • Gamified Engagement
        • Rewards & Loyalty Component
        • Challenges
        • Leaderboard
        • Badges
        • Spin The Wheel
        • Scratch The Card
        • Gamified Quiz
        • Streaks
        • Dynamic Membership
      • Education
        • User Guides
        • Tooltips
        • AI Help Hub & Assistant
      • Popups
        • Special Offers
        • Upsells & Cross Sells
        • Product Recommendations
        • Celebrations
        • Alerts
      • AI Search
      • User Feedback
      • Surveys
      • Referrals
      • Banners
      • Pricing & Payments
      • Embedded Analytics
    • React SDK Components
      • Onboarding
        • Onboarding Component
        • Get Started Component
        • Tutorial/Quest List Component
        • Walk Through Component
      • Gamification
        • Challenges Component
        • DailyStreak Component
        • Leaderboard Component
        • GamifiedQuiz component
      • User Assistance
        • Feedback Workflow Component
        • Inline Feedback Component
        • Survey Component
        • Search Bar Component
        • Help Hub Component
        • CreditsPopup Component
      • Expansion
        • Referral Components
        • Cross-Selling Component
      • Miscellaneous
        • Confetti Component
        • Alert Component
        • Login Component
        • One to one Survey Component
        • Pricing & Payment Component
        • Badge Component
        • Toast Service
      • Survey
        • User Experience Feedback Survey
        • Feature Usage Survey
        • Customer Satisfaction Surveyy
        • Net Promoter Score
        • Onboarding Experience Survey
        • Customer Support Satisfaction Survey
      • Embedded Analytics
        • Line Chart
        • Scatter Chart
        • Combo Bar/Line
        • Stacked Bar Chart
        • Horizontal Bar Chart
        • Stepped Line Chart
        • Pie chart
        • Doughnut Chart
        • Multi Series Pie
        • Bubble Chart
        • Floating Bar Chart
    • React Native SDK Components
      • Onboarding
        • Embedded Onboarding ToolTip
        • Announcement Banners
        • Onboarding Component
        • Get Started Component
        • Quest List Component
      • Gamification
        • Challenges Component
        • Daily Streak Component
        • Leaderboard Component
        • Quiz component
      • User Assistance
        • HelpHub
        • Feedback Workflow Component
        • General Feedback Component
        • Inline Feedback Component
        • Credits Popup Component
      • Expansion
        • Cross-Selling
        • Share With friends
        • Referral
      • Miscellaneous
        • Spotlight Searc
        • Modal
        • Login Component
        • Membership Card
        • Badges
        • Pricing
        • Survey Form
        • Banner
        • Carousel
        • Tutorial
        • Daily Check-in Credit
    • No Code SDK Components
      • HelpHub
      • Feedback Workflow Component
    • Flutter SDK Components
      • Onboarding
        • Onboarding Quiz - Multi page Component
        • Onboarding Quiz - Single page Component
        • Get Started Component
        • Tutorial/Quest List Component
      • User Assistance
        • Feedback Workflow
        • Help Hub Component
        • Inline Feedback Component
        • Spotlight Search Component
        • Survey component
      • Gamification
        • Daily Streak Component
        • Leaderboard Component
        • Gamified Quiz Component
      • Expansion
        • Referral Component
        • Cross-Selling Component
      • General Components
        • Login Component
    • Rest APIs
      • Data Module
        • Data Object
      • Entity Module
        • Entity Object
      • User Module
        • User Object
      • Gamification
        • Badge Object
        • Web3 Module
          • Dynamic NFT Object
        • Skills Module
          • Skills Object
        • Levels Module
          • Levels Object
  • Integrations
    • Email
      • Mailchimp
      • Klaviyo
      • Mailmodo
      • Mailjet
      • Brevo (SendInBlue)
      • Constant Contact
      • Elastic Email
      • ApolloIo
      • Google OAuth
      • Instantly
      • Loops
      • AWS SES
      • SendGrid
      • Hubspot
      • Activecampaign
      • One Signal
      • Attio
    • Customer data platforms
      • Segment
      • Shopify
      • Salesforce
    • Workflow automation & ETLs
      • Zapier
    • Analytics & business intelligence
      • Mixpanel
      • Amplitude
      • Heap
      • Posthog
      • Snowflake
      • Google BigQuery
      • Clay
      • Outreach
      • Salesloft
      • Smartlead
    • Data ware house
      • Redshift
      • Microsoft Azure
    • Task management
      • Clickup
      • Jira
    • FAQ
  • recipes
    • Greta
      • SaaS Subscription
        • Activation
        • Conversion
        • Retention
      • SaaS Credit-Based
        • Activation
        • Conversion
        • Retention
        • Engagement
      • Ed-Tech
        • Activation
        • Conversion
        • Retention
        • Engagement
      • Gaming Apps
        • Activation
        • Conversion
        • Retention
        • Engagement
      • E-Commerce
        • Activation
        • Conversion
        • Retention
    • Elma
      • SaaS Subscription
        • Activation
        • Conversion
        • Retention
        • Engagement
      • SaaS Credit-Based
        • Activation
        • Conversion
        • Retention
        • Engagement
      • E-Commerce
        • Activation
        • Conversion
        • Retention
        • Engagement
  • GRETA
    • How to create your first project using Greta?
    • Playground
Powered by GitBook
On this page
  • Component Visuals
  • Installation
  • GamifiedQuiz Component Props
  • Example Usage
  1. Questera AI SDKs
  2. React SDK Components
  3. Gamification

GamifiedQuiz component

PreviousLeaderboard ComponentNextUser Assistance

Last updated 3 months ago

Component Visuals

To unlock early access to the component

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:

npm install @questlabs/react-sdk

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

  1. Interactive GamifiedQuiz: The component guides users through a sequence of screens, collects their responses, and provides customization options for a dynamic gamifiedQuiz experience.

  2. Customization Options: You can customize various aspects of the GamifiedQuiz process, including colors, input styles, button sizes, font sizes, and more.

  3. Data Collection: The component collects user responses, allowing you to set and update answers as users progress through the GamifiedQuiz flow.

  4. Dynamic Content: Customize the content and appearance of GamifiedQuiz question section screens based on the design and headingScreen props.

  5. 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

 styleConfig?: {
        Form?: CSSProperties,
        IconColor?: CSSProperties,
        LabelColor?: CSSProperties,
        EmailError?: {
            errorStyle?: CSSProperties,
            text?: string,
        }
        Heading?: CSSProperties,
        FormContainer?: CSSProperties,
        Question?: CSSProperties,
        SubHeading?: CSSProperties,
        Input?: CSSProperties,
        PrimaryButton?: CSSProperties,
        SecondaryButton?: CSSProperties,
        Footer? : CSSProperties,
        TextArea? : CSSProperties,
        ThanksPopup?: CSSProperties,
        ThanksPopupHeading?: CSSProperties,
        ThanksPopupDescription?: CSSProperties,
        ThanksPopupFooter?: CSSProperties,
        ThanksPopupGotoHome?: CSSProperties,
        OptionsSelectedColor?: CSSProperties,
    }

GamifiedQuiz Component Usage

To use the GamifiedQuiz component in your React application, follow these steps:

Import the necessary components and dependencies:

import { GamifiedQuiz } from '@questLabs/react-sdk';
import '@questlabs/react-sdk/dist/style.css'
import { GamifiedQuiz } from '@questLabs/react-sdk/offline';

Include the GamifiedQuiz component within your application, passing the required and optional props:

<GamifiedQuiz
  userId={"/* User ID */"}
  token={"/* Authentication token */"}
  questId={"/* Onboarding quest ID */"}
  uniqueUserId={"/* Unique User Id  */"}
  uniqueEmailId={"/* Unique Email Id */"} 
  questionSections={"/* Specify the layout of questions */"}  
  sectionHeading={"/* Specify the section headings */"}
  sectionSubHeading={"/* Specify the section sub headings */"}
  feedbackContent={"/* Specify the Heading & subheading of feedback*/"}
  questionPerSection={"/* Specify the number of question per section  */"}
  variation={"/* Specify the variation enable or disable */"}
  setGamifiedQuiz={"/* Specify the function */"}
  gamifiedQuiz={"/* Specify the Component enable or disable */"}
  functionOnSubmit={"/* Specify the function executes on submit */"}
  heading={"/* Define screen headings */"}
  isV1Api={"/* Specify the V1 Api or not */"}
  showFooter={"/* Specify the Footer enable or disable */"}
  thanksPopUpFooter={"/* Specify the Thanks pop up Footer enable or disable */"}
  
  styleConfig?: {{
        Form?: CSSProperties,
        IconColor?: CSSProperties,
        LabelColor?: CSSProperties,
        EmailError?: {
            errorStyle?: CSSProperties,
            text?: string,
        }
        Heading?: CSSProperties,
        FormContainer?: CSSProperties,
        Question?: CSSProperties,
        SubHeading?: CSSProperties,
        Input?: CSSProperties,
        PrimaryButton?: CSSProperties,
        SecondaryButton?: CSSProperties,
        Footer? : CSSProperties,
        TextArea? : CSSProperties,
        ThanksPopup?: CSSProperties,
        ThanksPopupHeading?: CSSProperties,
        ThanksPopupDescription?: CSSProperties,
        ThanksPopupFooter?: CSSProperties,
        ThanksPopupGotoHome?: CSSProperties,
        OptionsSelectedColor?: CSSProperties,
    }}

/>

<GamifiedQuiz
  uniqueUserId={"/* Unique User Id  */"}
  uniqueEmailId={"/* Unique Email Id */"} 
  questionSections={"/* Specify the layout of questions */"}  
  sectionHeading={"/* Specify the section headings */"}
  sectionSubHeading={"/* Specify the section sub headings */"}
  feedbackContent={"/* Specify the Heading & subheading of feedback*/"}
  questionPerSection={"/* Specify the number of question per section  */"}
  variation={"/* Specify the variation enable or disable */"}
  setGamifiedQuiz={"/* Specify the function */"}
  gamifiedQuiz={"/* Specify the Component enable or disable */"}
  functionOnSubmit={"/* Specify the function executes on submit */"}
  heading={"/* Define screen headings */"}
  isV1Api={"/* Specify the V1 Api or not */"}
  showFooter={"/* Specify the Footer enable or disable */"}
  thanksPopUpFooter={"/* Specify the Thanks pop up Footer enable or disable */"}
  styleConfig={{
        Form?: CSSProperties,
        IconColor?: CSSProperties,
        LabelColor?: CSSProperties,
        EmailError?: {
            errorStyle?: CSSProperties,
            text?: string,
        }
        Heading?: CSSProperties,
        FormContainer?: CSSProperties,
        Question?: CSSProperties,
        SubHeading?: CSSProperties,
        Input?: CSSProperties,
        PrimaryButton?: CSSProperties,
        SecondaryButton?: CSSProperties,
        Footer? : CSSProperties,
        TextArea? : CSSProperties,
        ThanksPopup?: CSSProperties,
        ThanksPopupHeading?: CSSProperties,
        ThanksPopupDescription?: CSSProperties,
        ThanksPopupFooter?: CSSProperties,
        ThanksPopupGotoHome?: CSSProperties,
        OptionsSelectedColor?: CSSProperties,
    }}
  offlineFormData={/* Action fields */}
/>
  1. Customize the onboarding experience by adjusting the props to meet your application's requirements.

  2. Utilize the getAnswers and setAnswer functions to manage user responses and data collection.

  3. 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

import React, { useState } from 'react';
import { QuestProvider, GamifiedQuiz } from '@questlabs/react-sdk';
import '@questlabs/react-sdk/dist/style.css'
import answerData from './path-to-answer-data'; // Import or create the answer data object.

function YourApp() {
    const [answer, setAnswer] = useState([]) // State to manage user responses

    return (
        <div className="App">
            {/* Render your application content here */}

            {/* Include the OnBoarding component */}
            <QuestProvider 
              apiKey={"your api key"} 
              entityId={"your entity Id"}
              apiType ={"STAGING" OR "PRODUCTION"}
              featureFlags={{}}
              >
                <GamifiedQuiz
                    userId="q-xxxxxx505-xxxx-4xx8-xx69365x2fxxcx"
                    token="xxxxxzI1NiIsZiNmZkMGJxxxxxxxxOCIsImlhdCI6MTY5Mzg4MDUxxxxxxxxx3SHKDjJ6NQ7OPuzAL6jCzI"
                    questId="q-xxxxxx505-xxxx-4xx8-xx69365x2fxxcx"
                    questionSections={[[1, 2], [3, 4, 5], [6, 7]]}
                    sectionHeading={["Section 1", "Section 2"]}
                    sectionSubHeading={["Sub Section 1", "Sub Section 1"]}
                    feedbackContent={
                       FeedbackHeading="Feedback Heading"
                       FeedbackDescription="Feedback Description"
                    }
                    variation={"/* Specify the variation enable or disable */"}
                    setGamifiedQuiz={"/* Specify the function */"}
                    questionPerSection={"/* Specify number of questions per section*/"}
                    gamifiedQuiz={"/* Specify the Component enable or disable */"}
                    functionOnSubmit={"/* Specify the function executes on submit */"}
                    heading={"/* Define screen headings */"}
                    isV1Api={"/* Specify the V1 Api or not */"}
                    showFooter={"/* Specify the Footer enable or disable */"}
                    thanksPopUpFooter={"/* Specify the Thanks pop up Footer enable or disable */"}
                    styleConfig?: {{
                        Form?: CSSProperties,
                        IconColor?: CSSProperties,
                        LabelColor?: CSSProperties,
                        EmailError?: {
                            errorStyle?: CSSProperties,
                            text?: string,
                        }
                        Heading?: CSSProperties,
                        FormContainer?: CSSProperties,
                        Question?: CSSProperties,
                        SubHeading?: CSSProperties,
                        Input?: CSSProperties,
                        PrimaryButton?: CSSProperties,
                        SecondaryButton?: CSSProperties,
                        Footer? : CSSProperties,
                        TextArea? : CSSProperties,
                        ThanksPopup?: CSSProperties,
                        ThanksPopupHeading?: CSSProperties,
                        ThanksPopupDescription?: CSSProperties,
                        ThanksPopupFooter?: CSSProperties,
                        ThanksPopupGotoHome?: CSSProperties,
                        OptionsSelectedColor?: CSSProperties,
                    }}
                />
            </QuestProvider>
        </div>
);
}

export default YourApp;
import React, { useState } from 'react';
import {OnBoarding} from '@questlabs/react-sdk/offline';

function YourApp() {
    const [answer, setAnswer] = useState([]) // State to manage user responses

    return (
        <div className="App">
            {/* Render your application content here */}

            {/* Include the OnBoarding component */}
            <QuestProvider apiKey={"your api key"} entityId={"e-cbd0cc-3fcb-4085-a95e-71274fa7ac"}
                           featureFlags={{}}>
                <OnBoarding
                    offlineFormData={[
                      {
                        "type": "USER_INPUT_TEXT",
                        "question": "First name",
                        "options": [""],
                        "criteriaId": "ec-2733e056-350c-40d9-acfd-833882e99117",
                        "required": true,
                        "linkTitle": "",
                        "linkUrl": "",
                        "manualInput": false,
                        placeholder: "",
                      },]}
                       design={[[1, 2], [3, 4, 5], [6, 7]]}
                     headingScreen={[{name: "Tell about your self", desc: ""}, {
                        name: "Tell us more about your company",
                        desc: ""
                    }, {name: "A little more will help us guide you the best", desc: ""}]}
                    singleChoose={/* Define single-choice input type */}
                    multiChoice="modal1"
                    getAnswers={/*() => "Callback to retrieve answers" */}
                    answer={answer}
                    setAnswer={setAnswer}
                    customComponents={/* Custom components */}
                    customComponentPositions={5}
                    progress={/* Specify headings of progress bar for each tab */}
                    loadingTracker={/* Define status for loading tracker */}
                    setLoading={/* Function to set loading state */}
                    nextBtnText={/* Text for next button */}
                    progressBarMultiLine={/* Boolean indicating whether progress bar should be displayed in multiple lines */}
                    controlBtnType={/* Type of control buttons */}
                    template={/* Template type */}
                    styleConfig={} 
                />
            </QuestProvider>
        </div>
);
}

export default YourApp;
Get Access