Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 7e528388 authored by Mathieu Loiseau's avatar Mathieu Loiseau
Browse files

score working ? (missing levels)

parent 1c6de898
......@@ -238,7 +238,7 @@ class TracesHandler{
//update stats
//two queries (update score needs up to date stats)
$this->add_query("UPDATE `stats` SET `nbEnregistrements_devin` = `nbEnregistrements_devin`+1 WHERE `langue`='$rec_lang' AND `userid`='".$this->user->id."';");
$this->add_query("UPDATE `stats` SET `score_devin`='".$this->sv->get_augur_score_formula()."' WHERE `langue`='$rec_lang' AND `userid`='".$this->user->id."';");
$this->add_query("UPDATE `stats` SET `score_devin`=".$this->sv->get_augur_score_formula()." WHERE `langue`='$rec_lang' AND `userid`='".$this->user->id."';");
$this->add_query($this->notif->addNotifGAME($this->user->id,
$this->messages['Augur_playing'],
$this->messages['img_oracle'],
......@@ -325,7 +325,8 @@ class TracesHandler{
$this->add_query("UPDATE `stats` SET `nbLectures_oracle` = `nbLectures_oracle` + 1 , `nbSucces_oracle` = `nbSucces_oracle` + 1 , `score_oracle` = `score_oracle` + @recording_score_diff WHERE `userid`=@oracle_id AND `langue`=@lang;");
//end update Augur
//update stats :
$this->add_query("UPDATE `stats` SET `nbMotsTrouves_devin`=`nbMotsTrouves_devin`+1, `sommeMises_devin`=`sommeMises_devin`+@mise WHERE `userid`=".$this->user->id." AND `langue`=@lang;");
$this->add_query("UPDATE `stats` SET `nbMotsTrouves_devin`=`nbMotsTrouves_devin`+1, `sommeMises_devin`=`sommeMises_devin`+@mise WHERE `userid`='".$this->user->id."' AND `langue`=@lang;");
$this->add_query("UPDATE `stats` SET `score_devin`=".$this->sv->get_augur_score_formula()." WHERE `langue`=@lang AND `userid`='".$this->user->id."';");
//notifications
//augur
......
......@@ -18,7 +18,7 @@
$resultat = 'err';
if($db->query($sql)){
$resultat = $db->fetch_assoc($res);
$resultat = $db->fetch_assoc();
$resultat = $resultat[$roleUt];
}
......
......@@ -337,19 +337,19 @@ class GlobalScoreTable extends ScoreTable{
//we have not yet run that method
$query =
"SELECT
`stats`.`nbAbandons_oracle` as `o_a`,
`stats`.`nbErreurs_oracle` as `o_er`,
`stats`.`nbEnregistrements_oracle` as `o_en`,
ROUND(`stats`.`nbSucces_oracle`*100/GREATEST(1,`stats`.`nbLectures_oracle`)) as `o_wl`,
`stats`.`score_oracle` as `o`,
`stats`.`nbArbitrages_druide` as `d_a`,
`stats`.`nbErrArbitrage_druide` as `d_er`,
`stats`.`nbCartes_druide` as `d_c`,
`stats`.`score_druide` as `d`,
`stats`.`nbEnregistrements_devin` as `a_en`,
ROUND(`stats`.`nbMotsTrouves_devin`*100/GREATEST(1,`stats`.`nbEnregistrements_devin`)) as `a_wl`,
`stats`.`score_devin` as `a`,
(`stats`.`score_devin`+`stats`.`score_druide`+`stats`.`score_oracle`) as `g`,
SUM(`stats`.`nbAbandons_oracle`) as `o_a`,
SUM(`stats`.`nbErreurs_oracle`) as `o_er`,
SUM(`stats`.`nbEnregistrements_oracle`) as `o_en`,
ROUND(SUM(`stats`.`nbSucces_oracle`)*100/GREATEST(1,SUM(`stats`.`nbLectures_oracle`))) as `o_wl`,
SUM(`stats`.`score_oracle`) as `o`,
SUM(`stats`.`nbArbitrages_druide`) as `d_a`,
SUM(`stats`.`nbErrArbitrage_druide`) as `d_er`,
SUM(`stats`.`nbCartes_druide`) as `d_c`,
SUM(`stats`.`score_druide`) as `d`,
SUM(`stats`.`nbEnregistrements_devin`) as `a_en`,
ROUND(SUM(`stats`.`nbMotsTrouves_devin`)*100/GREATEST(1,SUM(`stats`.`nbEnregistrements_devin`))) as `a_wl`,
SUM(`stats`.`score_devin`) as `a`,
(SUM(`stats`.`score_devin`)+SUM(`stats`.`score_druide`)+SUM(`stats`.`score_oracle`)) as `g`,
`user`.`username` as `name`,
GROUP_CONCAT(`stats`.`langue` SEPARATOR '+') as `l`
FROM `stats`,`user`
......
......@@ -49,7 +49,7 @@ class ScoreValues{
)
)
)";
const AUGUR_SCORE_FORMULA = "ROUND(`sommeMises_devin`*(`nbMotsTrouves_devin`+(`nbMotsTrouves_devin`/`nbEnregistrements_devin`))";
const AUGUR_SCORE_FORMULA = "ROUND(`sommeMises_devin`*(`nbMotsTrouves_devin`+(`nbMotsTrouves_devin`/`nbEnregistrements_devin`)))";
private static $DRUID_STRINGS = array(0 => 'invalid',
1 => 'valid');
......
......@@ -19,6 +19,11 @@ $notif->readNotif();
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<!--Module de son : -->
<script src="http://cdn.webrtc-experiment.com/RecordRTC.min.js"></script>
<!--pour coder dans le train>
<script src="../jquery-3.0.0.min.js"></script>
<script src="../RecordRTC.min.js"></script-->
<!-- Adaptation au Bootstrap -->
<link rel="stylesheet" type="text/css" href="style/default.css/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="style/default.css/css/bootstrap-theme.css">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment