|
|
@@ -29,7 +29,7 @@ class Puzzeltocht {
|
|
|
this.lastUpdate = Date.now();
|
|
|
Api.sendUpdate(this.eventId, this.teamId, this.position, a)
|
|
|
.then(m => {
|
|
|
- this.missionScreen.update(m);
|
|
|
+ this.missionScreen.update(m, true);
|
|
|
this.errorCount = 0;
|
|
|
})
|
|
|
.catch(e => this.onError(e));
|
|
|
@@ -48,7 +48,7 @@ class Puzzeltocht {
|
|
|
if (this.lastUpdate === undefined || Date.now() - this.lastUpdate > 5000) {
|
|
|
Api.sendUpdate(this.eventId, this.teamId, position)
|
|
|
.then(m => {
|
|
|
- this.missionScreen.update(m);
|
|
|
+ this.missionScreen.update(m, false);
|
|
|
this.lastUpdate = Date.now();
|
|
|
this.errorCount = 0;
|
|
|
})
|
|
|
@@ -80,17 +80,21 @@ class MissionScreen {
|
|
|
let answer = form.elements["questionAnwser"].value;
|
|
|
form.elements["questionAnwser"].value = "";
|
|
|
document.getElementById("answerButton").disabled = true;
|
|
|
+ document.getElementById("answerStatus").innerText = "";
|
|
|
callback(answer);
|
|
|
}
|
|
|
|
|
|
- update(m) {
|
|
|
+ update(m, answerResponse) {
|
|
|
+ if (answerResponse && m.id === this.mission.id){
|
|
|
+ document.getElementById("answerStatus").innerText = "Helaas, probeer een ander antwoord...";
|
|
|
+ }
|
|
|
this.mission = m;
|
|
|
document.getElementById("missionTitle").innerText = m.title + " (" + m.distanceToTarget + "m)";
|
|
|
document.getElementById("missionDescription").innerText = m.description;
|
|
|
|
|
|
if (m.type === "QUESTION") {
|
|
|
- document.getElementById("questionMission").style.display = "block";
|
|
|
document.getElementById("answerButton").disabled = false;
|
|
|
+ document.getElementById("questionMission").style.display = "block";
|
|
|
} else {
|
|
|
document.getElementById("questionMission").style.display = "none";
|
|
|
}
|
|
|
@@ -162,7 +166,6 @@ class Api {
|
|
|
return FetchJson.put(url, body);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
class FetchJson {
|