diff --git a/App/teacher.html b/App/teacher.html index 5665675..53aab23 100644 --- a/App/teacher.html +++ b/App/teacher.html @@ -1375,39 +1375,46 @@ async function _renderInactiveToday(activeSet) { try { data = await api('live?summary=1&class_id=' + currentClassId + '&date=' + encodeURIComponent(today)); } catch(e){ return ''; } if (!data || data.error || !Array.isArray(data.students)) return ''; - var rows = []; + var groups = []; data.students.forEach(function(s){ if (activeSet && activeSet[s.studentId]) return; // gerade online → oben var sess = (s.sessions||[]).filter(function(x){ return x.startMs; }); if (!sess.length) return; // heute nichts gespielt if (sess.some(function(x){ return x.isLive || x.success==='running'; })) return; // läuft noch → oben - sess.sort(function(a,b){ return (b.endMs||0)-(a.endMs||0); }); - rows.push({ s:s, last:sess[0] }); + sess.sort(function(a,b){ return (a.startMs||0)-(b.startMs||0); }); // chronologisch + var lastEnd = 0; sess.forEach(function(x){ if((x.endMs||0)>lastEnd) lastEnd = x.endMs||0; }); + groups.push({ s:s, sess:sess, lastEnd:lastEnd }); }); - if (!rows.length) return ''; - rows.sort(function(a,b){ return (b.last.endMs||0)-(a.last.endMs||0); }); - var html = '
Heute schon gearbeitet, gerade aber offline — mit letzter Aktivität und deren Leistung.
'; + if (!groups.length) return ''; + groups.sort(function(a,b){ return b.lastEnd - a.lastEnd; }); // zuletzt aktive Person oben + var html = 'Heute schon gearbeitet, gerade aber offline — alle Aktivitäten mit Uhrzeit und Leistung.
'; html += '| Schüler*in | ' + 'Zuletzt aktiv | ' + 'Aktivität | ' + 'Leistung |
|---|---|---|---|
| '+av+''+esc(s.displayName)+' | ' - + ''+_hhmm(last.endMs)+' Uhr | ' - + ''+esc((last.simIcon||'📚')+' '+(last.simTitle||last.simId))+(last.lessonLabel?' · '+esc(last.lessonLabel):'')+' | ' - + ''+perf+' |
| '+nameCell+' | ' + + ''+_hhmm(last.endMs)+' Uhr | ' + + ''+esc((last.simIcon||'📚')+' '+(last.simTitle||last.simId))+(last.lessonLabel?' · '+esc(last.lessonLabel):'')+' | ' + + ''+perf+' |