commit 1536aa99eb44e1f904d076072424d23d6737bd79
parent 17b68d693e6109866ad11baccdf9c9a9efd47ec7
Author: Bertrand BRUN <bertrand0brun@gmail.com>
Date: Fri, 4 Feb 2011 16:30:55 +0100
Merge branch 'master' of https://github.com/jsmaniac/2011-m1s2-ter
Diffstat:
4 files changed, 77 insertions(+), 51 deletions(-)
diff --git a/code/serveur/parties.json b/code/serveur/parties.json
@@ -1,7 +1,8 @@
// Requête : http://serveur/pticlic.php?action=getparties&nb=2&mode=normal&user=foo&passwd=bar
[
{
- id: 1234,
+ gid: 1234,
+ pgid: 157963,
cat1: 11,
cat2: 23,
cat3: 35,
diff --git a/code/serveur/php/pticlic.php b/code/serveur/php/pticlic.php
@@ -159,7 +159,7 @@ function cg_insert($centerEid, $cloud, $r1, $r2, $totalDifficulty) {
$db->exec("begin transaction;");
$db->exec("insert into game(gid, eid_central_word, relation_1, relation_2, difficulty) values (null, $centerEid, $r1, $r2, $totalDifficulty);");
$gid = $db->lastInsertRowID();
- $db->exec("insert into played_game(pgid, gid, login) values (null, $gid, null);");
+ $db->exec("insert into played_game(pgid, gid, login, played) values (null, $gid, null, true);");
$pgid = $db->lastInsertRowID();
foreach ($cloud as $c) {
$db->exec("insert into game_cloud(gid, num, difficulty, eid_word, totalWeight, probaR1, probaR2, probaR0, probaTrash) values($gid, ".$c['pos'].", ".$c['d'].", ".$c['eid'].", 2, ".$c['probaR1'].", ".$c['probaR2'].", ".$c['probaR0'].", ".$c['probaTrash'].");");
@@ -186,14 +186,16 @@ function random_game() {
function game2json($game_id) {
global $db;
+ $db->exec("INSERT INTO played_game(pgid, gid, login, played) VALUES (null, $game_id, ".SQLite3::escapeString($user).", false);");
+ $pgid = $db->lastInsertRowID();
// TODO Yoann : faire des tests d'erreur pour ces select ?
$game = $db->query("select gid, (select name from node where eid = eid_central_word) as name_central_word, eid_central_word, relation_1, relation_2 from game where gid = ".$game_id.";");
$game = $game->fetchArray();
- echo "{id:".$game['gid'].",cat1:".$game['relation_1'].",cat2:".$game['relation_2'].",cat3:0,cat4:-1,";
+ echo "{gid:".$gid.",pgid:$pgid,cat1:".$game['relation_1'].",cat2:".$game['relation_2'].",cat3:0,cat4:-1,";
echo "center:{id:".$game['eid_central_word'].",name:".json_encode("".$game['name_central_word'])."},";
echo "cloudsize:10,cloud:["; // TODO ! compter dynamiquement.
- $res = $db->query("select eid_word,(select name from node where eid=eid_word) as name_word from game_cloud where gid = ".$game['gid'].";");
+ $res = $db->query("select eid_word,(select name from node where eid=eid_word) as name_word from game_cloud where gid = ".$game_id.";");
$notfirst = false;
while ($x = $res->fetchArray()) {
if ($notfirst) { echo ","; } else { $notfirst=true; }
@@ -207,6 +209,7 @@ function main($action) {
// TODO : en production, utiliser : header("Content-Type: application/json; charset=utf-8");
header("Content-Type: text/plain; charset=utf-8");
if ($action == 2) { // "Create partie"
+ // Requête POST : http://serveur/pticlic.php?action=2&nb=2&mode=normal&user=foo&passwd=bar
if(!isset($_GET['nb']) || !isset($_GET['mode']))
mDie(2,"La requête est incomplète");
$nbParties = intval($_GET['nb']);
@@ -214,6 +217,7 @@ function main($action) {
create_game(10);
}
} else if ($action == 0) { // "Get partie"
+ // Requête POST : http://serveur/pticlic.php?action=0&nb=2&mode=normal&user=foo&passwd=bar
if(!isset($_GET['nb']) || !isset($_GET['mode']))
mDie(2,"La requête est incomplète");
$nbGames = intval($_GET['nb']);
@@ -227,31 +231,52 @@ function main($action) {
}
echo "]";
} else if($action == 1) { // "Set partie"
- // Requête sql d'ajout d'informations (et calcul de résultat).
- // TODO : nettoyer, finir
+ if (!isset($_GET['pgid']))
+ mDie(2,"La requête est incomplète");
+ $pgid = intval($_GET['pgid']);
+ $gid = intval($_GET['gid']);
- $gid = $_GET['gid'];
+ if ($user != $db->querySingle("SELECT login FROM played_game WHERE pgid = $pgid and $gid = $gid and played = false;"))
+ mDie(4,"Cette partie n'est associée à votre nom d'utilisateur, ou bien vous l'avez déjà jouée.");
- if(ĝid != $db->querySingle("SELECT gid FROM played_game WHERE login='".$user."'"))
- mdie(3,"Cette partie n'est associée à votre nom d'utilisateur");
-
- $userReputation = log($db->querySingle("SELECT score FROM user WHERE login='".$user."'"));
-
- $db->exec("begin transaction;");
- $db->exec("INSERT INTO played_game(pgid, gid, login) VALUES (null, $gid, null);");
- $pgid = $db->lastInsertRowID();
+ $userReputation = log($db->querySingle("SELECT score FROM user WHERE login='".SQLite3::escapeString($user)."';"));
- for($i=0; $i < 10; $i++)
- {
- $x = $_GET['$i'];
+ $db->exec("begin transaction;");
+ $db->exec("update played_game set played = true where pgid = $pgid;");
+
+ $r0 = 0;
+ $trash = -1;
+ $r1 = $db->querySingle("SELECT relation_1, relation_2 FROM game WHERE gid = $gid;", true);
+ $r2 = $r1['relation_2'];
+ $r1 = $r1['relation_1'];
+ $res = $db->query("SELECT num, difficulty, totalWeight, probaR1, probaR2, probaR0, probaTrash FROM game_cloud WHERE gid = $gid;");
+ while ($row = $res->fetchArray()) {
+ $num = $row['num'];
+ $relanswer = intval($_GET['$i']);
+ switch ($relanswer) {
+ case $r1: $answer = 0; $probaRx = "probaR1"; break;
+ case $r2: $answer = 1; $probaRx = "probaR2"; break;
+ case $r0: $answer = 2; $probaRx = "probaR3"; break;
+ case $trash: $answer = 3; $probaRx = "probaTrash"; break;
+ default: mDie(5, "Réponse invalide pour le mot $num.");
+ }
- // TODO : calculer le score. Score = proba[réponse de l'utilisateur]*coeff - proba[autres reponses]*coeff
- // TODO : adapter le score en fonction de la réputation de l'utilisateur (plus quand il est jeune, pour le motiver, par ex. avec un terme constant qu'on ajoute).
- $score = 1;
+ $probas = array($row['probaR1']/$row['totalWeight'], $row['probaR2']/$row['totalWeight'], $row['probaR0']/$row['totalWeight'], $row['probaTrash']/$row['totalWeight']);
+ // Calcul du score. Score = proba[réponse de l'utilisateur]*coeff1 - proba[autres reponses]*coeff2
+ // score = - proba[autres reponses]*coeff2
+ $score = -0.7 * (($probas[0] + $probas[1] + $probas[2] + $probas[3]) - $probas[$answer]);
+ // ici, -0.7 <= score <= 0
+ // score = proba[réponse de l'utilisateur]*coeff1 - proba[autres reponses]*coeff2
+ $score += ($row['difficulty']/5) * $probas[$answer];
+ // ici, -0.7 <= score <= 2
+ // Adapter le score en fonction de la réputation de l'utilisateur (quand il est jeune, augmenter le score pour le motiver).
+ $score += min(2 - max(0, ($userReputation / 4) - 1), 2);
+ // ici, -0.7 <= score <= 4
- $db->exec("insert into played_game_cloud(pgid, gid, type, num, relation, weight, score) values($pgid, $gid, 1, ".$c['pos'].", $r1, ".($x*$userReputation).", ".$score.");");
- // TODO : game_cloud(probaR_x_) += $réputationJoueur * $coeff
- // TODO : game_cloud(totalWeight) += $réputationJoueur * $coeff (NOTE : même coeff que pour game_cloud(probaR_x_))
+ $db->exec("insert into played_game_cloud(pgid, gid, type, num, relation, weight, score) values($pgid, $gid, 1, $num, $r1, ".$userReputation.", ".$score.");");
+ $db->exec("update game_cloud set $probaRx = $probaRx + ".max($réputationJoueur,1)." where gid = $gid;";
+ $db->exec("update game_cloud set totalWeight = totalWeight + ".max($réputationJoueur,1)." where gid = $gid;";
+ $db->exec("update user set score = score + ".$score." where login = $user;";
}
$db->exec("commit;");
// On renvoie une nouvelle partie pour garder le client toujours bien alimenté.
diff --git a/organisation/pticlic.gan b/organisation/pticlic.gan
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project name="PticClic" company="" webLink="pticlic.org" view-date="2011-01-10" view-index="0" gantt-divider-location="425" resource-divider-location="302" version="2.0">
+<project name="PticClic" company="" webLink="pticlic.org" view-date="2011-01-17" view-index="0" gantt-divider-location="425" resource-divider-location="302" version="2.0">
<description/>
<view zooming-state="default:3" id="gantt-chart"/>
<view id="resource-table">
@@ -36,11 +36,11 @@
<depend id="6" type="2" difference="0" hardness="Rubber"/>
</task>
<task id="1" name="Recherche de beta-testeurs" meeting="false" start="2011-01-15" duration="28" complete="10" priority="1" expand="true"/>
- <task id="2" name="Iteration 1" meeting="false" start="2011-01-17" duration="27" complete="36" priority="1" expand="true">
+ <task id="2" name="Iteration 1" meeting="false" start="2011-01-17" duration="27" complete="63" priority="1" expand="true">
<depend id="16" type="2" difference="0" hardness="Rubber"/>
<depend id="17" type="2" difference="0" hardness="Rubber"/>
<depend id="18" type="2" difference="0" hardness="Rubber"/>
- <task id="5" name="Serveur & SQL" meeting="false" start="2011-01-17" duration="7" complete="80" priority="1" expand="true">
+ <task id="5" name="Serveur & SQL" meeting="false" start="2011-01-17" duration="7" complete="95" priority="1" expand="true">
<depend id="7" type="2" difference="0" hardness="Strong"/>
<depend id="8" type="2" difference="0" hardness="Strong"/>
<depend id="9" type="2" difference="0" hardness="Strong"/>
@@ -50,19 +50,19 @@
<depend id="8" type="2" difference="0" hardness="Strong"/>
<depend id="9" type="2" difference="0" hardness="Strong"/>
</task>
- <task id="7" name="Fenetre de score" meeting="false" start="2011-01-24" duration="7" complete="20" priority="1" expand="true">
+ <task id="7" name="Fenetre de score" meeting="false" start="2011-01-24" duration="7" complete="50" priority="1" expand="true">
<depend id="10" type="2" difference="0" hardness="Strong"/>
</task>
- <task id="8" name="Reseau client Android" meeting="false" start="2011-01-24" duration="7" complete="30" priority="1" expand="true">
+ <task id="8" name="Reseau client Android" meeting="false" start="2011-01-24" duration="7" complete="90" priority="1" expand="true">
<depend id="10" type="2" difference="0" hardness="Strong"/>
</task>
- <task id="9" name="Fenetre de jeu" meeting="false" start="2011-01-24" duration="7" complete="20" priority="1" expand="true">
+ <task id="9" name="Fenetre de jeu" meeting="false" start="2011-01-24" duration="7" complete="85" priority="1" expand="true">
<depend id="10" type="2" difference="0" hardness="Strong"/>
</task>
<task id="10" name="Intégration client & serveur" meeting="false" start="2011-01-31" duration="1" complete="0" priority="1" expand="true">
<depend id="11" type="2" difference="0" hardness="Strong"/>
</task>
- <task id="11" name="Amelioration" meeting="false" start="2011-02-01" duration="6" complete="0" priority="1" expand="true">
+ <task id="11" name="Amelioration" meeting="false" start="2011-02-01" duration="6" complete="20" priority="1" expand="true">
<depend id="12" type="2" difference="0" hardness="Strong"/>
</task>
<task id="12" name="Test et debogage" meeting="false" start="2011-02-07" duration="5" complete="0" priority="1" expand="true">
@@ -172,51 +172,51 @@
</resources>
<allocations>
<allocation task-id="0" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
- <allocation task-id="0" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="0" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="0" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
+ <allocation task-id="0" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="1" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
- <allocation task-id="1" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="1" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="1" resource-id="0" function="Default:1" responsible="false" load="25.0"/>
- <allocation task-id="5" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
+ <allocation task-id="1" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="5" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
+ <allocation task-id="5" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="6" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="6" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
<allocation task-id="7" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="8" resource-id="0" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
- <allocation task-id="9" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="9" resource-id="0" function="Default:1" responsible="false" load="25.0"/>
+ <allocation task-id="9" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
- <allocation task-id="10" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="10" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
+ <allocation task-id="10" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
- <allocation task-id="11" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="11" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
+ <allocation task-id="11" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
- <allocation task-id="12" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="12" resource-id="0" function="Default:1" responsible="false" load="75.0"/>
+ <allocation task-id="12" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="14" resource-id="4" function="SoftwareDevelopment:4" responsible="false" load="100.0"/>
<allocation task-id="16" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="17" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="17" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
- <allocation task-id="18" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="18" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
+ <allocation task-id="18" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="75.0"/>
<allocation task-id="19" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
- <allocation task-id="19" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="19" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="19" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
+ <allocation task-id="19" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
- <allocation task-id="20" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="20" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
+ <allocation task-id="20" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="21" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
- <allocation task-id="21" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="21" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="21" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
+ <allocation task-id="21" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="23" resource-id="4" function="SoftwareDevelopment:4" responsible="false" load="100.0"/>
<allocation task-id="25" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="25" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
@@ -225,21 +225,21 @@
<allocation task-id="27" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
<allocation task-id="28" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="29" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
- <allocation task-id="29" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="29" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="29" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
+ <allocation task-id="29" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
- <allocation task-id="30" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="30" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
+ <allocation task-id="30" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="31" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
- <allocation task-id="31" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="31" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="31" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
+ <allocation task-id="31" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="32" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
- <allocation task-id="32" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="32" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="32" resource-id="0" function="Default:1" responsible="true" load="25.0"/>
+ <allocation task-id="32" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="25.0"/>
<allocation task-id="33" resource-id="4" function="SoftwareDevelopment:4" responsible="false" load="100.0"/>
<allocation task-id="35" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="36" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
@@ -248,17 +248,17 @@
<allocation task-id="38" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="38" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="39" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
- <allocation task-id="39" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="39" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="39" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
+ <allocation task-id="39" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
- <allocation task-id="40" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="40" resource-id="0" function="Default:1" responsible="false" load="50.0"/>
+ <allocation task-id="40" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="50.0"/>
<allocation task-id="41" resource-id="2" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
- <allocation task-id="41" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="41" resource-id="3" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
<allocation task-id="41" resource-id="0" function="Default:1" responsible="false" load="100.0"/>
+ <allocation task-id="41" resource-id="1" function="SoftwareDevelopment:2" responsible="false" load="100.0"/>
</allocations>
<vacations/>
<taskdisplaycolumns>
diff --git a/rapport/rapport.tex b/rapport/rapport.tex
@@ -71,9 +71,9 @@ TYPE_RELATION(NUM, name string, extended_name string, info string);
USER(LOGIN string primary key, mail string, hash_passwd string (md5sum du password), #score (contrainte : somme de tous les scores des PLAYED_GAME_CLOUD);
-GAME(GID integer primary key autoincrement, #eid_central_word (ref NODE.eid, #relation_1 (ref RELATION.rid), #relation_2 ( (ref RELATION.rid), difficulty);
+GAME(GID integer primary key autoincrement, #eid_central_word (ref NODE.eid, #relation_1 (ref RELATION.rid), #relation_2 ( (ref RELATION.rid), difficulty (contrainte : 10 <= difficulty <= 100));
-GAME_CLOUD(GID, NUM, difficulty, #eid_word(ref NODE.eid), totalWeight (contrainte : = somme des probas), probaR1 (contrainte : = somme des probas des PLAYED_GAME_CLOUD.weight avec la bonne relation et la même gid et num), probaR2 (idem), probaR0 (idem), probaTrash (idem));
+GAME_CLOUD(GID, NUM, difficulty (contrainte : 1 <= difficulty <= 10), #eid_word(ref NODE.eid), totalWeight (contrainte : = somme des probas), probaR1 (contrainte : = somme des probas des PLAYED_GAME_CLOUD.weight avec la bonne relation et la même gid et num), probaR2 (idem), probaR0 (idem), probaTrash (idem));
PLAYED_GAME(PGID integer primary key autoincrement, #gid (ref GAME.gid), #login (ref USER.login);