Skip to content

Commit

Permalink
returning exam det
Browse files Browse the repository at this point in the history
  • Loading branch information
gautamb02 committed Mar 20, 2024
1 parent 38c7f40 commit 40b8309
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/router/exam.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ router.post("/getres",bypass,async(req,res)=>{
console.log(req.body)
const exams = await Submission.find({studentEmail : email})
console.log(exams)
let examDets = []
for( let i =0;i<exams.length;i++){
const examDet = await Exam.findById(exams[i].examId)
examDets.push(examDet)
}
return res.status(201)
.json({ success: 1, message: "retrieved", exams });
.json({ success: 1, message: "retrieved", exams ,examDets});
} catch (error) {
console.log(error)
res
Expand Down

0 comments on commit 40b8309

Please sign in to comment.