Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/AdminStudentHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const AdminStudentHeader = ({ studentName = "default", subtitle = "default", onB

<button
className="icon-button"
onClick={() => navigate(`/admin/managestudent`)}
onClick={() => navigate(`/managestudent`)}
>
👥
</button>
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/pages/admin/AdminStudentAssignment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,28 @@ const AdminStudentAssignment = () => {
label: `${weekItem.week}주차 ${weekItem.subject}`,
days: weekItem.days.map((dayItem) => ({
day: dayItem.day,
subject: weekItem.subject,
tasks: dayItem.details.map((task) => ({
id: task.id,
label: task.assignmentName,
status: task.status,
modified: false,
//modified: false,
})),
})),
}));

setWeeks(formatted);

const matched = formatted.find((w) => String(w.week) === String(week));
const matched = formatted.find((w) => Number(w.week) === Number(week));
if (matched) {
setSelectedWeekLabel(matched.label);
/*
if (matched.days.length > 0) {
setHighlightCard({
weekLabel: matched.label,
day: matched.days[0].day,
tasks: matched.days[0].tasks,
});
}
}*/
}
});
}, [studentId, week]);
Expand All @@ -79,9 +79,11 @@ const AdminStudentAssignment = () => {
});
};
*/


const handleSave = async (taskId, status) => {
const userId = parseInt(studentId); // 문자열일 수 있으니 숫자로 변환

try {
// PUT 요청 시도 (기존 과제 수정)
await updateAssignmentStatus(userId, taskId, status);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/admin/DetailManageStudent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const DetailManageStudent = () => {
<button
key={index}
className={style.assignment_button}
onClick={() => navigate(`/admin/assignment/${student.id}/${index + 1}`)}
onClick={() => navigate(`/admin/assignment/${student.id}/${week.week}`)}
>
{week.week} {week.title && ` ${week.title}`}
</button>
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/pages/generation/Assignment.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ const Assignment = () => {
fetchAssignmentsByUser(userId)
.then((weekData) => {
const formatted = weekData.map((weekItem) => ({
label: `${weekItem.week}주차 ${weekItem.subject}`,
label: `${weekItem.week}주차 ${weekItem.subtitle}`,
//label: `${weekItem.week}주차 ${weekItem.subject}`,
details: weekItem.days.map((dayItem) => ({
day: dayItem.day,
subject: weekItem.subject,
subject: dayItem.subject,
//subject: weekItem.subject,
tasks: dayItem.details.map((task) => ({
label: task.assignmentName,
status: mapStatus(task.status),
Expand Down