Skip to content

Commit

Permalink
only one grade needed
Browse files Browse the repository at this point in the history
  • Loading branch information
pandavenger committed Oct 28, 2024
1 parent ed82427 commit 506e67a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions routes/application-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 506e67a

Please sign in to comment.