(3-1) 미디어 순서 / (3-10) 자막 시작시간 로직 변경
This commit is contained in:
@@ -9,10 +9,10 @@ const { DOMParser } = require('xmldom');
|
||||
const findSimilarString = require('./findSimilarString');
|
||||
|
||||
// --------------------------------------------------------
|
||||
const scoringJson = require('./DIC_2521A.json');
|
||||
// const scoringJson = require('./DIC_2521A.json');
|
||||
// const scoringJson = require('./DIC_2521B.json');
|
||||
// const scoringJson = require('./DIC_2521C.json');
|
||||
// const scoringJson = require('./DIC_2521D.json');
|
||||
const scoringJson = require('./DIC_2521D.json');
|
||||
|
||||
// TEST
|
||||
// const scoringJson = require('./DIC_2521A_TEST.json');
|
||||
@@ -20,10 +20,10 @@ const scoringJson = require('./DIC_2521A.json');
|
||||
// const scoringJson = require('./DIC_2521C_TEST.json');
|
||||
// const scoringJson = require('./DIC_2521D_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';
|
||||
const answerFilesDir = './output/D/DIC';
|
||||
|
||||
// TEST
|
||||
// const answerFilesDir = './output/A/TEST';
|
||||
@@ -32,10 +32,10 @@ const answerFilesDir = './output/A/DIC';
|
||||
// const answerFilesDir = './output/D/TEST';
|
||||
|
||||
// --------------------------------------------------------
|
||||
const outputExcelFile = './DIC_2521A_result.xlsx';
|
||||
// const outputExcelFile = './DIC_2521A_result.xlsx';
|
||||
// const outputExcelFile = './DIC_2521B_result.xlsx';
|
||||
// const outputExcelFile = './DIC_2521C_result.xlsx';
|
||||
// const outputExcelFile = './DIC_2521D_result.xlsx';
|
||||
const outputExcelFile = './DIC_2521D_result.xlsx';
|
||||
|
||||
// TEST
|
||||
// const outputExcelFile = './DIC_2521A_TEST.xlsx';
|
||||
@@ -141,6 +141,7 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
// 채점기준표 문항별 분류
|
||||
for (const key in scoringData) {
|
||||
let ele = scoringData[key].ele;
|
||||
const ele2 = scoringData[key].ele2;
|
||||
let existEle = scoringData[key].existEle;
|
||||
const rightAnswer = scoringData[key].value;
|
||||
const point = scoringData[key].point;
|
||||
@@ -156,7 +157,7 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
* > 멀티라인 텍스트 유사도 판별하기 어려움
|
||||
*/
|
||||
if (search !== undefined) {
|
||||
let result = findSimilarString(gmepXmlDoc, search, 0.2)
|
||||
let result = findSimilarString(gmepXmlDoc, search, 1.0)
|
||||
ele = ele.replace(/{search}/g, result);
|
||||
if ( existEle !== undefined ){
|
||||
existEle = existEle.replace(/{search}/g, result);
|
||||
@@ -185,7 +186,8 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
|
||||
if (trackListNode) {
|
||||
// CRTrackClip 요소의 ClipIndex를 참조하여 CRClip 요소의 Path와 Type 출력
|
||||
const clipIndexes = xpath.select('CRTrackClip[not(@Type="0")]/@ClipIndex', trackListNode);
|
||||
const clipIndexes = xpath.select('CRTrackClip[@ClipIndex!="-1"][@Length!="1"]/@ClipIndex'
|
||||
, trackListNode);
|
||||
clipIndexes.forEach(indexNode => {
|
||||
const clipIndex = parseInt(indexNode.value, 10) + 1; // XPath는 1-based index를 사용
|
||||
console.log(`clipIndex: ${clipIndex}`);
|
||||
@@ -202,7 +204,7 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
values.push(clipPathNode.value);
|
||||
});
|
||||
// values에 값이 있는지 확인
|
||||
if (values.length == 0) {
|
||||
if (values.length == 0 || values.length < 4) {
|
||||
console.log('values length 0');
|
||||
scoringResult[key] = 0;
|
||||
continue;
|
||||
@@ -278,12 +280,15 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
else if (type == "range") {
|
||||
const start = scoringData[key].start;
|
||||
const end = scoringData[key].end;
|
||||
|
||||
|
||||
try{
|
||||
const result = xpath.select(ele, gmepXmlDoc);
|
||||
let result = xpath.select(ele, gmepXmlDoc);
|
||||
if (result.length == 0) {
|
||||
scoringResult[key] = 0;
|
||||
continue;
|
||||
result = xpath.select(ele2, gmepXmlDoc);
|
||||
if (result.length == 0 ) {
|
||||
scoringResult[key] = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// 수험자 답안 자막 좌표 (x,y)
|
||||
@@ -386,12 +391,18 @@ function getGmepScore(gmepData, scoringJson, index) {
|
||||
|
||||
} else {
|
||||
console.log(`not found. ${existEle} `);
|
||||
scoringResult[key] = 0;
|
||||
const result = xpath.select1(ele, gmepXmlDoc);
|
||||
console.log("🚀 ~ getGmepScore ~ result:", result)
|
||||
if ( result == rightAnswer ) {
|
||||
totalScore += point;
|
||||
scoringResult[key] = point;
|
||||
}
|
||||
else {
|
||||
scoringResult[key] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
const ele2 = scoringData[key].ele2;
|
||||
|
||||
console.log('Unknown type:', ele);
|
||||
let result = xpath.select(ele, gmepXmlDoc);
|
||||
let result2 = null;
|
||||
|
||||
Reference in New Issue
Block a user