From c6a462f83da69290ac5543e330ea90d2a9c8f56d Mon Sep 17 00:00:00 2001 From: teresagg Date: Sun, 28 Apr 2024 21:29:27 +0200 Subject: [PATCH] Fixing wise men statistics --- questions/utils/question.json | 6 +++--- webapp/src/pages/games/WiseMenStackGame.js | 25 +++++++++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/questions/utils/question.json b/questions/utils/question.json index 76023cd..c0eddb1 100644 --- a/questions/utils/question.json +++ b/questions/utils/question.json @@ -151,9 +151,9 @@ { "property": "P3032", "template": { - "es": "Cuál es la velocidad máxima de x", - "en": "What is the maximum speed of x", - "fr": "Quelle est la vitesse maximale de x" + "es": "Cuál es la mayor velocidad de x", + "en": "What is the greatest speed of x", + "fr": "Quelle est la vitesse plus grand de x" }, "category": ["Cars"] } diff --git a/webapp/src/pages/games/WiseMenStackGame.js b/webapp/src/pages/games/WiseMenStackGame.js index 7fab6f3..ad34de7 100644 --- a/webapp/src/pages/games/WiseMenStackGame.js +++ b/webapp/src/pages/games/WiseMenStackGame.js @@ -139,10 +139,29 @@ const WiseMenStackGame = () => { try { await axios.put(`${apiEndpoint}/statistics`, { username:username, + the_callenge_earned_money:0, + the_callenge_correctly_answered_questions:0, + the_callenge_incorrectly_answered_questions:0, + the_callenge_total_time_played:0, + the_callenge_games_played:0, wise_men_stack_earned_money:totalScore, wise_men_stack_correctly_answered_questions:correctlyAnsweredQuestions, wise_men_stack_incorrectly_answered_questions:incorrectlyAnsweredQuestions, - wise_men_stack_games_played:1 + wise_men_stack_games_played:1, + warm_question_earned_money: 0, + warm_question_correctly_answered_questions: 0, + warm_question_incorrectly_answered_questions: 0, + warm_question_passed_questions: 0, + warm_question_games_played: 0, + discovering_cities_earned_money: 0, + discovering_cities_correctly_answered_questions: 0, + discovering_cities_incorrectly_answered_questions: 0, + discovering_cities_games_played: 0, + online_earned_money: 0, + online_correctly_answered_questions: 0, + online_incorrectly_answered_questions: 0, + online_total_time_played: 0, + online_games_played: 0, }); } catch (error) { console.error("Error:", error); @@ -173,7 +192,7 @@ const WiseMenStackGame = () => { const userResponse = { question: questionData.question, response: response, - options: questionData.options, + options: possibleAnswers, correctAnswer: questionData.correctAnswer }; setUserResponses(prevResponses => [...prevResponses, userResponse]); @@ -322,7 +341,7 @@ const WiseMenStackGame = () => { : // Cronómetro - selectResponse(-1, "FAILED")}> {({ remainingTime }) => { return (