2506회 정기 채점결과

This commit is contained in:
2025-07-04 17:41:58 +09:00
parent 1ef8d2faf8
commit 6d9682ce80
20 changed files with 3012 additions and 50 deletions

View File

@@ -14,13 +14,13 @@ const getToday = require('./getToday.js');
const todayDate = getToday();
const examRound = '2506';
// const DICorDPI = 'DIC'
const DICorDPI = 'DPI'
const DICorDPI = 'DIC'
// const DICorDPI = 'DPI'
const examTypes = [
// 'A',
// 'B',
'A',
'B',
'C',
// 'D'
'D'
];
// testMode가 true일 경우 TEST 폴더에 있는 답안 파일을 읽어옴
@@ -30,7 +30,9 @@ const testMode = false;
const outputExcelFiles = [];
examTypes.forEach(type => {
const scoringJson = require(`./${DICorDPI}_${examRound}${type}.json`);
const jsonPath = `./${DICorDPI}_${examRound}${type}.json`
if ( !fs.existsSync(jsonPath)) return;
const scoringJson = require(jsonPath);
const answerFilesDir = `./output/${examRound}/${type}/${testMode ? 'TEST' : DICorDPI}`;
let outputExcelFile = `./${todayDate}_${DICorDPI}_${examRound}${type}_채점결과.xlsx`;
if (testMode) {
@@ -516,7 +518,7 @@ function getGmepScore(gmepData, scoringJson, index) {
const crFilter = xpath.select1(xpathExpr, gmepXmlDoc);
if (!crFilter) {
userAnswer = null;
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
// totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
}
else {
userAnswer = {}
@@ -529,15 +531,17 @@ function getGmepScore(gmepData, scoringJson, index) {
const attr = attributes.getNamedItem(keyName);
userAnswer[keyName] = attr ? attr.value : null;
}
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
// totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
}
}
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
}
// 동영상 클립 트랜지션 [2-15, 18, 21]
else if (type === 'clipTransition') {
const crclipIndex = getCRClipIndex(media);
let crtrackClipIndex = getCRTrackClipIndex(crclipIndex, "비디오1");
let isMatched = false;
if (crtrackClipIndex == -1) {
userAnswer = null;
@@ -559,7 +563,6 @@ function getGmepScore(gmepData, scoringJson, index) {
}
else {
userAnswer = {};
let isMatched = false;
for (let i = 0; i < crTransFilter.length; i++) {
const crTransFilterNode = crTransFilter[i];
@@ -598,18 +601,18 @@ function getGmepScore(gmepData, scoringJson, index) {
}
}
}
// 일치하지 않으면 null 처리
if (!isMatched) {
// userAnswer = null;
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
}
else {
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult, {
type: 'force-correct'
});
}
}
}
// 일치하지 않으면 null 처리
if (!isMatched) {
// userAnswer = null;
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
}
else {
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult, {
type: 'force-correct'
});
}
}
else if (type == "Mute") {
@@ -633,7 +636,7 @@ function getGmepScore(gmepData, scoringJson, index) {
else {
const xpathExpr = ele?.replace(/{CRClipIndex}/g, crclipIndex);
const imageLength = xpath.select1(xpathExpr, gmepXmlDoc);
userAnswer = parseInt(imageLength.value, 10);
userAnswer = parseInt(imageLength?.value ?? '0', 10);
}
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
}
@@ -654,7 +657,7 @@ function getGmepScore(gmepData, scoringJson, index) {
userAnswer = null;
} else {
const length = crTrackClip.getAttribute('Length');
userAnswer = parseInt(length, 10);
userAnswer = parseInt(length ?? '0', 10);
}
}
else if (type.includes('Effect')) {
@@ -716,7 +719,7 @@ function getGmepScore(gmepData, scoringJson, index) {
const crtrackClipIndex = getCRTrackClipIndex(index, "텍스트") + 1 // XML 1-based index
const clipLength = xpath.select1(`//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[${crtrackClipIndex}]/@Length`, gmepXmlDoc);
userAnswer = parseInt(clipLength.value, 10);
userAnswer = parseInt(clipLength?.value ?? '0', 10);
totalScore += compareAndScore(userAnswer, rightAnswer, point, key, scoringResult);
}
// 자막 텍스트(글자, 폰트, 크기, 색상) [2-5, 6, 7, 8] [2-22, 23, 24, 25]