Skip to content

Commit

Permalink
Get rid of remaining P5 mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
stanmart committed Apr 18, 2024
1 parent 55bf937 commit 8586c10
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions _static/info.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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
}
}
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion live_bargaining/Bargain.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
You see the budget sizes for this particular round on the right.
</li>

{{ if p5_is_dummy }}
{{ if last_player_is_dummy }}
<li><span class="red-highlight"> 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.</span></li>
{{ endif }}
<!-- The line below might be more suitable for the final experiment -->
Expand Down
2 changes: 1 addition & 1 deletion live_bargaining/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit 8586c10

Please sign in to comment.