Skip to content

Commit

Permalink
Fix variable name in quiz.controllers.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kushwahramkumar2003 committed Nov 19, 2023
1 parent 18828ba commit 16747d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Server/src/controllers/quiz.controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
Expand Down Expand Up @@ -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");
Expand All @@ -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"
);
Expand Down

0 comments on commit 16747d6

Please sign in to comment.