diff --git a/_static/info.js b/_static/info.js index 16a7d26..be582e6 100644 --- a/_static/info.js +++ b/_static/info.js @@ -1,5 +1,7 @@ +let numPlayers = 3; + let prod_fct = js_vars.prod_fct; -let P5IsDummy = prod_fct.length == 4; +let lastPlayerIsDummy = prod_fct.length == numPlayers - 1; // Payoff chart const ctx = document.getElementById('payoff-chart'); @@ -24,7 +26,7 @@ let chart = new Chart(ctx, { }, x: { title: { - text: "P1 + this many others in group" + (P5IsDummy ? " (excluding P5)" : ""), + text: "P1 + this many others in group" + (lastPlayerIsDummy ? ` (excluding P${numPlayers})` : ""), display: true } } @@ -42,9 +44,9 @@ let chart = new Chart(ctx, { payoffTableHeader = document.getElementById('payoff-table-header'); payoffTableRow = document.getElementById('payoff-table-values'); -if (P5IsDummy) { +if (lastPlayerIsDummy) { let coalitionSizeHeader = document.getElementById('payoff-table-header-title'); - coalitionSizeHeader.innerHTML += " (excluding P5)"; + coalitionSizeHeader.innerHTML += ` (excluding P${numPlayers})`; } prod_fct.forEach(function (payoff, i) { diff --git a/live_bargaining/Bargain.html b/live_bargaining/Bargain.html index ac21eed..b93e720 100644 --- a/live_bargaining/Bargain.html +++ b/live_bargaining/Bargain.html @@ -20,7 +20,7 @@ You see the budget sizes for this particular round on the right. - {{ if p5_is_dummy }} + {{ if last_player_is_dummy }}