diff --git a/web/index.html b/web/index.html
index 1e4c2df..63ef05b 100644
--- a/web/index.html
+++ b/web/index.html
@@ -40,8 +40,8 @@
@@ -68,6 +68,7 @@
Schweinchen |
Optionen |
|
+
Spielende |
@@ -122,6 +123,9 @@
Alternative Antwort:
+
+
+ |
diff --git a/web/js/main.js b/web/js/main.js
index d431d57..e991096 100644
--- a/web/js/main.js
+++ b/web/js/main.js
@@ -5,6 +5,9 @@ var answerFail = null;
var schweinchenVolume = 1;
var answerFailVolume = 1;
var schweinchen = null;
+// when the points for a round are assigned, we still want to show the other answers but no points should be calculated by that time
+// reset when changing a question
+var currentRoundPointsResolved = false;
$(document).ready(function() {
$( "#fragenListe" ).sortable();
@@ -384,6 +387,7 @@ function changeFrage() {
var index = $("#questionsSelect>option:selected").index();
wsSend("loadQuestion", index);
wsSend("clearAllFailsBtn", "");
+ wsSend("resetPointsResolvedFlag", "false");
}
function loadQuestionToGui(index) {
@@ -555,6 +559,26 @@ function recalcSum(s) {
}
}
+// Add the scores from the final rounds to the current scores from previous rounds
+function showFinalScores() {
+ $("#answers").hide();
+ $("#displayQuestions").hide();
+ $("#result").hide();
+ $("#resultFinal").hide();
+ $("#pointsCenter").hide();
+ $(".pointsLeft").show();
+ $(".pointsRight").show();
+
+ const leftFinalScore = parseFloat($("#SumRes_player1").text());
+ const rightFinalScore = parseFloat($("#SumRes_player2").text());
+
+ $(".pointsLeft").text(parseFloat($(".pointsLeft").text()) + leftFinalScore);
+ $(".pointsRight").text(parseFloat($(".pointsRight").text()) + rightFinalScore);
+
+ // show final scores with blinds
+ $(".footer").show("blind", { direction: "left" }, 1500);
+}
+
function getAnswerString(str) {
if (isFinalMode){
while(str.length < 24) {
diff --git a/web/js/websocket.js b/web/js/websocket.js
index 4e140a2..f759ba3 100644
--- a/web/js/websocket.js
+++ b/web/js/websocket.js
@@ -53,6 +53,10 @@ $(document).ready(function() {
wsSend("clearAllFailsBtn", "");
});
+ $("#showFinalScores").click(function() {
+ wsSend("showFinalScores", "");
+ });
+
$("#toggleSoundImg").click(function() {
wsSend("toggleSound", "");
});
@@ -129,6 +133,8 @@ var connectWs = function() {
$("#toggleSoundImg").attr("src", "./img/soundOn.png");
sounds = true;
}
+ } else if(key == "showFinalScores") {
+ showFinalScores()
} else if(key == "file") {
if(value == "fragen.txt") {
try {