Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-kale-01 committed Mar 20, 2024
2 parents 3625cd2 + 40b8309 commit 9119cb4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 17 deletions.
17 changes: 11 additions & 6 deletions 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 Expand Up @@ -141,11 +146,11 @@ router.post("/getbystudent", bypass, async (req, res) => {
.json({ success: 0, message: "NO Exam Found!" });
}

// if(exam.questions.length > 10){
// const random = getRandomElements(exam.questions,10)
// console.log(random)
// exam.questions = random
// }
if(exam.questions.length > 8){
const random = getRandomElements(exam.questions,10)
console.log(random)
exam.questions = random
}



Expand Down
2 changes: 1 addition & 1 deletion backend/router/submission.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function calculateSimilarity(teacherAnswer, studentAnswer) {


const calculateScore =async (submission) =>{
console.log("Submission : ",submission)
// console.log("Submission : ",submission)
let score = 0;

// console.log()
Expand Down
20 changes: 10 additions & 10 deletions frontend/src/Components/WebcamProctor/WebcamProctor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ function App(props) {
);

// Send base64 image to Flask backend
// let res = await fetch("http://localhost:5000/upload_image", {
// method: "POST",
// headers: {
// "Content-Type": "application/json",
// },
// body: JSON.stringify({ current: base64Image, examinee: localStorage.getItem(OG_FACE) }),
// });

// res = await res.json()
// console.log(res)
let res = await fetch("http://localhost:5000/upload_image", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ current: base64Image, start: localStorage.getItem(OG_FACE) }),
});

res = await res.json()
console.log(res)
};

return (
Expand Down

0 comments on commit 9119cb4

Please sign in to comment.