From 4625dd620c28a4b9fe07e0fc728409e83f07e37a Mon Sep 17 00:00:00 2001 From: Mister-Mario Date: Wed, 24 Apr 2024 20:16:46 +0200 Subject: [PATCH 1/4] Opened questions endpoint so some dont need token --- gatewayservice/gateway-service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index c08d0e3..34ce5ea 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -48,7 +48,7 @@ app.post('/adduser', async (req, res) => { } }); -app.get('/questions', verifyToken, async (req, res) => { +app.get('/questions', async (req, res) => { try { // Forward the question request to the quetion service @@ -101,7 +101,7 @@ app.get('/questions/:lang/:amount', verifyToken, async (req, res) => { } }); -app.get('/questions/:lang', verifyToken, async (req, res) => { +app.get('/questions/:lang', async (req, res) => { try { if(!validateLang(req.params.lang.toString())) res.status(400).json({ error: 'Wrong values given' }); From 59a2b4a4975f482adddeb79888825a119e447eaf Mon Sep 17 00:00:00 2001 From: uo289267 Date: Wed, 24 Apr 2024 20:33:51 +0200 Subject: [PATCH 2/4] Added Play as a Guest Functionality --- webapp/public/game.png | Bin 0 -> 22717 bytes webapp/src/App.js | 2 +- webapp/src/components/Home/Home.js | 4 ++-- .../src/components/questionView/QuestionView.js | 11 ++++++++--- webapp/src/translations/en/global.json | 3 ++- webapp/src/translations/es/global.json | 3 ++- 6 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 webapp/public/game.png diff --git a/webapp/public/game.png b/webapp/public/game.png new file mode 100644 index 0000000000000000000000000000000000000000..a547de5b7918184bff9d4dd67b59f87a0eaf0a41 GIT binary patch literal 22717 zcmeFZXIE2U(*_D52nbRY1nC42=^(vJ4OLLOH0ix}2u(x<1BBjHnn-U6Jwa4@@4bVR z(0hO!e4g{ZYn`8P)_Onf{o&qoUo(4V?YU>J*&knOt3J3-cOM4_=K)wvNe>4HaCZy9 zA-s2YISClMy1U?d>#4rLsTiQ&!ogw20V^rI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(p) z6|R~QYPTT|4|>~95S;s5y)NE>?Q}zPvG;w8EQTpB0Zpk1%5)@Gt80=>(BU%w z3V-Ketg%EuMomx%U|#WceQOl@uF27;zx89U!z8o%&G`9s(@Z@{k0gCeJgoAU`r>o8 zhXM7Oo8=}`t?aaZjpd2arqaDysGno3`H1%l$BCJ^8=_mGLo#=cx=a-Mv;JxbPxDQC z=djSa(88dtpFL``r^dKVYn-cKaL#3vYxcEvyO$M<7#17e-$+Ob7yUmy5}4or>SzD` t{ErOz-;n&P5C1m~|8L`P@ha#bP8^_P!} /> : } /> : } /> - : } /> + } /> : } /> : }/> : } /> diff --git a/webapp/src/components/Home/Home.js b/webapp/src/components/Home/Home.js index d2da075..4af21ad 100644 --- a/webapp/src/components/Home/Home.js +++ b/webapp/src/components/Home/Home.js @@ -30,8 +30,8 @@ function Home() { W - - Instructions + + Game diff --git a/webapp/src/components/questionView/QuestionView.js b/webapp/src/components/questionView/QuestionView.js index 7b75757..6104772 100644 --- a/webapp/src/components/questionView/QuestionView.js +++ b/webapp/src/components/questionView/QuestionView.js @@ -25,8 +25,12 @@ function QuestionView({type= "COMPETITIVE", amount=5}){ const generateQuestions = async (numQuestion) => { if (numQuestion < 0) { try { - - var generatedQuestions = await questionGenerator.generateQuestions(i18n.language, type, amount, cookie.token); + var generatedQuestions; + if(cookie){ + generatedQuestions = await questionGenerator.generateQuestions(i18n.language, type, amount, cookie.token); + }else{ + generateQuestions = await questionGenerator.generateQuestions(i18n.language, type, amount, null);//playing as guest + } setQuestions(generatedQuestions); setnumQuestion(0); } catch (error) { @@ -110,7 +114,8 @@ function QuestionView({type= "COMPETITIVE", amount=5}){ creationHistoricalRecord.setCompetitive(type === 'COMPETITIVE'); creationHistoricalRecord.setDate(Date.now()); creationHistoricalRecord.setPoints(points); - creationHistoricalRecord.sendRecord(cookie.username, cookie.token); + if(cookie) + creationHistoricalRecord.sendRecord(cookie.username, cookie.token); } }, 1000); diff --git a/webapp/src/translations/en/global.json b/webapp/src/translations/en/global.json index 54f087c..1bcf3aa 100644 --- a/webapp/src/translations/en/global.json +++ b/webapp/src/translations/en/global.json @@ -8,7 +8,8 @@ "msg1": "Welcome to the knowledge challenge! Get ready to test your mind and demonstrate your skills. In this exciting game, you will face a series of questions that will test your knowledge on a variety of topics.", "msg2": "So go ahead, prove that you are the master of questions! Are you ready to accept the challenge?", "clickOpen": "Click to continue", - "clickClose": "Click to close" + "clickClose": "Click to close", + "game":"Play as a guest" }, "navBar": { diff --git a/webapp/src/translations/es/global.json b/webapp/src/translations/es/global.json index 092ecc7..8906341 100644 --- a/webapp/src/translations/es/global.json +++ b/webapp/src/translations/es/global.json @@ -8,7 +8,8 @@ "msg1": "Bienvenido al desafío de conocimientos! Prepárate para poner a prueba tu mente y demostrar tus habilidades. En este emocionante juego, te enfrentarás a una serie de preguntas que pondrán a prueba tu conocimiento en una variedad de temas.", "msg2": "¡Así que adelante, demuestra que eres el maestro de las preguntas! ¿Estás listo para aceptar el desafío?", "clickOpen": "Haz click para continuar", - "clickClose": "Haz click para cerrar" + "clickClose": "Haz click para cerrar", + "game":"Juega como invitado" }, From eecfb76a5b58d0f995c11640020e1ee3e1d23450 Mon Sep 17 00:00:00 2001 From: Mister-Mario Date: Wed, 24 Apr 2024 20:49:18 +0200 Subject: [PATCH 3/4] Tested and fixed --- webapp/src/components/questionView/QuestionView.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/webapp/src/components/questionView/QuestionView.js b/webapp/src/components/questionView/QuestionView.js index 6104772..4a90bc4 100644 --- a/webapp/src/components/questionView/QuestionView.js +++ b/webapp/src/components/questionView/QuestionView.js @@ -14,23 +14,20 @@ import BackButtonToGameMenu from '../fragments/BackButtonToGameMenu'; const creationHistoricalRecord = new CreationHistoricalRecord(); const questionGenerator = new QuestionGenerator(); var points = 0; +var playAsGuestUsername = "Play as Guest" //Wont be ever used as it has spaces +var playAsGuestToken = " " function QuestionView({type= "COMPETITIVE", amount=5}){ const [numQuestion, setnumQuestion] = useState(-1); const [questions, setQuestions] = useState(null); const[t, i18n] = useTranslation("global"); - const cookie = JSON.parse(Cookies.get('user')) + const cookie = JSON.parse(Cookies.get('user')??JSON.stringify({username : playAsGuestUsername, token : playAsGuestToken})) const [audio] = useState(new Audio('/tictac.mp3')); const generateQuestions = async (numQuestion) => { if (numQuestion < 0) { try { - var generatedQuestions; - if(cookie){ - generatedQuestions = await questionGenerator.generateQuestions(i18n.language, type, amount, cookie.token); - }else{ - generateQuestions = await questionGenerator.generateQuestions(i18n.language, type, amount, null);//playing as guest - } + var generatedQuestions = await questionGenerator.generateQuestions(i18n.language, type, amount, cookie.token); setQuestions(generatedQuestions); setnumQuestion(0); } catch (error) { @@ -114,7 +111,7 @@ function QuestionView({type= "COMPETITIVE", amount=5}){ creationHistoricalRecord.setCompetitive(type === 'COMPETITIVE'); creationHistoricalRecord.setDate(Date.now()); creationHistoricalRecord.setPoints(points); - if(cookie) + if(cookie.username !== playAsGuestUsername) creationHistoricalRecord.sendRecord(cookie.username, cookie.token); } }, 1000); From 8479e47853f00ea187848265c1c019fefe8ec98c Mon Sep 17 00:00:00 2001 From: Mister-Mario Date: Wed, 24 Apr 2024 20:57:18 +0200 Subject: [PATCH 4/4] Fixed tests to test with new home --- webapp/src/components/Home/Home.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/components/Home/Home.test.js b/webapp/src/components/Home/Home.test.js index 0d16902..78b3633 100644 --- a/webapp/src/components/Home/Home.test.js +++ b/webapp/src/components/Home/Home.test.js @@ -22,8 +22,8 @@ describe('Home component', () => { // Click toggle open button fireEvent.click(screen.getByTitle("home.clickOpen")); - // Icons of instructions, login and signup must be shown - expect(screen.getByAltText('Instructions')).toBeVisible(); + // Icons of play as guest, login and signup must be shown + expect(screen.getByAltText('Game')).toBeVisible(); expect(screen.getByAltText('Login')).toBeVisible(); expect(screen.getByAltText('Add user')).toBeVisible();