Skip to content

Commit 1d894d8

Browse files
authored
Merge pull request #145 from InserToken/feat/37-indicator/Eunseo3
Feat/37 indicator/eunseo3
2 parents 5db90d6 + 9dcec70 commit 1d894d8

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

src/components/blocks/PracticePage/PracticePage.client.tsx

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function PracticeClient() {
5656
// if (!params.problemId) return;
5757
// fetchMyPracticeAnswer(params.problemId).then((result) => {
5858
// if (result) {
59-
// console.log("이미 푼 문제!", result); // 🔥 여기에 찍힘!
59+
// console.log("이미 푼 문제!", result);
6060
// } else {
6161
// console.log("아직 푼 적 없는 문제입니다.");
6262
// }
@@ -111,25 +111,35 @@ export default function PracticeClient() {
111111
setLoading(false);
112112
return;
113113
}
114+
114115
setGradeResult(data);
115116

116117
try {
117118
const token =
118119
sessionStorage.getItem("token") ||
119120
localStorage.getItem("accessToken");
121+
// breakdown 점수 직접 합산
122+
const breakdown = data.breakdown || {};
123+
const logic = Number(breakdown.logic ?? 0);
124+
const technical = Number(breakdown.technical ?? 0);
125+
const macroEconomy = Number(breakdown.macroEconomy ?? 0);
126+
const marketIssues = Number(breakdown.marketIssues ?? 0);
127+
const quantEvidence = Number(breakdown.quantEvidence ?? 0);
128+
const score =
129+
logic + technical + macroEconomy + marketIssues + quantEvidence;
130+
120131
const practiceScoreData = {
121132
problem_id: params.problemId,
122133
answer: input,
123-
score: data.score,
134+
score, // breakdown 다섯 항목 합산 점수!
124135
feedback: data.feedback,
125-
logic: data.breakdown?.logic,
126-
technical: data.breakdown?.technical,
127-
macroEconomy: data.breakdown?.macroEconomy,
128-
marketIssues: data.breakdown?.marketIssues,
129-
quantEvidence: data.breakdown?.quantEvidence,
136+
logic,
137+
technical,
138+
macroEconomy,
139+
marketIssues,
140+
quantEvidence,
130141
date: new Date().toISOString(),
131142
};
132-
//console.log("채점 결과", data);
133143
await postPracticeScore(token, practiceScoreData);
134144
toast.success("채점 및 저장 완료!");
135145
setFeedback(data.feedback || "피드백 없음.");

0 commit comments

Comments
 (0)