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 },
});
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() : "",