How to display the learnious games?

Not so complicated

  • The games are hosted on our server and are called on your pages through iframes or CURL.
  • Some variables allow you to customize the games.
  • At the end of a game, our system sends a set of metrics to your server.
All the further samples are for iframes. The last one is a CURL integration example.

Basic use

Use the following code to display the games.

The PATH_TO_A_DEDICATED_SCRIPT will be a dedicated php script on our server.

<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2' width='900px' height='600px'></iframe>


The token (t)

[STRING] (mandartory)

The token is unique string. It will be sent to you by our services.

<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2' width='900px' height='600px'></iframe>


[INT] (mandartory)

For our games to be displayed, we need to know which game you want. This is done via the game_id

<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2' width='900px' height='600px'></iframe>


[INT] (optional)

By default most of our games are set to 20 questions. It's possible to set fewer or more questions.

<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&nb_questions=10' width='900px' height='600px'></iframe>


[INT] (optional)

The game duration in seconds. By default most of our games have a duration of 180s. You can change this duration.

<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&time_to_play=60' width='900px' height='600px'></iframe>


[STRING] (optional)

We don't want you to give us names, ids or whatever data on your users. Privacy does matter.
On the other hand you need to send and receive data to and from the games to store the user's performance properly.
This is achieved by the "payload" var. This var can encapsulate encrypted data on your users in Base64 or whatever other system you want. It will be forwarded to you at the end of the game as it was sent at the beginning. We won't try to read or modify this var.

<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&payload=dXNlcl9pZD0xMiZ0ZXN0PTMw' width='900px' height='600px'></iframe>


[STRING] (optional)

An absolute path to your save script.
This script will be called with a set of POST variables at the end of the game.

<iframe src='[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2&save_url=' width='900px' height='600px'></iframe>

The vars sent back to you in POST to the provided "save_url" will be the following :

  • payload [STRING]
    The var as you gave it.
  • game_id [INT]]
    The game id :)
  • score [INT]
    The result of the game.
  • percent_success [INT]
    The percentage of correct answers given by the user during the game.


Here is a base code to display our games through php CURL.

$game_url = '[PATH_TO_A_DEDICATED_SCRIPT]?t=[YOUR TOKEN]&game_id=2';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => ($game_url),

$headers = array();
$headers[] = 'Content-Type:application/json';
$headers[] = 'Access-Control-Request-Method: GET';
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($curl);
$err = curl_error($curl);
if ($err) {
	echo 'cURL Error #:' . $err;
// The display, in a position:relative dom element.
echo '<div style="position:relative;">';
echo $response;
echo '</div>';