fixup! Fixed title not correctly saving!

Fixed loading of timestamp. Effectively fixed parsing of non numeric Config values
This commit is contained in:
Felix Homa 2023-08-01 15:03:08 +02:00
parent e208d65b7c
commit 55499195da
Signed by: felix.homa
GPG Key ID: 43610F311720D3DA
1 changed files with 33 additions and 35 deletions

View File

@ -112,37 +112,6 @@
} }
</style> </style>
</form> </form>
<script>
var get_params = {};
location.search
.substr(1)
.split("&")
.forEach(function (item) {
var sp = item.split("=");
get_params[sp[0]] = decodeURIComponent(sp[1]);
switch(sp[0]) {
case "inputExamDuration":
case "inputExtraDuration":
case "inputEarlyCutoff":
case "inputHelpSheet":
case "inputSeatingRowsUsed":
case "inputSeatingRowsFree":
case "inputSeatingSeatsFree":
get_params[sp[0]]-=0; // Convert to Number
document.getElementById(sp[0]).value=get_params[sp[0]];
break;
default:
break;
}
});
if(!("inputExamStart" in get_params)) {
document.getElementById("inputExamStart").value="";
}
console.log("Parsed Parameters");
console.log(get_params);
var on_load_time = new Date();
console.log(on_load_time.toLocaleString('sv'));
</script>
</div> </div>
<div style="display: none" id="Vorbereitung"> <div style="display: none" id="Vorbereitung">
<h2>Vorbereitung</h2> <h2>Vorbereitung</h2>
@ -196,6 +165,38 @@
var halfHourWarningTime = null; var halfHourWarningTime = null;
var halfHourWarningTime2 = null; var halfHourWarningTime2 = null;
var halfHourWarningBlinkCount = 2 var halfHourWarningBlinkCount = 2
var get_params = {};
location.search
.substr(1)
.split("&")
.forEach(function (item) {
var sp = item.split("=");
get_params[sp[0]] = decodeURIComponent(sp[1]);
switch(sp[0]) {
case "inputExamDuration":
case "inputExtraDuration":
case "inputEarlyCutoff":
case "inputHelpSheet":
case "inputSeatingRowsUsed":
case "inputSeatingRowsFree":
case "inputSeatingSeatsFree":
get_params[sp[0]]-=0; // Convert to Number
document.getElementById(sp[0]).value=get_params[sp[0]];
console.log("Loaded: " + sp[0] + " => " + get_params[sp[0]]);
break;
default:
document.getElementById(sp[0]).value=get_params[sp[0]];
console.log("Loaded: " + sp[0] + " => " + get_params[sp[0]]);
break;
}
});
if(!("inputExamStart" in get_params)) {
document.getElementById("inputExamStart").value="";
}
console.log("Parsed Parameters");
console.log(get_params);
var on_load_time = new Date();
console.log(on_load_time.toLocaleString('sv'));
var inputs=["inputExamDuration","inputExtraDuration","inputEarlyCutoff","inputHelpSheet","inputSeatingRowsUsed","inputSeatingRowsFree","inputSeatingSeatsFree","inputExamTitle"]; var inputs=["inputExamDuration","inputExtraDuration","inputEarlyCutoff","inputHelpSheet","inputSeatingRowsUsed","inputSeatingRowsFree","inputSeatingSeatsFree","inputExamTitle"];
function start_exam() { function start_exam() {
@ -435,9 +436,6 @@
for(let eid in seatingInputs) { for(let eid in seatingInputs) {
document.getElementById(seatingInputs[eid]).onchange=rebuildSeating; document.getElementById(seatingInputs[eid]).onchange=rebuildSeating;
} }
if(("inputExamTitle" in get_params)) {
document.getElementById("inputExamTitle").value=get_params["inputExamTitle"];
}
rebuildSeating(); rebuildSeating();
document.getElementById("inputExamTitle").onchange=updateTitle; document.getElementById("inputExamTitle").onchange=updateTitle;
document.getElementById("inputExamTitle").oninput=updateTitle; document.getElementById("inputExamTitle").oninput=updateTitle;