Tag-Ansicht: student_results einbeziehen + Datum/Zoom-Verhalten
- live.php summary: fertige Laeufe aus student_results ergaenzt (dedupliziert gegen assessment/ live) -> JEDER heutige Durchgang erscheint als Balken, egal ueber welchen Submit-Pfad. - teacher.html: Ergebnisse-Tab/Menuewechsel setzt Datum auf HEUTE + Regler auf Auto zurueck; Datumswahl/Heute setzt Regler auf Auto; Auto-Zoom jetzt +/-1 h um die Aktivitaet. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+11
-5
@@ -485,6 +485,8 @@ function switchTab(tab) {
|
||||
tabs.forEach(function(t) { document.getElementById('tab-' + t).classList.toggle('hidden', t !== tab); });
|
||||
// Live-Tab darf seinen Polling-Timer beim Verlassen aufräumen
|
||||
if (tab !== 'live' && _liveTimer) { clearInterval(_liveTimer); _liveTimer = null; }
|
||||
// Betreten des Ergebnisse-Tabs → immer HEUTE + Auto-Zoom (Datum/Regler zurücksetzen).
|
||||
if (tab === 'live') { _liveDate = new Date().toISOString().slice(0,10); _liveWin = {from:null, to:null}; }
|
||||
// "classes"-Tab funktioniert ohne aktive Klasse
|
||||
if (tab === 'classes') { loadClassesAdmin(); return; }
|
||||
if (currentClassId) loadTab(tab);
|
||||
@@ -548,18 +550,22 @@ window.setCompareSim = function(simId){ _liveCompareSim = simId; loadLive(); };
|
||||
function setLiveMode(mode) {
|
||||
console.log('[live] setLiveMode('+mode+')');
|
||||
_liveMode = mode;
|
||||
// Menüwechsel → immer zurück auf HEUTE + Auto-Zoom (Regler-Auswahl verwerfen).
|
||||
_liveDate = new Date().toISOString().slice(0,10);
|
||||
_liveWin = {from:null, to:null};
|
||||
loadLive(); // re-init mit passendem Refresh-Intervall
|
||||
}
|
||||
// Auf window expose — falls Bundler/Scope-Probleme bei inline-onclick
|
||||
window.setLiveMode = setLiveMode;
|
||||
window.setLiveDate = function(d){ _liveDate = d; loadLive(); };
|
||||
window.setLiveDate = function(d){ _liveDate = d; _liveWin={from:null,to:null}; loadLive(); };
|
||||
window.shiftLiveDate= function(n){
|
||||
var d = new Date(_liveDate + 'T12:00:00'); d.setDate(d.getDate()+n);
|
||||
_liveDate = d.toISOString().slice(0,10); loadLive();
|
||||
_liveDate = d.toISOString().slice(0,10); _liveWin={from:null,to:null}; loadLive();
|
||||
};
|
||||
window.liveDateToday= function(){ _liveDate = new Date().toISOString().slice(0,10); loadLive(); };
|
||||
window.liveDateToday= function(){ _liveDate = new Date().toISOString().slice(0,10); _liveWin={from:null,to:null}; loadLive(); };
|
||||
function setLiveDate(dateStr) {
|
||||
_liveDate = dateStr;
|
||||
_liveWin = {from:null, to:null}; // neue Datumswahl → Auto-Zoom auf diesen Tag
|
||||
loadLive();
|
||||
}
|
||||
function shiftLiveDate(deltaDays) {
|
||||
@@ -2253,8 +2259,8 @@ async function renderLiveSummary() {
|
||||
if (!isFinite(minMs)) { minMs = dayBase + 8*3600*1000; maxMs = dayBase + 14*3600*1000; }
|
||||
// Auto-Grenzen (volle Stunden, Wiener Zeit): erste bis letzte Aktivität.
|
||||
var _lo=_vHM(minMs), _hi=_vHM(maxMs);
|
||||
var autoFromH = Math.max(0, _lo.h);
|
||||
var autoToH = Math.min(24, _hi.h + ((_hi.m>0)?1:0));
|
||||
var autoFromH = Math.max(0, _lo.h - 1); // 1 h VOR der ersten Aktivität
|
||||
var autoToH = Math.min(24, _hi.h + ((_hi.m>0)?1:0) + 1); // 1 h NACH der letzten Aktivität
|
||||
// Auto-Grenzen als EINHEITEN der gestauchten Skala (auf Block-Grenzen gerundet).
|
||||
var autoFromU = Math.floor(_hourToUnit(autoFromH));
|
||||
var autoToU = Math.ceil(_hourToUnit(autoToH));
|
||||
|
||||
Reference in New Issue
Block a user