(3-1)클립 조각, 공백 5프레임 이하 무시하도록 변경

This commit is contained in:
2025-02-20 18:30:42 +09:00
parent e16b158831
commit 3935dd45b1
6 changed files with 39 additions and 16 deletions

3
.gitignore vendored
View File

@@ -132,4 +132,7 @@ dist
output
# xpath notebook
.xbook
회차별채점자료/*/정답파일

BIN
250220_DIC_2521A_TEST.xlsx Normal file

Binary file not shown.

View File

@@ -101,7 +101,6 @@ xpath 테스트 용
5. CRTrackClip
* Type="0" ClipIndex="-1" : 공백
*
5. todo
* 자막 위치 검사하는 로직 원복
@@ -135,3 +134,8 @@ xpath 테스트 용
* 자막 클립의 앞이 잘리게 되면 트림시간이 생성되어 CRTrackClip태그의 속성값들이 변경 됨
* CRTrackClip 태그 ClipLength, Length, Pos 속성값 비교 연산 필요
* ClipLength - Length = Pos
1. 클립 조각 발생 스킵 여부 (5프레임)
- 멀티미디어-003678-신은재(A) 2프레임 : (3-1) 배열 점수 추가
2. 배열(모션이미지클립 처리여부)
3. 오디오

12
getToday.js Normal file
View File

@@ -0,0 +1,12 @@
const getToday = () => {
const now = new Date();
const yy = String(now.getFullYear()).slice(2); // 연도 끝 두 자리
const mm = String(now.getMonth() + 1).padStart(2, "0"); // 월 (01~12)
const dd = String(now.getDate()).padStart(2, "0"); // 일 (01~31)
return `${yy}${mm}${dd}`;
};
// 실행
console.log(getToday()); // 예: 240217 (2024년 2월 17일)
module.exports = getToday;

View File

@@ -7,12 +7,14 @@ const xpath = require('xpath');
const { DOMParser } = require('xmldom');
const findSimilarString = require('./findSimilarString');
const getToday = require('./getToday.js');
const todayDate = getToday();
// --------------------------------------------------------
// 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');
@@ -23,25 +25,25 @@ const scoringJson = require('./DIC_2521D.json');
// 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';
const answerFilesDir = './output/A/TEST';
// const answerFilesDir = './output/B/TEST';
// const answerFilesDir = './output/C/TEST';
// const answerFilesDir = './output/D/TEST';
// --------------------------------------------------------
// 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 = './'+todayDate+'_DIC_2521A_result.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2521B_result.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2521C_result.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2521D_result.xlsx';
// TEST
// const outputExcelFile = './DIC_2521A_TEST.xlsx';
// const outputExcelFile = './DIC_2521B_TEST.xlsx';
// const outputExcelFile = './DIC_2521C_TEST.xlsx';
const outputExcelFile = './DIC_2521D_TEST.xlsx';
const outputExcelFile = './'+todayDate+'_DIC_2521A_TEST.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2521B_TEST.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2521C_TEST.xlsx';
// const outputExcelFile = './'+todayDate+'_DIC_2521D_TEST.xlsx';
// --------------------------------------------------------
// 답안 폴더 내부에 디렉토리가 아닌 일반 파일이 있을 경우 디렉토리만 필터링 해서 불러옴
@@ -186,7 +188,9 @@ function getGmepScore(gmepData, scoringJson, index) {
if (trackListNode) {
// CRTrackClip 요소의 ClipIndex를 참조하여 CRClip 요소의 Path와 Type 출력
const clipIndexes = xpath.select('CRTrackClip[@ClipIndex!="-1"][@Length!="1"]/@ClipIndex'
// @Length(클립재생길이) 5프레임 이하, @ClipLength -1인 항목은 제외
// 10프레임은 타임라인상 눈에 잘 보여서 5프레임으로 우선 수정
const clipIndexes = xpath.select('CRTrackClip[not(@Length<="5" and @ClipLength="-1")]/@ClipIndex'
, trackListNode);
clipIndexes.forEach(indexNode => {
const clipIndex = parseInt(indexNode.value, 10) + 1; // XPath는 1-based index를 사용

File diff suppressed because one or more lines are too long