Spaces:
Running
Running
Upload 9 files
Browse files- src/views/InstructorView.js +23 -0
src/views/InstructorView.js
CHANGED
|
@@ -1234,6 +1234,29 @@ if (addInstBtn) {
|
|
| 1234 |
}
|
| 1235 |
});
|
| 1236 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1237 |
// Modal Events
|
| 1238 |
window.showBroadcastModal = (userId, challengeId) => {
|
| 1239 |
const modal = document.getElementById('broadcast-modal');
|
|
|
|
| 1234 |
}
|
| 1235 |
});
|
| 1236 |
|
| 1237 |
+
|
| 1238 |
+
// Unified Enter Room Logic
|
| 1239 |
+
function enterRoom(roomCode) {
|
| 1240 |
+
createContainer.classList.add('hidden');
|
| 1241 |
+
roomInfo.classList.remove('hidden');
|
| 1242 |
+
dashboardContent.classList.remove('hidden');
|
| 1243 |
+
// Ensure group photo button is visible
|
| 1244 |
+
if (groupPhotoBtn) groupPhotoBtn.classList.remove('hidden');
|
| 1245 |
+
|
| 1246 |
+
displayRoomCode.textContent = roomCode;
|
| 1247 |
+
localStorage.setItem('vibecoding_room_code', roomCode);
|
| 1248 |
+
sessionStorage.setItem('vibecoding_instructor_in_room', 'true');
|
| 1249 |
+
|
| 1250 |
+
// Unsubscribe previous if any
|
| 1251 |
+
if (roomUnsubscribe) roomUnsubscribe();
|
| 1252 |
+
|
| 1253 |
+
// Subscribe to updates
|
| 1254 |
+
roomUnsubscribe = subscribeToRoom(roomCode, (students) => {
|
| 1255 |
+
currentStudents = students;
|
| 1256 |
+
renderTransposedHeatmap(students);
|
| 1257 |
+
});
|
| 1258 |
+
}
|
| 1259 |
+
|
| 1260 |
// Modal Events
|
| 1261 |
window.showBroadcastModal = (userId, challengeId) => {
|
| 1262 |
const modal = document.getElementById('broadcast-modal');
|