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 }}
  • Note that in this round, unlike in previous rounds, the group's budget does not depend on whether Player 5 is in the group or not.
  • {{ endif }} diff --git a/live_bargaining/__init__.py b/live_bargaining/__init__.py index ff1f94f..3a4aa7f 100644 --- a/live_bargaining/__init__.py +++ b/live_bargaining/__init__.py @@ -294,7 +294,7 @@ def js_vars(player: Player): @staticmethod def vars_for_template(player: Player): return dict( - p5_is_dummy=len(prod_fcts()[player.round_number]) + last_player_is_dummy=len(prod_fcts()[player.round_number]) == C.PLAYERS_PER_GROUP - 1, actual_round_number=player.subsession.round_number - 1, )