0508 요청사항 수정 (gmep파일이 아닌경우 0점처리 + gmep파일이 없는 경우 더미 0점값 채우는 과정 추가)

This commit is contained in:
2025-05-08 18:11:21 +09:00
parent 5ee5330e13
commit 56e38caa0f
8 changed files with 80 additions and 16 deletions

1
.gitignore vendored
View File

@@ -121,6 +121,7 @@ dist
.tern-port .tern-port
# Stores VSCode versions used for testing VSCode extensions # Stores VSCode versions used for testing VSCode extensions
.vscode
.vscode-test .vscode-test
# yarn v2 # yarn v2

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -39,7 +39,7 @@ def copy_dic_subdirs(source_root, target_root_a, target_root_b, target_root_c, t
# 사용법 # 사용법
exam_round = "2504" exam_round = "2504"
source_directory = r"C:\Users\dra\project\data\제2504회 정기\답안파일" # 원본 디렉토리 경로 source_directory = r"D:\projects\data\제2504회 정기\답안파일\제2504회 디지털정보활용능력 답안파일" # 원본 디렉토리 경로
target_directory_a = f".\\output\\{exam_round}\\A" # '1교시'의 타겟 경로 target_directory_a = f".\\output\\{exam_round}\\A" # '1교시'의 타겟 경로
target_directory_b = f".\\output\\{exam_round}\\B" # '2교시'의 타겟 경로 target_directory_b = f".\\output\\{exam_round}\\B" # '2교시'의 타겟 경로

View File

@@ -12,8 +12,8 @@ const getToday = require('./getToday.js');
const todayDate = getToday(); const todayDate = getToday();
const examRound = '2504'; const examRound = '2504';
// const dic_or_dpi = 'DIC' const dic_or_dpi = 'DIC'
const dic_or_dpi = 'DPI' // const dic_or_dpi = 'DPI'
const examTypes = [ const examTypes = [
// 'A', // 'A',
'B', 'B',
@@ -63,13 +63,14 @@ examTypes.forEach(type => {
// 교육용 프로젝프로 생성시 gmdp확장자로 생성됨 // 교육용 프로젝프로 생성시 gmdp확장자로 생성됨
// 두 경우 모두 처리 // 두 경우 모두 처리
const gmepFile = fs.readdirSync(studentDir).filter( const gmepFile = fs.readdirSync(studentDir).filter(
file => file.toLowerCase().endsWith('.gmep') file => file.toLowerCase().endsWith('.gmep')
|| file.toLowerCase().endsWith('.gmdp') // || file.toLowerCase().endsWith('.gmdp')
); );
// 곰픽 파일 gpdp 파일 이거나 xml 파일 // 곰픽 파일 gpdp 파일 이거나 xml 파일
const gpdpFiles = fs.readdirSync(studentDir).filter( const gpdpFiles = fs.readdirSync(studentDir).filter(
file => file.toLowerCase().endsWith('.xml') file => file.toLowerCase().endsWith('.xml')
|| (file === null && (name + '.xml'))
); );
// 학생 이름을 key로 하는 객체 생성 // 학생 이름을 key로 하는 객체 생성
@@ -101,17 +102,30 @@ examTypes.forEach(type => {
scoringResult[index + 1] = getGpdpScore(xmlDocument, scoringJson, index + 4); scoringResult[index + 1] = getGpdpScore(xmlDocument, scoringJson, index + 4);
}); });
gmepFile.forEach((gmep, index) => { if (gmepFile.length === 0) {
const gmepPath = path.join('./', studentDir, gmep); // 곰믹스 채점 항목 갯수
console.log(`Reading ${gmepPath}...`); const gmepItemCount = Object.keys(scoringJson[2]).length - 2;
// console.log("🚀 ~ gmepItemCount:", gmepItemCount)
const xmlString = fs.readFileSync(gmepPath, 'utf8'); scoringResult[3] = {};
// XML 문자열을 파싱하여 XML 문서 객체로 변환 for (let i = 1; i <= gmepItemCount; i++) {
const xmlDocument = new DOMParser().parseFromString(xmlString, 'application/xml'); scoringResult[3][i] = 0;
// console.log('xmlDocument:', xmlDocument); }
scoringResult[3]['총점'] = 0;
}
else {
gmepFile.forEach((gmep, index) => {
const gmepPath = path.join('./', studentDir, gmep);
console.log(`Reading ${gmepPath}...`);
scoringResult[3] = getGmepScore(xmlDocument, scoringJson, 2); const xmlString = fs.readFileSync(gmepPath, 'utf8');
}); // XML 문자열을 파싱하여 XML 문서 객체로 변환
const xmlDocument = new DOMParser().parseFromString(xmlString, 'application/xml');
// console.log('xmlDocument:', xmlDocument);
scoringResult[3] = getGmepScore(xmlDocument, scoringJson, 2);
});
}
scoringResultList.push(scoringResult); scoringResultList.push(scoringResult);
}); });
@@ -144,8 +158,8 @@ examTypes.forEach(type => {
}); });
console.log('채점 결과'); console.log('채점 결과');
outputExcelFiles.forEach( (outputFile, index) => { outputExcelFiles.forEach((outputFile, index) => {
console.log(`[${index+1}] : ${outputFile}`); console.log(`[${index + 1}] : ${outputFile}`);
}); });

View File

@@ -0,0 +1,49 @@
광일 김, [May 8, 2025 at 13:44:23]:
<DIW-C>
001912 문성빈
문구 (서울국제도서박람회) - 견고딕, 25pt, 가운데정렬 맞는데 오답처리
000076 박다은
특수문자 ① ◆, ② ◆, ③ ※ - ◆ 행사안내 ◆ 인데 1점
001419 김사랑
차트 X,Y,범례 기울임 없느데 정답처리됨
000076 박다은
000285 문예슬
001345 조수빈
000203 이지운
글맵시 있는데 오답처리
001473 노이솜
문구 (◆ 행사안내 ◆) - 궁서/가운데정렬 맞는데 오답처리(띄어쓰기 때문인듯)
001473 노이솜
문제1 줄간격 180% 맞는데 오답처리(마지막 엔터값 때문인듯)
<DIC-B형-곰믹스>
002016-조승연
001464-이주아
000047-전지인
.gmep가 아니라 .gmdp라서 0점
001662-노연우
"화단의 꽃들" 자막 텍스트 맞는데 오답처리
"아름다운 꽃 축제(Happy Flower Festival)" 자막 텍스트 맞는데 오답처리
<DPI곰픽>
1-10문제 배점이 6점인데 5점으로 잘못기재한거죠?
001682-노연우
"화단의 꽃들" 자막 텍스트 맞는데 오답처리
000400-서보길
"흰 꽃 사이 노란 꽃 " <- 마지막에 띄어쓰기때문에 오답처리 됨/trim한 텍스트로 비교할 수 있을까요?
다 수정 채점 해뒀습니다!
DIC-A형만 확인하면 이번회차도 끝날것같습니다!