Spaces:
Running
Running
Upload 10 files
Browse files- src/views/InstructorView.js +18 -11
src/views/InstructorView.js
CHANGED
|
@@ -1983,12 +1983,11 @@ export function setupInstructorEvents() {
|
|
| 1983 |
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
| 1984 |
}
|
| 1985 |
};
|
| 1986 |
-
}
|
| 1987 |
|
| 1988 |
-
|
| 1989 |
-
|
| 1990 |
-
|
| 1991 |
-
|
| 1992 |
const thead = document.getElementById('heatmap-header');
|
| 1993 |
const tbody = document.getElementById('heatmap-body');
|
| 1994 |
|
|
@@ -2102,9 +2101,8 @@ export function setupInstructorEvents() {
|
|
| 2102 |
}).join('');
|
| 2103 |
}
|
| 2104 |
|
| 2105 |
-
|
| 2106 |
-
|
| 2107 |
-
window.showBroadcastModal = (userId, challengeId) => {
|
| 2108 |
const student = currentStudents.find(s => s.id === userId);
|
| 2109 |
if (!student) return;
|
| 2110 |
|
|
@@ -2128,13 +2126,22 @@ export function setupInstructorEvents() {
|
|
| 2128 |
|
| 2129 |
// Store IDs for actions
|
| 2130 |
modal.dataset.userId = userId;
|
| 2131 |
-
modal.dataset.challengeId = challengeId;
|
| 2132 |
-
|
| 2133 |
modal.classList.remove('hidden');
|
| 2134 |
// Animation trigger
|
| 2135 |
setTimeout(() => {
|
| 2136 |
content.classList.remove('scale-95', 'opacity-0');
|
| 2137 |
content.classList.add('opacity-100', 'scale-100');
|
| 2138 |
}, 10);
|
| 2139 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2140 |
}
|
|
|
|
|
|
|
|
|
|
|
|
| 1983 |
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
| 1984 |
}
|
| 1985 |
};
|
|
|
|
| 1986 |
|
| 1987 |
+
/**
|
| 1988 |
+
* Renders the Transposed Heatmap (Rows=Challenges, Cols=Students)
|
| 1989 |
+
*/
|
| 1990 |
+
function renderTransposedHeatmap(students) {
|
| 1991 |
const thead = document.getElementById('heatmap-header');
|
| 1992 |
const tbody = document.getElementById('heatmap-body');
|
| 1993 |
|
|
|
|
| 2101 |
}).join('');
|
| 2102 |
}
|
| 2103 |
|
| 2104 |
+
// Global scope for HTML access
|
| 2105 |
+
function showBroadcastModal(userId, challengeId) {
|
|
|
|
| 2106 |
const student = currentStudents.find(s => s.id === userId);
|
| 2107 |
if (!student) return;
|
| 2108 |
|
|
|
|
| 2126 |
|
| 2127 |
// Store IDs for actions
|
| 2128 |
modal.dataset.userId = userId;
|
|
|
|
|
|
|
| 2129 |
modal.classList.remove('hidden');
|
| 2130 |
// Animation trigger
|
| 2131 |
setTimeout(() => {
|
| 2132 |
content.classList.remove('scale-95', 'opacity-0');
|
| 2133 |
content.classList.add('opacity-100', 'scale-100');
|
| 2134 |
}, 10);
|
| 2135 |
+
}
|
| 2136 |
+
|
| 2137 |
+
// Bind to window
|
| 2138 |
+
window.renderTransposedHeatmap = renderTransposedHeatmap;
|
| 2139 |
+
window.showBroadcastModal = showBroadcastModal;
|
| 2140 |
+
});
|
| 2141 |
+
} catch (e) {
|
| 2142 |
+
console.error(e);
|
| 2143 |
+
alert("無法重新加入: " + e.message);
|
| 2144 |
}
|
| 2145 |
+
});
|
| 2146 |
+
}
|
| 2147 |
+
}
|