refactor: auto grading splitter

This commit is contained in:
elangptra 2024-12-02 14:51:01 +07:00
parent b524a0a41a
commit 2da2950c84

View File

@ -55,8 +55,8 @@ export const checkCorrectAnswers = async (req, res, next) => {
where: { ID_ADMIN_EXERCISE }, where: { ID_ADMIN_EXERCISE },
}); });
if (matchingPairs && matchingPairs.length > 0) { if (matchingPairs && matchingPairs.length > 0) {
const studentAnswers = ANSWER_STUDENT.split(",").map((pair) => { const studentAnswers = ANSWER_STUDENT.split("|").map((pair) => {
const [left, right] = pair.split("-"); const [left, right] = pair.split(">");
return { return {
LEFT_PAIR: left ? left.trim() : "", LEFT_PAIR: left ? left.trim() : "",