Lashtw commited on
Commit
e5de3e2
·
verified ·
1 Parent(s): 40dc370

Upload 9 files

Browse files
Files changed (1) hide show
  1. src/views/InstructorView.js +4 -19
src/views/InstructorView.js CHANGED
@@ -482,28 +482,13 @@ export function setupInstructorEvents() {
482
  if (createBtn) {
483
  // Dashboard Update Logic
484
  const updateDashboard = (data) => {
485
- const dashboardContent = document.getElementById('dashboard-content');
486
- const heatmapBody = document.getElementById('heatmap-body');
487
- const heatmapHeader = document.getElementById('heatmap-header');
488
-
489
  const users = Array.isArray(data) ? data : (data?.users ? Object.values(data.users) : []);
490
 
491
- if (users.length === 0) {
492
- heatmapBody.innerHTML = '<tr><td colspan="100" class="text-center py-10 text-gray-500">尚無學員加入</td></tr>';
493
- return;
494
- }
495
 
496
- // Just a simple render for now - can be expanded
497
- // Clearing existing rows
498
- heatmapBody.innerHTML = '';
499
-
500
- // This part needs real logic based on your data structure
501
- // For now, let's just list users to prove it works
502
- users.forEach(user => {
503
- const tr = document.createElement('tr');
504
- tr.innerHTML = `<td class="p-3 text-white">${user.nickname || 'Unknown'}</td>`;
505
- heatmapBody.appendChild(tr);
506
- });
507
  }
508
 
509
  // Create Room
 
482
  if (createBtn) {
483
  // Dashboard Update Logic
484
  const updateDashboard = (data) => {
 
 
 
 
485
  const users = Array.isArray(data) ? data : (data?.users ? Object.values(data.users) : []);
486
 
487
+ // Update global state for modals/snapshot
488
+ currentStudents = users;
 
 
489
 
490
+ // Use the full heatmap renderer
491
+ renderTransposedHeatmap(users);
 
 
 
 
 
 
 
 
 
492
  }
493
 
494
  // Create Room