|
|
@ -32,8 +32,6 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//variables pour les scores
|
|
|
|
//variables pour les scores
|
|
|
|
score:{
|
|
|
|
score:{
|
|
|
|
leaderboard:{},
|
|
|
|
|
|
|
|
score:0,
|
|
|
|
|
|
|
|
pointsGagne:0,
|
|
|
|
pointsGagne:0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pointsAnimation:0
|
|
|
|
pointsAnimation:0
|
|
|
@ -63,14 +61,13 @@ export default {
|
|
|
|
return this.obtenirQuestion
|
|
|
|
return this.obtenirQuestion
|
|
|
|
},
|
|
|
|
},
|
|
|
|
obtenirQuestion(){
|
|
|
|
obtenirQuestion(){
|
|
|
|
this.resetEtats() //cacher l'etat precedent
|
|
|
|
|
|
|
|
this.kahootAPI.obtenirQuestion().then(response=>{
|
|
|
|
this.kahootAPI.obtenirQuestion().then(response=>{
|
|
|
|
|
|
|
|
this.resetEtats() //cacher l'etat precedent
|
|
|
|
this.tempsLimite=response.tempsLimite
|
|
|
|
this.tempsLimite=response.tempsLimite
|
|
|
|
//afficher cet etat
|
|
|
|
//afficher cet etat
|
|
|
|
this.etats.question=true
|
|
|
|
this.etats.question=true
|
|
|
|
|
|
|
|
|
|
|
|
this.question=response.questionActuel
|
|
|
|
this.question=response.questionActuel
|
|
|
|
console.log(this.question)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(this.tempsLimite!=-1){
|
|
|
|
if(this.tempsLimite!=-1){
|
|
|
|
//executer la fonction en boucle jusqu'a ce que la partie se termine
|
|
|
|
//executer la fonction en boucle jusqu'a ce que la partie se termine
|
|
|
@ -82,7 +79,6 @@ export default {
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
obtenirScores(){
|
|
|
|
obtenirScores(){
|
|
|
|
/*
|
|
|
|
|
|
|
|
this.resetEtats() //cacher l'etat precedent
|
|
|
|
this.resetEtats() //cacher l'etat precedent
|
|
|
|
this.kahootAPI.obtenirScore().then(response=>{
|
|
|
|
this.kahootAPI.obtenirScore().then(response=>{
|
|
|
|
this.tempsLimite=response.tempsLimite
|
|
|
|
this.tempsLimite=response.tempsLimite
|
|
|
@ -101,7 +97,7 @@ export default {
|
|
|
|
this.compteAReboursId=window.setInterval(this.calculerCompteARebours,22)
|
|
|
|
this.compteAReboursId=window.setInterval(this.calculerCompteARebours,22)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)*/
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
obtenirSalleAttente(){
|
|
|
|
obtenirSalleAttente(){
|
|
|
|
this.resetEtats() //cacher l'etat precedent
|
|
|
|
this.resetEtats() //cacher l'etat precedent
|
|
|
@ -180,8 +176,8 @@ export default {
|
|
|
|
<div v-show="etats.score">
|
|
|
|
<div v-show="etats.score">
|
|
|
|
<h2>Votre score : {{ pointsAnimation }} (+{{ score.pointsGagne }})</h2>
|
|
|
|
<h2>Votre score : {{ pointsAnimation }} (+{{ score.pointsGagne }})</h2>
|
|
|
|
<ol class="leaderboard">
|
|
|
|
<ol class="leaderboard">
|
|
|
|
<li v-for="joueur in Object.keys(score.leaderboard)">
|
|
|
|
<li v-for="scorejoueur in score.scores">
|
|
|
|
{{ joueur }} : {{score.leaderboard[joueur]}}
|
|
|
|
{{ scorejoueur.joueur.pseudo }} : {{scorejoueur.score}}
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</ol>
|
|
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|