From 16747d6296ee07eff4becd23f4120d2ca714e2e8 Mon Sep 17 00:00:00 2001 From: kushwahramkumar2003 Date: Sun, 19 Nov 2023 15:48:26 +0530 Subject: [PATCH] Fix variable name in quiz.controllers.js --- Server/src/controllers/quiz.controllers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/src/controllers/quiz.controllers.js b/Server/src/controllers/quiz.controllers.js index 0ee25f0..5db4869 100755 --- a/Server/src/controllers/quiz.controllers.js +++ b/Server/src/controllers/quiz.controllers.js @@ -347,7 +347,7 @@ exports.getQuizResults = asyncHandler(async (req, res) => { return res.status(404).json({ message: "Quiz not found" }); } - const results = await Result.find({ quiz: quiz._id }).populate( + const results = await QuizResult.find({ quiz: quiz._id }).populate( "user", "name email" ); @@ -452,7 +452,7 @@ exports.submitQuizOnTimeUp = asyncHandler(async (req, res) => { exports.getQuizResultsForUser = asyncHandler(async (req, res) => { try { const { id, userId } = req.params; - const quizResults = await QuizResults.findOne({ + const quizResults = await QuizResult.findOne({ quiz: id, user: userId, }).populate("quiz", "title"); @@ -474,7 +474,7 @@ exports.getQuizResultsForUser = asyncHandler(async (req, res) => { exports.getAllResultsForQuiz = asyncHandler(async (req, res) => { try { const { id } = req.params; - const quizResults = await QuizResults.find({ quiz: id }).populate( + const quizResults = await QuizResult.find({ quiz: id }).populate( "user", "name email" );