Skip to content

ExitPoll

Overview

ExitPoll allows you to directly ask questions to your users. This only requires a few lines and some options on your Cognitive3D dashboard. This page will walk you through the process of enabling and configuring an ExitPoll in your application.

Creating an ExitPoll

ExitPoll Hooks and Question Sets are created on the Cognitive3D Dashboard. A Hook is requested from the application during the experience and receives a Question Set as a response. This allows you to use change which Question Set to display from a Hook without updating your application.

The example here will display a Question Set about performance at the end of the level.

Press the New Question Set button.

Add your questions. Each question will be displayed as a panel one at a time.

Select Create Question Set. Then select Manage Hooks.

Select New Hook to open the popup.

Assign your Question Set and version for the Hook.

Displaying Question Set

Then in your project, use the Hook name to request the question set as follow:

    auto cog = cognitive::CognitiveVRAnalyticsCore::Instance();

    //request a question set by a Hook name
    cog->GetExitPoll()->RequestQuestionSet("scene_complete");

    //use this to return the set of questions as a string of json
    std::string questionSet = cog->GetExitPoll()->GetQuestionSetString();

The ExitPoll questions will be returned as json in the format here: link

Answering Question Sets

To answer an active question simply call addAnswer on exitpoll:

    std::string myVoiceReponse = GetMicrophoneReponse(); // Voice reponses require a .wav file encoded in base64 format.

    cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kBoolean, 1)); //true
    cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kHappySad, 1)); //happy
    cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kThumbs, 1)); //thumbs up
    cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kMultiple, 0)); // select first choice
    cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kScale, 0)); // select 0
    cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kVoice, myVoiceReponse)); //voice response

    cog->GetExitPoll()->SendAllAnswers();

If you want to allow a user to skip answering a question, add an answer with any negative value

    cog->GetExitPoll()->AddAnswer(cognitive::ExitPollAnswer(cognitive::EQuestionType::kBoolean, -32768)); //skip