Spaces:
Running
Running
Upload 9 files
Browse files- src/views/InstructorView.js +1 -36
src/views/InstructorView.js
CHANGED
|
@@ -1958,39 +1958,4 @@ function renderTransposedHeatmap(students) {
|
|
| 1958 |
}).join('');
|
| 1959 |
}
|
| 1960 |
|
| 1961 |
-
|
| 1962 |
-
// Global scope for HTML access
|
| 1963 |
-
window.showBroadcastModal = (userId, challengeId) => {
|
| 1964 |
-
const student = currentStudents.find(s => s.id === userId);
|
| 1965 |
-
if (!student) return;
|
| 1966 |
-
|
| 1967 |
-
const p = student.progress?.[challengeId];
|
| 1968 |
-
if (!p) return;
|
| 1969 |
-
|
| 1970 |
-
const challenge = cachedChallenges.find(c => c.id === challengeId);
|
| 1971 |
-
const title = challenge ? challenge.title : 'Unknown Challenge'; // Fallback
|
| 1972 |
-
|
| 1973 |
-
const modal = document.getElementById('broadcast-modal');
|
| 1974 |
-
const content = document.getElementById('broadcast-content');
|
| 1975 |
-
|
| 1976 |
-
document.getElementById('broadcast-avatar').textContent = student.nickname[0];
|
| 1977 |
-
document.getElementById('broadcast-author').textContent = student.nickname;
|
| 1978 |
-
document.getElementById('broadcast-challenge').textContent = title;
|
| 1979 |
-
// content is already just text, but let's be safe
|
| 1980 |
-
const rawText = p.prompt || p.code || '';
|
| 1981 |
-
const isCode = !p.prompt && !!p.code; // If only code exists, treat as code
|
| 1982 |
-
document.getElementById('broadcast-prompt').textContent = cleanText(rawText, isCode);
|
| 1983 |
-
document.getElementById('broadcast-prompt').style.textAlign = isCode ? 'left' : 'left'; // Always left, but explicit
|
| 1984 |
-
|
| 1985 |
-
// Store IDs for actions
|
| 1986 |
-
modal.dataset.userId = userId;
|
| 1987 |
-
modal.dataset.challengeId = challengeId;
|
| 1988 |
-
|
| 1989 |
-
modal.classList.remove('hidden');
|
| 1990 |
-
// Animation trigger
|
| 1991 |
-
setTimeout(() => {
|
| 1992 |
-
content.classList.remove('scale-95', 'opacity-0');
|
| 1993 |
-
content.classList.add('opacity-100', 'scale-100');
|
| 1994 |
-
}, 10);
|
| 1995 |
-
};
|
| 1996 |
-
}
|
|
|
|
| 1958 |
}).join('');
|
| 1959 |
}
|
| 1960 |
|
| 1961 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|