Skip to content

Commit

Permalink
refactor: nippons wishes v2
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyRAV committed Dec 11, 2023
1 parent 8fb417b commit 822a6c3
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions controllers/historyController.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,8 @@ const quizHistory = async (req, res) => {
questions: quiz.questions.map(q => {
return {
text: q.text,
correct_answer: q.correct_answer,
user_response: q.user_responses.map(ur => {
return {
userAnswer: ur.user_answer,
is_correct: ur.is_correct
};
})[0]
correctAnswer: q.correct_answer,
userAnswer: q.user_responses[0].user_answer,
};
})
}
Expand Down

0 comments on commit 822a6c3

Please sign in to comment.