<?php
require'fun.php';
$titlu='Raspuns Quizz';
$back[1]='<a href="/quizz">Quizz</a>';
require'f_sus.php';
$totalscore=explode('/',$conn->query('SELECT`quiz_score`FROM`membrii`WHERE`id`="'.$de.'"')->fetch_row()[0]);
$row_quiz=$conn->query('SELECT`answer1`,`answer2`,`answer3`,`answer4`,`answer`FROM`quiz_intrebari`WHERE`id`="'.$tid.'"')->fetch_row();
$quizz_membru=$conn->query('SELECT`easy_next`,`med_next`,`hard_next`FROM`quiz_membrii`WHERE`de`="'.$de.'"')->fetch_assoc();
if($go=='a')
$guess=$row_quiz[0];
elseif($go=='b')
$guess=$row_quiz[1];
elseif($go=='c')
$guess=$row_quiz[2];
elseif($go=='d')
$guess=$row_quiz[3];
if($quizz_membru[$cid.'_next']!=$fid)
{
echo$div[4].'Trisezi!'.$div[5].$div[4].'<img src="'.$domenii_statice[2].'actiune_delete.png" alt="" width="16" height="16" />Eroare!'.$div[5].$div[7].'Nu poți reincarca pagina pentru a castiga mai multe puncte!<br />NU TRISA!!!'.$div[0];
require'f_jos.php';
}
elseif($guess==$row_quiz[4])
{
$conn->query('UPDATE`quiz_membrii`SET`'.$cid.'_question`="'.$fid.'",`'.$cid.'_next`="'.($fid+1).'"WHERE`de`="'.$de.'"');
if($cid=='easy')
$punct=10;
elseif($cid=='med')
$punct=20;
elseif($cid=='hard')
$punct=30;
if($cid=='easy')
$totalscore=($totalscore[0]+$punct).'/'.$totalscore[1].'/'.$totalscore[2];
elseif($cid=='med')
$totalscore=$totalscore[0].'/'.($totalscore[1]+$punct).'/'.$totalscore[2];
elseif($cid=='hard')
$totalscore=$totalscore[0].'/'.$totalscore[1].'/'.($totalscore[2]+$punct);
$total_score=explode('/',$totalscore);
$conn->query('UPDATE`membrii`SET`quiz_score`="'.$totalscore.'",`total_score`="'.($total_score[0]+$total_score[1]+$total_score[2]).'"WHERE`id`="'.$de.'"');
echo$div[4].'<img src="'.$domenii_statice[1].'actiune_check.png" alt="" width="16" height="16" />Succes!'.$div[5].$div[6].'Ai răspuns corect!'.$div[0].$div[1].'Continuă sa raspunzi, '.$punct.' puncte au fost adaugate la scorul tau!'.$div[0];
if($fid<10)
echo$div[1].'<a href="/intrebare-quizz/categorie/'.$cid.'/v/'.($fid+1).'">Mergi la intrebarea cu numărul '.($fid+1).'</a>'.$div[0];
elseif($fid==10)
{
if($cid=='easy')
$conn->query('UPDATE`membrii`SET`quiz_easy`="yes"WHERE`id`="'.$de.'"');
elseif($cid=='med')
$conn->query('UPDATE`membrii`SET`quiz_medium`="yes"WHERE`id`="'.$de.'"');
elseif($cid=='hard')
$conn->query('UPDATE`membrii`SET`quiz_hard`="yes"WHERE`id`="'.$de.'"');
echo$div[4].'<img src="'.$domenii_statice[1].'actiune_check.png" alt="" width="16" height="16" />Succes!'.$div[5].$div[6].'Ai completat aceasta runda!'.$div[0].$div[1].'<a href="/joaca-quizz">Selecteaza alt nivel de dificultate</a>'.$div[0];
}
}
else
{
if($cid=='easy')
$punct=10;
elseif($cid=='med')
$punct=20;
elseif($cid=='hard')
$punct=30;
if($cid=='easy')
$totalscore=($totalscore[0]-$punct).'/'.$totalscore[1].'/'.$totalscore[2];
elseif($cid=='med')
$totalscore=$totalscore[0].'/'.($totalscore[1]-$punct).'/'.$totalscore[2];
elseif($cid=='hard')
$totalscore=$totalscore[0].'/'.$totalscore[1].'/'.($totalscore[2]-$punct);
$total_score=explode('/',$totalscore);
$conn->query('UPDATE`membrii`SET`quiz_score`="'.$totalscore.'",`total_score`="'.($total_score[0]+$total_score[1]+$total_score[2]).'"WHERE`id`="'.$de.'"');
echo$div[7].'Gresit!'.$div[0].$div[1].'Raspunsul dat de tine, e gresit!<br />'.$punct.' puncte, ti-au fost retrase din scorul tau.'.$div[0].$div[1].'<a href="/intrebare-quizz/categorie/'.$cid.'/v/'.$fid.'">Incearca alt răspuns la intrebarea '.$fid.',</a>'.$div[0];
}
require'f_jos.php';