From 28d2fabf73bd350a309cd0325dac9bef2bc3a162 Mon Sep 17 00:00:00 2001 From: uo289267 Date: Tue, 23 Apr 2024 21:46:57 +0200 Subject: [PATCH] Fixed Bug --- .../questionView/CreationHistoricalRecord.js | 5 ++++- webapp/src/components/questionView/QuestionView.js | 1 + webapp/src/components/questionView/test.html | 11 ----------- 3 files changed, 5 insertions(+), 12 deletions(-) delete mode 100644 webapp/src/components/questionView/test.html diff --git a/webapp/src/components/questionView/CreationHistoricalRecord.js b/webapp/src/components/questionView/CreationHistoricalRecord.js index b10f0690..cac292c9 100644 --- a/webapp/src/components/questionView/CreationHistoricalRecord.js +++ b/webapp/src/components/questionView/CreationHistoricalRecord.js @@ -3,6 +3,9 @@ import axios from 'axios' class CreationHistoricalRecord{ constructor() { + this.initRecord(); + } + initRecord(){ this.record = { game: { questions: [] @@ -54,7 +57,7 @@ class CreationHistoricalRecord{ } }); - + this.initRecord(); console.log('Registro enviado:', response.data); } catch (error) { console.error('Error al enviar el registro:', error.message); diff --git a/webapp/src/components/questionView/QuestionView.js b/webapp/src/components/questionView/QuestionView.js index 7b757576..b84cc18b 100644 --- a/webapp/src/components/questionView/QuestionView.js +++ b/webapp/src/components/questionView/QuestionView.js @@ -28,6 +28,7 @@ function QuestionView({type= "COMPETITIVE", amount=5}){ var generatedQuestions = await questionGenerator.generateQuestions(i18n.language, type, amount, cookie.token); setQuestions(generatedQuestions); + points=0; setnumQuestion(0); } catch (error) { //Como hacer que funcione esto diff --git a/webapp/src/components/questionView/test.html b/webapp/src/components/questionView/test.html deleted file mode 100644 index b1ee2c8e..00000000 --- a/webapp/src/components/questionView/test.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -

Hola

- - - \ No newline at end of file