From 2da2950c842f111b9d156ebda495e6a08b6e5edc Mon Sep 17 00:00:00 2001 From: elangptra Date: Mon, 2 Dec 2024 14:51:01 +0700 Subject: [PATCH] refactor: auto grading splitter --- middlewares/autoGrading.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/middlewares/autoGrading.js b/middlewares/autoGrading.js index 27ae29c..2b1bfa6 100644 --- a/middlewares/autoGrading.js +++ b/middlewares/autoGrading.js @@ -55,8 +55,8 @@ export const checkCorrectAnswers = async (req, res, next) => { where: { ID_ADMIN_EXERCISE }, }); if (matchingPairs && matchingPairs.length > 0) { - const studentAnswers = ANSWER_STUDENT.split(",").map((pair) => { - const [left, right] = pair.split("-"); + const studentAnswers = ANSWER_STUDENT.split("|").map((pair) => { + const [left, right] = pair.split(">"); return { LEFT_PAIR: left ? left.trim() : "",