User Tools

Site Tools


LUCY MANUAL Applies to LUCY versions above 2.2.


Lucy Quiz Integration Help

How to create an interactive eLearning page

LUCY allows you to create any given eLearning content on the server itself. You can either create a new awareness page (and upload your own content) or edit the existing pages. This link contains more info on how to edit the existing interactive eLearning pages in LUCY.

How to enable/embed an interactive eLearning quiz page

Background Info: Interactive Quiz Pages allow you to centrally track and analyze the user input (time to fill out a quiz & answers selected) on your LUCY instance.

Where is the tracking data visible? The tracking info is visible in different parts of the application: You can track the awareness clicks via:

◾ Reports (Raw CSV Report or PDF/HTML Export) ◾ Statistics/Recipients ◾ Statistics/Awareness Website

How to configure the quiz?

Step 1 - Enable the Quiz Feature: First of all, in order to enable quiz answers tracking, you should set a “Quiz” checkbox for awareness template you are working on. There are two places where you can enable it:

a) If you are working on an awareness template in the awareness template section then click here (see pic)

b) If you are working on an awareness website within a campaign then click here (see pic)

Lucy then will automatically inject a JavaScript called /js/quiz.js to your template, making quiz-­‐related functions available

Step 2 - Enable the Quiz Variables:

All functions are non-­‐blocking and you may safely call them from any part of the code. Functions you may use are:

a) lucyQuizStart(): starts a quiz for the current user and tracks the time of when the quiz has been started (Parameters: None)

b) lucyQuizAnswer(question, correct): sends answer report to the server with the parameters:

  • question -question id (integer)
  • correct –correctness of the answer (boolean)

In HTML code this might look as the following screenshot:

How to track users watching an awareness video

Method 1: using the quiz checkbox

This method allows you only to verify, if the video was played. It does not allow tracking of the video lenght. Please use method 2 to track more details.

  • Mark the awareness template or website as "Quiz"

  • Make sure your awareness website (or template) has the quiz-question-titles.js static file with the following content: {"1": "Video Played"}
  • Add "onload" attribute to body tag of HTML content, so you get the following:
<body onload="lucyQuizStart();">
  • Add "onplay" attribute to video tag of HTML, so you get the following:
<video onplay="lucyQuizAnswer(1,1);">

Method 2: using the video tracking JavaScript

Using our custom tracking JavaScript which can be downloaded here, allows you to track video's played in LUCY's "flowplayer" which are used for all our video templates. The JS should be inserted into the bottom of the page where the flowplayer video is uploaded:

This script allows you to track a video start and finish event and also display the progress in statistics (rounded percent in different event types like video-10 for 10% video played or video-90 for 90% video played, etc.). When the video is started, it sends a "video-start" event. When the video is finished (played to the end), it sends a "video-finish" event to LUCY which leads to statistics like in this graphic:

Extended method of tracking the end of the quiz

Starting with version Lucy 4.6, there is a new option called “Use extended method of tracking the end of the quiz”, which is designed to track when the user finishes the quiz. The option is available on the Awarness Template editing page:

Default state: disabled.

In order for this method to work, you will need to add a call to an additional function "lucyQuizEnd()" without any parameters. This function should be launched after the user answers the last question in your quiz.

:!: Attention! Enabling this option without calling the "lucyQuizEnd()" function will cause recipients to not be marked as "trained". By default, Lucy marks each recipient as "Trained" after receiving the very first answer to the quiz. With the option "Use extended method of tracking the end of the quiz" and calling the function lucyQuizEnd(), the Trained sign can be set at the moment when it is necessary.

An example of usage the function lucyQuizEnd() in awareness training

Using the awareness template "Internet Security Exam" as an example, add the function lucyQuizEnd() to the source code for processing quiz answers. The quiz has 9 questions. The goal is to find victims who gives 5 correct answers to the quiz. Enable the option "Use extended method of tracking the end of the quiz" within the Website section of the Awareness Settings in the campaign.

Add a new variable "correctAnswerCount" to keep the amount of correct answered questions:

var correctAnswersCount = 0;

Find the place in the code where function lucyQuizAnswer is called and insert a call of the function lucyQuizEnd after it with the condition as shown below.

if (correctAnswersCount >= 5) {

Save the template and run the campaign. After 5 quiz questions are answered correctly, the recipient will be marked as "Trained".

create_an_interactive_e-learning_template.txt · Last modified: 2020/02/21 11:13 by lucy