@@ -17,6 +17,7 @@ import type {
1717 CodeResponse ,
1818 ProblemGrade ,
1919} from "../types" ;
20+ import { formatLateDurationForGradeCsv } from "../utils/gradeExportLateDuration" ;
2021
2122export function useGradeManagement ( ) {
2223 const { sectionId } = useParams < { sectionId ?: string } > ( ) ;
@@ -774,16 +775,6 @@ export function useGradeManagement() {
774775 if ( dueAt && new Date ( ) > new Date ( dueAt ) ) return '"미제출"' ;
775776 return '""' ;
776777 } ;
777- /** 지각시간: ZIP submissions.csv와 동일하게 서버 계산값(lateDuration)만 사용 */
778- const formatLateDurationForCSV = (
779- pg : ProblemGrade | null | undefined ,
780- ) : string => {
781- if ( ! pg ?. submitted ) return '""' ;
782- const t = pg . lateDuration ?. trim ( ) ;
783- if ( ! t ) return '""' ;
784- return `"${ t . replace ( / " / g, '""' ) } "` ;
785- } ;
786-
787778 // 전체 과제 보기: 과제만 필터한 courseGrades로 내보내기
788779 if (
789780 viewMode === "assignment" &&
@@ -838,7 +829,9 @@ export function useGradeManagement() {
838829 getSubmissionDisplayForCSV ( problemGrade ?. submittedAt , dueAt ) ,
839830 ) ;
840831 row . push ( formatDateForCSV ( dueAt ) ) ;
841- row . push ( formatLateDurationForCSV ( problemGrade ) ) ;
832+ row . push (
833+ formatLateDurationForGradeCsv ( problemGrade , dueAt ) ,
834+ ) ;
842835 if ( typeof score === "number" ) {
843836 totalAllScore += score ;
844837 }
@@ -929,7 +922,9 @@ export function useGradeManagement() {
929922 getSubmissionDisplayForCSV ( problemGrade ?. submittedAt , dueAt ) ,
930923 ) ;
931924 row . push ( formatDateForCSV ( dueAt ) ) ;
932- row . push ( formatLateDurationForCSV ( problemGrade ) ) ;
925+ row . push (
926+ formatLateDurationForGradeCsv ( problemGrade , dueAt ) ,
927+ ) ;
933928 if ( typeof score === "number" ) {
934929 totalAllScore += score ;
935930 }
@@ -1016,7 +1011,9 @@ export function useGradeManagement() {
10161011 getSubmissionDisplayForCSV ( problemGrade ?. submittedAt , dueAt ) ,
10171012 ) ;
10181013 row . push ( formatDateForCSV ( dueAt ) ) ;
1019- row . push ( formatLateDurationForCSV ( problemGrade ) ) ;
1014+ row . push (
1015+ formatLateDurationForGradeCsv ( problemGrade , dueAt ) ,
1016+ ) ;
10201017 if ( score !== "" && score !== null && typeof score === "number" ) {
10211018 totalAllScore += score ;
10221019 }
@@ -1045,7 +1042,9 @@ export function useGradeManagement() {
10451042 getSubmissionDisplayForCSV ( problemGrade ?. submittedAt , dueAt ) ,
10461043 ) ;
10471044 row . push ( formatDateForCSV ( dueAt ) ) ;
1048- row . push ( formatLateDurationForCSV ( problemGrade ) ) ;
1045+ row . push (
1046+ formatLateDurationForGradeCsv ( problemGrade , dueAt ) ,
1047+ ) ;
10491048 if ( score !== "" && score !== null && typeof score === "number" ) {
10501049 totalAllScore += score ;
10511050 }
@@ -1113,7 +1112,9 @@ export function useGradeManagement() {
11131112 row . push ( String ( score ) ) ;
11141113 row . push ( getSubmissionDisplayForCSV ( problem . submittedAt , quizDueAt ) ) ;
11151114 row . push ( formatDateForCSV ( quizDueAt ) ) ;
1116- row . push ( formatLateDurationForCSV ( problem ) ) ;
1115+ row . push (
1116+ formatLateDurationForGradeCsv ( problem , quizDueAt ) ,
1117+ ) ;
11171118 }
11181119 const totalScore = student . totalScore ?? 0 ;
11191120 const totalPoints = student . totalPoints ?? 0 ;
@@ -1177,7 +1178,9 @@ export function useGradeManagement() {
11771178 getSubmissionDisplayForCSV ( problem . submittedAt , assignmentDueAt ) ,
11781179 ) ;
11791180 row . push ( formatDateForCSV ( assignmentDueAt ) ) ;
1180- row . push ( formatLateDurationForCSV ( problem ) ) ;
1181+ row . push (
1182+ formatLateDurationForGradeCsv ( problem , assignmentDueAt ) ,
1183+ ) ;
11811184 }
11821185 const totalScore = student . totalScore ?? 0 ;
11831186 const totalPoints = student . totalPoints ?? 0 ;
0 commit comments