곰픽 채점 알고리즘/채점기준표 수정

This commit is contained in:
2025-04-11 15:14:28 +09:00
parent ddd919c207
commit 1afe0cadda
34 changed files with 4198 additions and 47 deletions

View File

@@ -11,13 +11,13 @@ const getGpdpScore = require('./gpdpScoring.js');
const getToday = require('./getToday.js');
const todayDate = getToday();
const examType = [
'A',
const examRound = '0000';
const examTypes = [
// 'A',
'B',
'C',
// 'C',
// 'D'
];
const examRound = '2503';
// testMode가 true일 경우 TEST 폴더에 있는 답안 파일을 읽어옴
// const testMode = true;
@@ -25,7 +25,7 @@ const testMode = false;
const outputExcelFiles = [];
examType.forEach(type => {
examTypes.forEach(type => {
const scoringJson = require(`./DIC_${examRound}${type}.json`);
const answerFilesDir = `./output/${type}/${testMode ? 'TEST' : 'DIC'}`;
const outputExcelFile = `./${todayDate}_DIC_${examRound}${type}_${testMode ? 'TEST.xlsx' : '채점결과.xlsx'}`;
@@ -421,7 +421,7 @@ function getGmepScore(gmepData, scoringJson, index) {
// 결과값들을 하나의 배열로 합침
const allResults = [...[resultValues], ...[resultValues2], ...[resultValues3]];
console.log("🚀 ~ allResults:", allResults)
// console.log("🚀 ~ allResults:", allResults)
// 정답(rightAnswer)의 값이 단일값이 아닐 경우 값 비교를 위해 배열로 변환
// 예시) (2-11) 자막의 위치 좌표값 비교를 위해 [x, y] 값을 가져오므로 배열로 변환하여 비교
@@ -669,36 +669,6 @@ function getClipIndexBySubtitle(xmlDoc, search) {
return clipIndex;
}
// // Flatten the resultData for better representation in Excel
// const flattenedData = scoringResultList.map(student => {
// // const name = student["0"];
// const flattened = { "학생": student["0"] };
// // excel에 표시하지 않을 key값들
// const exceptKeys = [
// "0", // 학생 이름 항상 제외
// // "1", // psd1
// // "2", // psd2
// ]
// const exceptSubkeys = [
// "videoStartTime",
// "openingStartTime",
// ];
// Object.keys(student).forEach(key => {
// if (exceptKeys.includes(key)) {
// return;
// }
// Object.keys(student[key]).forEach(subKey => {
// if (exceptSubkeys.includes(subKey)) {
// return;
// }
// flattened[`${key}-${subKey}`] = student[key][subKey];
// });
// });
// return flattened;
// });
/**
* scoringResultList 배열을 엑셀에 출력하기 위한 데이터 정리 함수
* @param {Array} scoringResultList - 학생별 채점 결과 리스트
@@ -740,6 +710,7 @@ function prepareExcelData(scoringResultList) {
});
}
// 데이터 행렬 변환
function transposeData(data) {
// 데이터가 없으면 빈 배열 반환
if (data.length === 0) return [];