2503회 채점기준표 작성
This commit is contained in:
@@ -12,39 +12,39 @@ const getToday = require('./getToday.js');
|
||||
const todayDate = getToday();
|
||||
|
||||
// --------------------------------------------------------
|
||||
const scoringJson = require('./DIC_2502A.json');
|
||||
// const scoringJson = require('./DIC_2502B.json');
|
||||
// const scoringJson = require('./DIC_2502C.json');
|
||||
// const scoringJson = require('./DIC_2502D.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_2502A_TEST.json');
|
||||
// const scoringJson = require('./DIC_2502B_TEST.json');
|
||||
// const scoringJson = require('./DIC_2502C_TEST.json');
|
||||
// const scoringJson = require('./DIC_2502D_TEST.json');
|
||||
// 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/A/TEST';
|
||||
// const answerFilesDir = './output/B/TEST';
|
||||
// const answerFilesDir = './output/C/TEST';
|
||||
// const answerFilesDir = './output/D/TEST';
|
||||
|
||||
// --------------------------------------------------------
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2502A_채점결과.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2502B_채점결과.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2502C_채점결과.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2502D_채점결과.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_2502A_TEST.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2502B_TEST.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2502C_TEST.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2502D_TEST.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2503A_TEST.xlsx';
|
||||
// const outputExcelFile = './' + todayDate + '_DIC_2503B_TEST.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2503C_TEST.xlsx';
|
||||
// const outputExcelFile = './'+todayDate+'_DIC_2503D_TEST.xlsx';
|
||||
// --------------------------------------------------------
|
||||
|
||||
|
||||
@@ -173,7 +173,6 @@ function getTrackClipNode(xmlDoc, type, videoStartTime, openingStartTime) {
|
||||
const trackClipNode1 = xpath.select1(`//CRTrackList[@Name="텍스트"]/CRTrackClip[not(@ClipIndex='-1')][${subtitleOrder}]`, xmlDoc);
|
||||
const trackClipNode2 = xpath.select1(`//CRTrackList[@Name='텍스트']/CRTrackClip[sum(preceding-sibling::CRTrackClip/@Length) = ${startTime}]`, xmlDoc);
|
||||
|
||||
|
||||
return trackClipNode = trackClipNode1 ?? trackClipNode2;
|
||||
}
|
||||
|
||||
@@ -191,9 +190,9 @@ function getClipIndexBySubtitle(xmlDoc, search) {
|
||||
return null;
|
||||
}
|
||||
const searchResult = search ? findSimilarString(xmlDoc, search, 0.8) : null;
|
||||
const crowneUnitPreceding = searchResult ? xpath.select(`//CROwneUnit[CRCUnitArr[@Name='${searchResult}']]/preceding-sibling::CROwneUnit`, xmlDoc) : null;
|
||||
const cROwneUnitPreceding = searchResult ? xpath.select(`//CROwneUnit[CRCUnitArr[@Name='${searchResult}']]/preceding-sibling::CROwneUnit`, xmlDoc) : null;
|
||||
|
||||
const clipIndex = crowneUnitPreceding ? crowneUnitPreceding.length : null;
|
||||
const clipIndex = cROwneUnitPreceding ? cROwneUnitPreceding.length : null;
|
||||
return clipIndex;
|
||||
}
|
||||
|
||||
@@ -231,7 +230,9 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
const trackClipNode = getTrackClipNode(gmepXmlDoc, type, videoStartTime, openingStartTime);
|
||||
const subtitleIndex = trackClipNode ? parseInt(trackClipNode.getAttribute('ClipIndex'), 10) + 1 : null;
|
||||
const clipIndex = getClipIndexBySubtitle(gmepXmlDoc, search);
|
||||
const subtitleOrder = type === 'video' ? 2 : type === 'opening' ? 1 : null;
|
||||
// const subtitleOrder = type === 'video' ? 2 : type === 'opening' ? 1 : null;
|
||||
// 2503회 문제오류 처리를 위한 임시 변경
|
||||
const subtitleOrder = (type === 'video' || type === 'videoIsExist') ? 2 : (type === 'opening' ? 1 : null);
|
||||
const startTime = type === 'video' ? videoStartTime
|
||||
: type === 'opening' ? openingStartTime : null;
|
||||
|
||||
@@ -259,7 +260,7 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
= [ele, ele2, ele3].map(e => e?.includes('{search}') ? null : e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// console.log("🚀 ~ getGmepScore ~ ele:", ele)
|
||||
// console.log("🚀 ~ getGmepScore ~ ele2:", ele2)
|
||||
// console.log("🚀 ~ getGmepScore ~ ele3:", ele3)
|
||||
@@ -545,6 +546,24 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
scoringResult[key] = 0;
|
||||
}
|
||||
}
|
||||
else if (type == "videoIsExist") {
|
||||
const result = ele ? xpath.select(ele, gmepXmlDoc) : [];
|
||||
const result2 = ele2 ? xpath.select(ele2, gmepXmlDoc) : [];
|
||||
const allResults = [...[result], ...[result2]];
|
||||
|
||||
// 정답이 존재하는지 확인
|
||||
const isMatch = allResults.some(result => rightAnswer.includes(result));
|
||||
if (isMatch) {
|
||||
totalScore += point;
|
||||
scoringResult[key] = point;
|
||||
console.log(`🚀 ~ result.forEach ~ 정답:${rightAnswer} / 작성답안:${allResults}`);
|
||||
}
|
||||
else {
|
||||
scoringResult[key] = 0;
|
||||
console.log("🚀 ~ result.forEach ~ 오답:", rightAnswer)
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
try {
|
||||
console.log('Unknown type:', ele);
|
||||
|
||||
Reference in New Issue
Block a user