문제 1,2 채점 및 합산 처리 / 채점기준표 수정 적용

This commit is contained in:
2025-04-04 17:28:05 +09:00
parent b56019f976
commit 01cf766b4b
7 changed files with 70 additions and 31 deletions

BIN
250404_DIC_2503A_TEST.xlsx Normal file

Binary file not shown.

Binary file not shown.

BIN
250404_DIC_2503B_TEST.xlsx Normal file

Binary file not shown.

View File

@@ -30,7 +30,11 @@
}, },
"8": { "8": {
"ele": "$[?(@.width == 65 && @.height == 45)]", "ele": "$[?(@.width == 65 && @.height == 45)]",
"type": "boolean", "type": "size",
"value": {
"width": 65,
"height": 45
},
"point": 10 "point": 10
}, },
"9": { "9": {
@@ -53,8 +57,8 @@
"point": 0 "point": 0
}, },
"4": { "4": {
"ele": "$.children[?(@.name=='놀이터')]", "ele": "$.children[?(@.name=='놀이터')].name",
"type": "boolean", "value": "놀이터",
"point": 10 "point": 10
}, },
"5": { "5": {
@@ -139,8 +143,8 @@
"point": 0 "point": 0
}, },
"22": { "22": {
"ele": "$.children[?(@.name=='은행잎')]", "ele": "$.children[?(@.name=='은행잎')].name",
"type": "boolean", "value": "은행잎",
"point": 10 "point": 10
}, },
"23": { "23": {
@@ -157,7 +161,11 @@
}, },
"26": { "26": {
"ele": "$[?(@.width == 65 && @.height == 35)]", "ele": "$[?(@.width == 65 && @.height == 35)]",
"type": "boolean", "type": "size",
"value": {
"width": 65,
"height": 35
},
"point": 10 "point": 10
}, },
"27": { "27": {

View File

@@ -30,7 +30,11 @@
}, },
"8": { "8": {
"ele": "$[?(@.width == 65 && @.height == 45)]", "ele": "$[?(@.width == 65 && @.height == 45)]",
"type": "boolean", "type": "size",
"value": {
"width": 65,
"height": 45
},
"point": 10 "point": 10
}, },
"9": { "9": {
@@ -159,7 +163,11 @@
}, },
"27": { "27": {
"ele": "$[?(@.width == 65 && @.height == 45)]", "ele": "$[?(@.width == 65 && @.height == 45)]",
"type": "boolean", "type": "size",
"value": {
"width": 65,
"height": 45
},
"point": 10 "point": 10
}, },
"28": { "28": {

View File

@@ -30,7 +30,11 @@
}, },
"8": { "8": {
"ele": "$[?(@.width == 65 && @.height == 45)]", "ele": "$[?(@.width == 65 && @.height == 45)]",
"type": "boolean", "type": "size",
"value": {
"width": 65,
"height": 45
},
"point": 10 "point": 10
}, },
"9": { "9": {
@@ -53,8 +57,8 @@
"point": 0 "point": 0
}, },
"4": { "4": {
"ele": "$.children[?(@.name=='나무집')]", "ele": "$.children[?(@.name=='나무집')].name",
"type": "boolean", "value": "나무집",
"point": 10 "point": 10
}, },
"5": { "5": {
@@ -139,8 +143,8 @@
"point": 0 "point": 0
}, },
"22": { "22": {
"ele": "$.children[?(@.name=='나무 의자')]", "ele": "$.children[?(@.name=='나무 의자')].name",
"type": "boolean", "value": "나무 의자",
"point": 10 "point": 10
}, },
"23": { "23": {
@@ -157,7 +161,11 @@
}, },
"26": { "26": {
"ele": "$[?(@.width == 65 && @.height == 35)]", "ele": "$[?(@.width == 65 && @.height == 35)]",
"type": "boolean", "type": "size",
"value": {
"width": 65,
"height": 35
},
"point": 10 "point": 10
}, },
"27": { "27": {

View File

@@ -12,39 +12,35 @@ const getToday = require('./getToday.js');
const todayDate = getToday(); const todayDate = getToday();
// -------------------------------------------------------- // --------------------------------------------------------
const scoringJson = require('./DIC_2503A.json'); // const scoringJson = require('./DIC_2503A.json');
// const scoringJson = require('./DIC_2503B.json'); const scoringJson = require('./DIC_2503B.json');
// const scoringJson = require('./DIC_2503C.json'); // const scoringJson = require('./DIC_2503C.json');
// const scoringJson = require('./DIC_2503D.json'); // const scoringJson = require('./DIC_2503D.json');
// TEST
// const scoringJson = require('./DIC_2503A_TEST.json');
// const scoringJson = require('./DIC_2503B_TEST.json');
// const scoringJson = require('./DIC_2503C_TEST.json');
// const scoringJson = require('./DIC_2503D_TEST.json');
// -------------------------------------------------------- // --------------------------------------------------------
const answerFilesDir = './output/A/DIC'; // const answerFilesDir = './output/A/DIC';
// const answerFilesDir = './output/B/DIC'; // const answerFilesDir = './output/B/DIC';
// const answerFilesDir = './output/C/DIC'; // const answerFilesDir = './output/C/DIC';
// const answerFilesDir = './output/D/DIC'; // const answerFilesDir = './output/D/DIC';
// TEST // TEST
// const answerFilesDir = './output/A/TEST'; // const answerFilesDir = './output/A/TEST';
// const answerFilesDir = './output/B/TEST'; const answerFilesDir = './output/B/TEST';
// const answerFilesDir = './output/C/TEST'; // const answerFilesDir = './output/C/TEST';
// const answerFilesDir = './output/D/TEST'; // const answerFilesDir = './output/D/TEST';
// -------------------------------------------------------- // --------------------------------------------------------
const outputExcelFile = './'+todayDate+'_DIC_2503A_채점결과.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503A_채점결과.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2503B_채점결과.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503B_채점결과.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2503C_채점결과.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503C_채점결과.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2503D_채점결과.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503D_채점결과.xlsx';
// TEST // TEST
// const outputExcelFile = './'+todayDate+'_DIC_2503A_TEST.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503A_TEST.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2503B_TEST.xlsx'; const outputExcelFile = './'+todayDate+'_DIC_2503B_TEST.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2503C_TEST.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503C_TEST.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2503D_TEST.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503D_TEST.xlsx';
// -------------------------------------------------------- // --------------------------------------------------------
@@ -708,10 +704,15 @@ function getScore(psdData, scoring, index) {
scoringResult[key] = 0; scoringResult[key] = 0;
continue; continue;
} }
if (type == "boolean") { if (type == "size") {
// console.log(`result ${result.length}`); // console.log(`result ${result.length}`);
if ( result[0].height == value['height'] && result[0].width == value['width'] ) {
scoringResult[key] = result.length > 0 ? point : 0; scoringResult[key] = point;
totalScore += point;
}
else {
scoringResult[key] = 0;
}
} }
// value가 color code인 경우 R,G,B를 16진수로 변환하여 비교하고 같다면 점수 부여 // value가 color code인 경우 R,G,B를 16진수로 변환하여 비교하고 같다면 점수 부여
// value: "ffa200" // value: "ffa200"
@@ -729,7 +730,13 @@ function getScore(psdData, scoring, index) {
// } // }
// console.log(`color: ${color}`); // console.log(`color: ${color}`);
scoringResult[key] = result.length > 0 && value === color ? point : 0; if ( color === value ) {
scoringResult[key] = point;
totalScore += point;
}
else {
scoringResult[key] = 0;
}
} }
// type이 font인 경우 font의 이름만 추출하여 비교 // type이 font인 경우 font의 이름만 추출하여 비교
// value: "Arial" // value: "Arial"
@@ -738,9 +745,17 @@ function getScore(psdData, scoring, index) {
const font = result[0].split('-')[0]; const font = result[0].split('-')[0];
// console.log(`result ${result}`); // console.log(`result ${result}`);
// console.log(`font: ${font}`); // console.log(`font: ${font}`);
scoringResult[key] = result.length > 0 && value === font ? point : 0;
}
if ( font === value ) {
scoringResult[key] = point;
totalScore += point;
}
else {
scoringResult[key] = 0;
}
// font가 여러개일 경우
// scoringResult[key] = result.length > 0 && value === font ? point : 0;
}
else if (result[0] === value) { else if (result[0] === value) {
scoringResult[key] = point; scoringResult[key] = point;
totalScore += point; totalScore += point;