diff --git a/250404_DIC_2503A_TEST.xlsx b/250404_DIC_2503A_TEST.xlsx new file mode 100644 index 0000000..37169c7 Binary files /dev/null and b/250404_DIC_2503A_TEST.xlsx differ diff --git a/250404_DIC_2503A_채점결과.xlsx b/250404_DIC_2503A_채점결과.xlsx new file mode 100644 index 0000000..63b6715 Binary files /dev/null and b/250404_DIC_2503A_채점결과.xlsx differ diff --git a/250404_DIC_2503B_TEST.xlsx b/250404_DIC_2503B_TEST.xlsx new file mode 100644 index 0000000..5d9f6ec Binary files /dev/null and b/250404_DIC_2503B_TEST.xlsx differ diff --git a/DIC_2503A.json b/DIC_2503A.json index bf493b5..9f0a504 100644 --- a/DIC_2503A.json +++ b/DIC_2503A.json @@ -30,7 +30,11 @@ }, "8": { "ele": "$[?(@.width == 65 && @.height == 45)]", - "type": "boolean", + "type": "size", + "value": { + "width": 65, + "height": 45 + }, "point": 10 }, "9": { @@ -53,8 +57,8 @@ "point": 0 }, "4": { - "ele": "$.children[?(@.name=='놀이터')]", - "type": "boolean", + "ele": "$.children[?(@.name=='놀이터')].name", + "value": "놀이터", "point": 10 }, "5": { @@ -139,8 +143,8 @@ "point": 0 }, "22": { - "ele": "$.children[?(@.name=='은행잎')]", - "type": "boolean", + "ele": "$.children[?(@.name=='은행잎')].name", + "value": "은행잎", "point": 10 }, "23": { @@ -157,7 +161,11 @@ }, "26": { "ele": "$[?(@.width == 65 && @.height == 35)]", - "type": "boolean", + "type": "size", + "value": { + "width": 65, + "height": 35 + }, "point": 10 }, "27": { diff --git a/DIC_2503B.json b/DIC_2503B.json index 9f11d32..29d267e 100644 --- a/DIC_2503B.json +++ b/DIC_2503B.json @@ -30,7 +30,11 @@ }, "8": { "ele": "$[?(@.width == 65 && @.height == 45)]", - "type": "boolean", + "type": "size", + "value": { + "width": 65, + "height": 45 + }, "point": 10 }, "9": { @@ -159,7 +163,11 @@ }, "27": { "ele": "$[?(@.width == 65 && @.height == 45)]", - "type": "boolean", + "type": "size", + "value": { + "width": 65, + "height": 45 + }, "point": 10 }, "28": { diff --git a/DIC_2503C.json b/DIC_2503C.json index 534518b..c974a56 100644 --- a/DIC_2503C.json +++ b/DIC_2503C.json @@ -30,7 +30,11 @@ }, "8": { "ele": "$[?(@.width == 65 && @.height == 45)]", - "type": "boolean", + "type": "size", + "value": { + "width": 65, + "height": 45 + }, "point": 10 }, "9": { @@ -53,8 +57,8 @@ "point": 0 }, "4": { - "ele": "$.children[?(@.name=='나무집')]", - "type": "boolean", + "ele": "$.children[?(@.name=='나무집')].name", + "value": "나무집", "point": 10 }, "5": { @@ -139,8 +143,8 @@ "point": 0 }, "22": { - "ele": "$.children[?(@.name=='나무 의자')]", - "type": "boolean", + "ele": "$.children[?(@.name=='나무 의자')].name", + "value": "나무 의자", "point": 10 }, "23": { @@ -157,7 +161,11 @@ }, "26": { "ele": "$[?(@.width == 65 && @.height == 35)]", - "type": "boolean", + "type": "size", + "value": { + "width": 65, + "height": 35 + }, "point": 10 }, "27": { diff --git a/psdExport_2.js b/psdExport_2.js index 3e71043..f54f010 100644 --- a/psdExport_2.js +++ b/psdExport_2.js @@ -12,39 +12,35 @@ const getToday = require('./getToday.js'); const todayDate = getToday(); // -------------------------------------------------------- -const scoringJson = require('./DIC_2503A.json'); -// const scoringJson = require('./DIC_2503B.json'); +// const scoringJson = require('./DIC_2503A.json'); +const scoringJson = require('./DIC_2503B.json'); // const scoringJson = require('./DIC_2503C.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/C/DIC'; // const answerFilesDir = './output/D/DIC'; // TEST // const answerFilesDir = './output/A/TEST'; -// const answerFilesDir = './output/B/TEST'; +const answerFilesDir = './output/B/TEST'; // const answerFilesDir = './output/C/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_2503C_채점결과.xlsx'; // const outputExcelFile = './'+todayDate+'_DIC_2503D_채점결과.xlsx'; // TEST // 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_2503D_TEST.xlsx'; + // -------------------------------------------------------- @@ -708,10 +704,15 @@ function getScore(psdData, scoring, index) { scoringResult[key] = 0; continue; } - if (type == "boolean") { + if (type == "size") { // console.log(`result ${result.length}`); - - scoringResult[key] = result.length > 0 ? point : 0; + if ( result[0].height == value['height'] && result[0].width == value['width'] ) { + scoringResult[key] = point; + totalScore += point; + } + else { + scoringResult[key] = 0; + } } // value가 color code인 경우 R,G,B를 16진수로 변환하여 비교하고 같다면 점수 부여 // value: "ffa200" @@ -729,7 +730,13 @@ function getScore(psdData, scoring, index) { // } // 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의 이름만 추출하여 비교 // value: "Arial" @@ -738,9 +745,17 @@ function getScore(psdData, scoring, index) { const font = result[0].split('-')[0]; // console.log(`result ${result}`); // 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) { scoringResult[key] = point; totalScore += point;