타임라인 이름 '비디오2'인 경우도 정답처리

This commit is contained in:
2025-04-01 14:41:14 +09:00
parent b842db795d
commit 493aca1ed1
7 changed files with 40 additions and 28 deletions

Binary file not shown.

BIN
250401_DIC_2503C_TEST.xlsx Normal file

Binary file not shown.

View File

@@ -228,16 +228,16 @@
"point": 2 "point": 2
}, },
"10": { "10": {
"ele": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)", "ele": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)",
"ele2": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)", "ele2": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)",
"search": "자연 놀이터", "search": "자연 놀이터",
"type": "video", "type": "video",
"value": 170, "value": 170,
"point": 2 "point": 2
}, },
"11": { "11": {
"ele": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length", "ele": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length",
"ele2": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length", "ele2": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length",
"search": "자연 놀이터", "search": "자연 놀이터",
"type": "video", "type": "video",
"value": "120", "value": "120",
@@ -384,16 +384,16 @@
"point": 3 "point": 3
}, },
"28": { "28": {
"ele": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)", "ele": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)",
"ele2": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)", "ele2": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)",
"search": "자연 속 놀이터 Nature playground", "search": "자연 속 놀이터 Nature playground",
"type": "opening", "type": "opening",
"value": 0, "value": 0,
"point": 2 "point": 2
}, },
"29": { "29": {
"ele": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length", "ele": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length",
"ele2": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length", "ele2": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length",
"search": "자연 속 놀이터 Nature playground", "search": "자연 속 놀이터 Nature playground",
"type": "opening", "type": "opening",
"value": "120", "value": "120",

View File

@@ -229,8 +229,8 @@
"point": 2 "point": 2
}, },
"10": { "10": {
"ele": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)", "ele": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)",
"ele2": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)", "ele2": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)",
"search": "숲 속으로 떠나는 여행", "search": "숲 속으로 떠나는 여행",
"type": "videoIsExist", "type": "videoIsExist",
"value": [179, 180], "value": [179, 180],
@@ -238,8 +238,8 @@
"desc": "출제 오류로 인해 두 가지 정답 모두 인정" "desc": "출제 오류로 인해 두 가지 정답 모두 인정"
}, },
"11": { "11": {
"ele": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length", "ele": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length",
"ele2": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length", "ele2": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length",
"search": "숲 속으로 떠나는 여행", "search": "숲 속으로 떠나는 여행",
"type": "video", "type": "video",
"value": "120", "value": "120",
@@ -386,16 +386,16 @@
"point": 3 "point": 3
}, },
"28": { "28": {
"ele": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)", "ele": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)",
"ele2": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)", "ele2": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)",
"search": "길가에 피어있는 꽃 Roadside flowers", "search": "길가에 피어있는 꽃 Roadside flowers",
"type": "opening", "type": "opening",
"value": 0, "value": 0,
"point": 2 "point": 2
}, },
"29": { "29": {
"ele": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length", "ele": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length",
"ele2": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length", "ele2": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length",
"search": "길가에 피어있는 꽃 Roadside flowers", "search": "길가에 피어있는 꽃 Roadside flowers",
"type": "opening", "type": "opening",
"value": "120", "value": "120",

View File

@@ -228,16 +228,16 @@
"point": 2 "point": 2
}, },
"10": { "10": {
"ele": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)", "ele": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)",
"ele2": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)", "ele2": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)",
"search": "연못 전망대 가는 길", "search": "연못 전망대 가는 길",
"type": "video", "type": "video",
"value": 170, "value": 170,
"point": 2 "point": 2
}, },
"11": { "11": {
"ele": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length", "ele": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length",
"ele2": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length", "ele2": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length",
"search": "연못 전망대 가는 길", "search": "연못 전망대 가는 길",
"type": "video", "type": "video",
"value": "150", "value": "150",
@@ -384,16 +384,16 @@
"point": 3 "point": 3
}, },
"28": { "28": {
"ele": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)", "ele": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/preceding-sibling::CRTrackClip/@Length)",
"ele2": "sum(//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)", "ele2": "sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/preceding-sibling::CRTrackClip/@Length)",
"search": "자연 테마 파크 Nature theme park", "search": "자연 테마 파크 Nature theme park",
"type": "opening", "type": "opening",
"value": 0, "value": 0,
"point": 2 "point": 2
}, },
"29": { "29": {
"ele": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length", "ele": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][{subtitleOrder}]/@Length",
"ele2": "//CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length", "ele2": "//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][@ClipIndex={clipIndex}]/@Length",
"search": "자연 테마 파크 Nature theme park", "search": "자연 테마 파크 Nature theme park",
"type": "opening", "type": "opening",
"value": "120", "value": "120",

View File

@@ -15,7 +15,6 @@ const todayDate = getToday();
// const scoringJson = require('./DIC_2503A.json'); // const scoringJson = require('./DIC_2503A.json');
// const scoringJson = require('./DIC_2503B.json'); // const scoringJson = require('./DIC_2503B.json');
const scoringJson = require('./DIC_2503C.json'); const scoringJson = require('./DIC_2503C.json');
const { get } = require('http');
// const scoringJson = require('./DIC_2503D.json'); // const scoringJson = require('./DIC_2503D.json');
// TEST // TEST
@@ -127,6 +126,8 @@ const flattenedData = scoringResultList.map(student => {
// excel에 표시하지 않을 key값들 // excel에 표시하지 않을 key값들
const exceptKeys = [ const exceptKeys = [
"0", // 학생 이름 항상 제외 "0", // 학생 이름 항상 제외
"1", // psd1
"2", // psd2
] ]
const exceptSubkeys = [ const exceptSubkeys = [
"videoStartTime", "videoStartTime",
@@ -151,6 +152,17 @@ const flattenedData = scoringResultList.map(student => {
const worksheet = XLSX.utils.json_to_sheet(flattenedData); const worksheet = XLSX.utils.json_to_sheet(flattenedData);
const workbook = XLSX.utils.book_new(); const workbook = XLSX.utils.book_new();
// 열 너비 계산
const columnWidths = Object.keys(flattenedData[0]).map(key => {
const maxLength = Math.max(
key.length, // 열 제목의 길이
...flattenedData.map(row => (row[key] ? row[key].toString().length : 0)) // 각 셀의 데이터 길이
);
return { wch: maxLength + 1 }; // 여유 공간 추가
});
// 열 너비 설정
worksheet['!cols'] = columnWidths;
// Add the worksheet to the workbook // Add the worksheet to the workbook
XLSX.utils.book_append_sheet(workbook, worksheet, '채점 결과'); XLSX.utils.book_append_sheet(workbook, worksheet, '채점 결과');
@@ -171,8 +183,8 @@ function getTrackClipNode(xmlDoc, type, videoStartTime, openingStartTime) {
const startTime = type === 'video' ? videoStartTime : openingStartTime; const startTime = type === 'video' ? videoStartTime : openingStartTime;
// xpath 구문을 통해 CRTrackClip 요소의 ClipIndex를 찾음 // xpath 구문을 통해 CRTrackClip 요소의 ClipIndex를 찾음
const trackClipNode1 = xpath.select1(`//CRTrackList[@Name="텍스트"]/CRTrackClip[not(@ClipIndex='-1')][${subtitleOrder}]`, xmlDoc); const trackClipNode1 = xpath.select1(`//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][${subtitleOrder}]`, xmlDoc);
const trackClipNode2 = xpath.select1(`//CRTrackList[@Name='텍스트']/CRTrackClip[sum(preceding-sibling::CRTrackClip/@Length) = ${startTime}]`, xmlDoc); const trackClipNode2 = xpath.select1(`//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[sum(preceding-sibling::CRTrackClip/@Length) = ${startTime}]`, xmlDoc);
return trackClipNode = trackClipNode1 ?? trackClipNode2; return trackClipNode = trackClipNode1 ?? trackClipNode2;
} }

View File

@@ -1 +1 @@
[{"kind":2,"language":"xpath","value":"//Layer/Name/@value = 'Germs'"},{"kind":2,"language":"xpath","value":"//Layer[Name[@value='Germs']]/Effects/Item[Name[@value='선명하게'] and EffectData[amount[@value=\"12\"]]]"},{"kind":2,"language":"xpath","value":"//Layer[Name[@value='Germs']]/Effects/Item/(Name/@value | EffectData/amount/@value)"},{"kind":2,"language":"xpath","value":"//CRCUnitArr[@Name='{search}']//GCUnitPool/GCUnit[@Type='2']/@*[name()='VID100' or name()='VID101']"},{"kind":2,"language":"xpath","value":"//Layer//op_points[Item]/Item[last()]/X/@value"},{"kind":2,"language":"xpath","value":"//Layer//op_points[Item]/Item[1]/X/@value"},{"kind":2,"language":"xpath","value":"//Layer//Shape[contains(draw_type/@value, 'Interior')]/secondary_color/@value"},{"kind":2,"language":"xpath","value":"//Layer//Shape[contains(draw_type/@value, 'Interior')]/secondary_color/@value"},{"kind":2,"language":"xpath","value":"//Layer/BlendOp/@value | //Layer/Opacity/@value"},{"kind":2,"language":"xpath","value":"//CRTransFilter[@ClipIndex=count(//CRTrackList[@Name='비디오1']/CRTrackClip[@ClipIndex=count(//CRClip[@Path='이미지3.jpg']/preceding-sibling::CRClip | //CRClip[@Type='11']/CRCUnitArr[@Path='이미지3.jpg']/../preceding-sibling::CRClip)][1]/preceding-sibling::CRTrackClip)]/@*[name()='ID' or name()='Range' or name()='Type']"},{"kind":2,"language":"xpath","value":"//CRTransFilter[@ClipIndex=count(//CRTrackList[@Name='비디오1']/CRTrackClip[@ClipIndex=count(//CRClip[@Path='이미지1.jpg']/preceding-sibling::CRClip | //CRClip[@Type='11']/CRCUnitArr[@Path='이미지1.jpg']/../preceding-sibling::CRClip)][1]/preceding-sibling::CRTrackClip)]/@*[name()='ID' or name()='Range' or name()='Type']"},{"kind":2,"language":"xpath","value":"//CRTransFilter[@ClipIndex=count(//CRTrackList[@Name='비디오1']/CRTrackClip[@ClipIndex=count(//CRClip[@Path='이미지3.jpg']/preceding-sibling::CRClip)])]/@*[name()='ID' or name()='Range' or name()='Type']"},{"kind":2,"language":"xpath","value":"sum(//CRCUnitArr[1] and //CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][1]/preceding-sibling::CRTrackClip/@Length)"},{"kind":2,"language":"xpath","value":"sum(//CRCUnitArr[2] and //CRTrackList[@Name='텍스트']/CRTrackClip[not(@ClipIndex='-1')][2]/preceding-sibling::CRTrackClip/@Length)\r\n"}] [{"kind":2,"language":"xpath","value":"//Layer/Name/@value = 'Germs'"},{"kind":2,"language":"xpath","value":"//Layer[Name[@value='Germs']]/Effects/Item[Name[@value='선명하게'] and EffectData[amount[@value=\"12\"]]]"},{"kind":2,"language":"xpath","value":"//Layer[Name[@value='Germs']]/Effects/Item/(Name/@value | EffectData/amount/@value)"},{"kind":2,"language":"xpath","value":"//CRCUnitArr[@Name='{search}']//GCUnitPool/GCUnit[@Type='2']/@*[name()='VID100' or name()='VID101']"},{"kind":2,"language":"xpath","value":"//Layer//op_points[Item]/Item[last()]/X/@value"},{"kind":2,"language":"xpath","value":"//Layer//op_points[Item]/Item[1]/X/@value"},{"kind":2,"language":"xpath","value":"//Layer//Shape[contains(draw_type/@value, 'Interior')]/secondary_color/@value"},{"kind":2,"language":"xpath","value":"//Layer//Shape[contains(draw_type/@value, 'Interior')]/secondary_color/@value"},{"kind":2,"language":"xpath","value":"//Layer/BlendOp/@value | //Layer/Opacity/@value"},{"kind":2,"language":"xpath","value":"//CRTransFilter[@ClipIndex=count(//CRTrackList[@Name='비디오1']/CRTrackClip[@ClipIndex=count(//CRClip[@Path='이미지3.jpg']/preceding-sibling::CRClip | //CRClip[@Type='11']/CRCUnitArr[@Path='이미지3.jpg']/../preceding-sibling::CRClip)][1]/preceding-sibling::CRTrackClip)]/@*[name()='ID' or name()='Range' or name()='Type']"},{"kind":2,"language":"xpath","value":"//CRTransFilter[@ClipIndex=count(//CRTrackList[@Name='비디오1']/CRTrackClip[@ClipIndex=count(//CRClip[@Path='이미지1.jpg']/preceding-sibling::CRClip | //CRClip[@Type='11']/CRCUnitArr[@Path='이미지1.jpg']/../preceding-sibling::CRClip)][1]/preceding-sibling::CRTrackClip)]/@*[name()='ID' or name()='Range' or name()='Type']"},{"kind":2,"language":"xpath","value":"//CRTransFilter[@ClipIndex=count(//CRTrackList[@Name='비디오1']/CRTrackClip[@ClipIndex=count(//CRClip[@Path='이미지3.jpg']/preceding-sibling::CRClip)])]/@*[name()='ID' or name()='Range' or name()='Type']"},{"kind":2,"language":"xpath","value":"sum(//CRTrackList[@Name='텍스트' or @Name='비디오2']/CRTrackClip[not(@ClipIndex='-1')][2]/preceding-sibling::CRTrackClip/@Length)"},{"kind":2,"language":"xpath","value":"//CRTrackList[@Name=\"텍스트\" or @Name=\"비디오2\"]/CRTrackClip[not(@ClipIndex='-1')][2]/@Length"}]