Use extended method of tracking the end of the quiz
Last updated
Last updated
"Use extended method of tracking the end of the quiz" is available to monitor when users complete a quiz at a pre-defined placeholder within the Awareness template. This option can be found on the Awareness Template editing page.
The default state of this feature is disabled.
To activate this method, add a call to the additional function lucyQuizEnd()
without any parameters. Call this function after the user answers the last question in your desired quiz.
Enabling this option without calling the lucyQuizEnd()
function will prevent recipients from being marked as "trained". By default, Lucy marks each recipient as "Trained" after receiving the first answer to the quiz. Enabling the "Use extended method of tracking the end of the quiz" option and calling the lucyQuizEnd()
function allows you to set the "Trained" status at the appropriate moment.
Using the awareness template "Internet Security" as an example:
Navigate to Templates -> Awareness Templates
Select "Edit Template"
Select "Content Template"
To enhance the "Internet Security" template, integrate the lucyQuizEnd()
function into the source code to process quiz answers. The quiz consists of 9 questions, aiming to identify users who correctly answer at least 5. Activate the "Use extended method of tracking the end of the quiz" option in the Website section of the Awareness Settings for the campaign.
Use your "File" drop-down to navigate to the correct file javascript file game.js
This file might vary depending on the template.
Add a new variable correctAnswerCount
to keep track of the number of correct answers:
Find the place in the code where the function lucyQuizAnswer()
is called and insert a call to the function lucyQuizEnd()
after it with the condition as shown below:
Save the template and run the campaign. After 5 quiz questions are answered correctly, the recipient will be marked as "Trained".
Using the function lucyQuizEnd()
together with the option "Ignore repeated answers in awareness" should be avoided, as this function disregards the restrictions set by that option.
lucyQuizStart(quizNumber, countQuestions, errorHandler)
Starts a quiz for the current user and tracks the time when the quiz started. Useful for templates with randomly sorted questions and a variable number of questions.
lucySetVariable(varName, varValue, errorHandler)
Permanently saves text data for the current user.
lucyGetVariable(varName, successHandler, errorHandler)
Retrieves previously saved variables by name.
Issue: Lucy marks recipients as 'Trained' without any quiz answers given. Solution: Enable the "Quiz" option within the Website section of the Awareness Settings in the campaign.
Issue: Lucy does not mark recipients as 'Trained' despite receiving positive quiz answers. Solution: Disable the "Extended method of tracking the end of the quiz" option within the Website section of the Awareness Settings in the campaign, or adjust your awareness template accordingly.