formatted stylesheet

This commit is contained in:
Karma Riuk
2025-05-10 22:31:41 +02:00
parent 0a0e1b73fb
commit 9e69d376c6
3 changed files with 10 additions and 21 deletions

View File

@ -81,10 +81,10 @@ table tbody tr:hover {
/* style id column values */ /* style id column values */
table tbody td:nth-child(1) { table tbody td:nth-child(1) {
font-family: monospace; font-family: monospace;
width: 8ch; width: 8ch;
white-space: normal; white-space: normal;
word-break: break-all; word-break: break-all;
} }
/* style score header */ /* style score header */

View File

@ -80,23 +80,12 @@ router.post("/submit/comments", upload.single("file"), async (req, res) => {
io.to(socketId).emit("started-processing"); io.to(socketId).emit("started-processing");
} }
evaluate_comments( const results = evaluate_comments(validatedData, (percent) => {
validatedData, if (!(socketId && io.sockets.sockets.has(socketId))) return;
(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",
data: validatedData,
}); });
res.status(200).json(results);
} catch (error) { } catch (error) {
console.error("Error processing submission:", error); console.error("Error processing submission:", error);
res.status(500).json({ error: "Error processing submission" }); res.status(500).json({ error: "Error processing submission" });

View File

@ -15,7 +15,7 @@ function buildReferenceMap(dataset_path) {
const REFERENCE_MAP = buildReferenceMap(getProjectPath("data/dataset.json")); const REFERENCE_MAP = buildReferenceMap(getProjectPath("data/dataset.json"));
export const evaluate_comments = async (answers, percent_cb, finished_cb) => { export const evaluate_comments = (answers, percent_cb) => {
const total = Object.keys(answers).length; const total = Object.keys(answers).length;
let i = 0; let i = 0;
const results = {}; const results = {};
@ -42,7 +42,7 @@ export const evaluate_comments = async (answers, percent_cb, finished_cb) => {
}; };
percent_cb(Math.floor((++i / total) * 100)); percent_cb(Math.floor((++i / total) * 100));
} }
finished_cb(results); return results;
}; };
export const evaluate_refinement = async (answers, percent_cb, finished_cb) => { export const evaluate_refinement = async (answers, percent_cb, finished_cb) => {