Spaces:
Running
Running
Upload 10 files
Browse files
src/views/InstructorView.js
CHANGED
|
@@ -1852,10 +1852,13 @@ export function setupInstructorEvents() {
|
|
| 1852 |
// Helper Actions
|
| 1853 |
window.confirmReset = async (userId, challengeId, title) => {
|
| 1854 |
if (confirm(`確定要退回 ${title} 嗎?此動作將清除學員目前的進度。`)) {
|
| 1855 |
-
|
| 1856 |
-
|
|
|
|
|
|
|
| 1857 |
try {
|
| 1858 |
-
|
|
|
|
| 1859 |
await resetProgress(userId, roomCode, challengeId);
|
| 1860 |
// Refresh current list if open? (It will stay open but might not update immediately if realtime check isn't hooked to modal content. But subscriptions update `currentStudents`. We might need to refresh list)
|
| 1861 |
// For now, simple alert or auto-close
|
|
|
|
| 1852 |
// Helper Actions
|
| 1853 |
window.confirmReset = async (userId, challengeId, title) => {
|
| 1854 |
if (confirm(`確定要退回 ${title} 嗎?此動作將清除學員目前的進度。`)) {
|
| 1855 |
+
// Unified top-level import
|
| 1856 |
+
const roomCode = localStorage.getItem('vibecoding_room_code') || localStorage.getItem('vibecoding_instructor_room'); // Fallback
|
| 1857 |
+
|
| 1858 |
+
if (userId && challengeId) {
|
| 1859 |
try {
|
| 1860 |
+
alert("正在執行退回 (列表模式)...");
|
| 1861 |
+
// Use top-level import directly
|
| 1862 |
await resetProgress(userId, roomCode, challengeId);
|
| 1863 |
// Refresh current list if open? (It will stay open but might not update immediately if realtime check isn't hooked to modal content. But subscriptions update `currentStudents`. We might need to refresh list)
|
| 1864 |
// For now, simple alert or auto-close
|