added table to show results in frontend

This commit is contained in:
Karma Riuk
2025-05-08 00:11:21 +02:00
parent 173a84aa2b
commit fe064218f5
5 changed files with 101 additions and 6 deletions

View File

@ -80,11 +80,18 @@ router.post("/submit/comments", upload.single("file"), async (req, res) => {
io.to(socketId).emit("started-processing");
}
evaluate_comments(validatedData, (percent) => {
if (!(socketId && io.sockets.sockets.has(socketId))) return;
evaluate_comments(
validatedData,
(percent) => {
if (!(socketId && io.sockets.sockets.has(socketId))) return;
io.to(socketId).emit("progress", { percent });
});
io.to(socketId).emit("progress", { percent });
},
(results) => {
if (!(socketId && io.sockets.sockets.has(socketId))) return;
io.to(socketId).emit("ended-processing", results);
},
);
res.status(200).json({
message: "Answer submitted successfully",