Skip to content

Commit

Permalink
Fix Capital in Quiz game.
Browse files Browse the repository at this point in the history
  • Loading branch information
TyVik committed Jan 6, 2024
1 parent 584b350 commit 6537870
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/games/Quiz.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ class Quiz extends Game {
});
}

static prepareQuestions(questions) {
static prepareQuestions(questions, quizBy) {
return shuffle(questions
.map(question => {
return ['name', 'flag', 'coat_of_arms', 'capital']
return quizBy
.map(key => {
if (question[key] === undefined) {
return null;
Expand Down Expand Up @@ -102,7 +102,7 @@ class Quiz extends Game {
.then(response => response.json())
.then(data => {
let regions = Quiz.extractData(data.questions, data.solved);
this.startGame({regions: regions, questions: Quiz.prepareQuestions(data.questions), question: 0});
this.startGame({regions: regions, questions: Quiz.prepareQuestions(data.questions, quizBy), question: 0});
})
.catch(response => {this.setState({...this.state, isLoaded: false})});
this.setState({...this.state, showInit: false});
Expand Down

0 comments on commit 6537870

Please sign in to comment.