From 506e67a45238f390b4c8c69a44bed38dd69ef1b3 Mon Sep 17 00:00:00 2001 From: pandavenger Date: Mon, 28 Oct 2024 00:08:28 -0400 Subject: [PATCH] only one grade needed --- routes/application-api.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/routes/application-api.js b/routes/application-api.js index 106820a..5ea514e 100644 --- a/routes/application-api.js +++ b/routes/application-api.js @@ -421,13 +421,13 @@ apiApp.get('/random-answer/:questionID', async (request, response) => { ], }); answers = answers.filter((answer) => { - const subgrades = answer.question.subgrades.replace(' ', '').split(','); + //const subgrades = answer.question.subgrades.replace(' ', '').split(','); - for (const subgrade of subgrades){ - if (!answer.scores.some(score => score.host_name === auth && score.subgrade === subgrade)){ - return true; - } + //for (const subgrade of subgrades){ + if (!answer.scores.some(score => score.host_name === auth /*&& score.subgrade === subgrade*/)){ + return true; } + //} return false; });