Group page: B3 fidelity (cell-main/cell-sub, defense code in cell), class-based eye/focus, utilities; drop import button

This commit is contained in:
2026-10-02 17:02:58 +03:00
parent ece700d91b
commit c2f7235df6
4 changed files with 61 additions and 85 deletions

View File

@@ -306,16 +306,13 @@ function updateEyeCounts() {
var total = parseInt(eye.getAttribute('data-total') || '0', 10);
var count = parseInt(eye.getAttribute('data-count') || '0', 10);
var all = eye.getAttribute('data-all') === 'true';
eye.classList.remove('ok', 'partial', 'warn');
eye.classList.add(all ? 'ok' : (count > 0 ? 'partial' : 'warn'));
var on = eye.querySelector('.eye-open');
var off = eye.querySelector('.eye-closed');
if (on) on.style.display = count > 0 ? '' : 'none';
if (off) off.style.display = count > 0 ? 'none' : '';
eye.classList.toggle('is-empty', count === 0);
eye.classList.toggle('is-all', all);
eye.classList.toggle('is-partial', count > 0 && !all);
var c = eye.querySelector('.js-pub-count');
if (c) {
c.textContent = count;
c.style.display = (count > 0 && !all) ? '' : 'none';
c.classList.toggle('is-hidden', count === 0 || all);
}
eye.title = all
? 'Оценки опубликованы всей группе — нажмите, чтобы скрыть у всех'
@@ -363,7 +360,7 @@ function applyDefenseToCell(s) {
label.textContent = started ? ''
: (s.status == null ? '—'
: (s.status === 'ready' ? 'готова'
: (s.code ? 'код' : 'ожидает')));
: (s.code ? 'код ' + s.code : 'ожидает')));
}
if (s.status === 'ready') {
btn.title = 'Защита завершена: ' + (s.readyReason === 'timeout' ? 'время вышло' : 'студент нажал «Готов»');
@@ -451,7 +448,7 @@ function defenseReasonText(reason) {
function defenseStatusText(status, code, seconds, reason) {
if (status === 'waiting') {
return code
? 'Задание назначено, код выдан — ждём входа студента.'
? 'Задание назначено. Код входа: ' + code + ' — ждём входа студента.'
: 'Задание назначено, код ещё не выдан.';
}
if (status === 'started') return 'Студент выполняет работу, осталось ' + fmtSeconds(seconds) + '.';
@@ -598,7 +595,7 @@ function focusLab() {
if (!s) return;
var labId = s.value;
document.querySelectorAll('th.lab-col[data-lab], td.cell-lab[data-lab], .filter-row th[data-lab]').forEach(function (el) {
el.style.display = (!labId || el.getAttribute('data-lab') === labId) ? '' : 'none';
el.toggleAttribute('hidden', !!labId && el.getAttribute('data-lab') !== labId);
});
}

View File

@@ -4,8 +4,7 @@
var area = document.createElement('textarea');
area.value = text;
area.setAttribute('readonly', '');
area.style.position = 'fixed';
area.style.top = '-1000px';
area.className = 'offscreen';
document.body.appendChild(area);
area.select();
try { document.execCommand('copy'); } catch (e) { /* игнорируем */ }