Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ram #15

Merged
merged 2 commits into from
Nov 28, 2023
Merged

Ram #15

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading