Skip to content

Commit

Permalink
Merge pull request #65 from stanmart/armins-comments
Browse files Browse the repository at this point in the history
Address Armin's comments
  • Loading branch information
miawlu authored Apr 30, 2024
2 parents 7703f01 + 3a5c638 commit 355b468
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 36 deletions.
4 changes: 0 additions & 4 deletions _static/coalitions_demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ function updatePastOffers(newPastOffers) {
} else {
cell.innerHTML = offer.allocations[i]
}
if (i === js_vars.my_id - 1) {
cell.style.fontWeight = 'bold';
cell.style.color = '#056fb7';
}
}

for (let i = 0; i < allocationDropdowns.length; i++) {
Expand Down
6 changes: 3 additions & 3 deletions _static/live_bargaining.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ for (let i = 0; i < numPlayers; i++) {

function sendOffer() {
if (!lastPlayerIsDummy && totalSharedValue > 0 && !isMemberCheckboxes[0].checked) {
openPopup(`Invalid proposal: the budget is zero when Player ${player_names['P1']} is not included in the group`, 'error');
openPopup(`Invalid proposal: the group budget is zero when Player ${player_names['P1']} is not included`, 'error');
return;
}
if (lastPlayerIsDummy && totalSharedValue > 0 && !(isMemberCheckboxes[0].checked && isMemberCheckboxes[1].checked)) {
openPopup(`Invalid proposal: the budget is zero when Players ${player_names['P1']} and ${player_names['P2']} are not included in the group`, 'error');
openPopup(`Invalid proposal: the group budget is zero when Players ${player_names['P1']} and ${player_names['P2']} are not included`, 'error');
return;
}
if (totalSharedValue > totalShareableValue) {
openPopup('Invalid proposal: total amount exceeds the budget available to this group', 'error');
openPopup('Invalid proposal: total amount exceeds the group budget', 'error');
return;
}
for (let i = 0; i < numPlayers; i++) {
Expand Down
4 changes: 2 additions & 2 deletions _static/proposal_demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ function sendOffer() {
};

if (!lastPlayerIsDummy && totalSharedValue > 0 && !isMemberCheckboxes[0].checked) {
openPopup(`Invalid proposal: the budget is zero when Player ${player_names['P1']} is not included in the group`, 'error');
openPopup(`Invalid proposal: the group budget is zero when Player ${player_names['P1']} is not included`, 'error');
return;
}
if (lastPlayerIsDummy && totalSharedValue > 0 && !(isMemberCheckboxes[0].checked && isMemberCheckboxes[1].checked)) {
openPopup(`Invalid proposal: the budget is zero when Players ${player_names['P1']} and ${player_names['P2']} are not included in the group`, 'error');
openPopup(`Invalid proposal: the group budget is zero when Players ${player_names['P1']} and ${player_names['P2']} are not included`, 'error');
return;
}
if (totalSharedValue > totalShareableValue) {
Expand Down
15 changes: 8 additions & 7 deletions introduction/Coalitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<h4> Accepting proposals </h4>

<p>
During the five minutes of discussion and bargaining <b>you can change which proposal you currently accept any number of task-submit-preferred.
During the five minutes of discussion and bargaining <b>you can change which proposal you currently accept any number of times.
At the end of the five minutes, everyone's currently accepted proposal becomes final.</b>
The "Currently accepted proposal" interface for this is shown below. You can see which proposal ID each player currently accepts (or whether they reject all, by choosing "—").
In the row below you see which payoffs these choices would lead to.
Expand All @@ -26,6 +26,7 @@ <h4> Accepting proposals </h4>
<h5> Try it yourself </h5>

<div>
<p>As an illustration, suppose you are <span style="color: #056fb7; font-weight: bold;">Player {{player_name}}</span><div class=""></div></p>
<p>Please perform the following tasks:</p>
<ul>
<li id="task-submit-preferred">Submit a preferred proposal <span class="checkmark" style="visibility: hidden;"></span></li>
Expand Down Expand Up @@ -137,9 +138,9 @@ <h3>All proposals</h3>
<tr>
<th class="offer-id-col">ID</th>
<th class="offer-proposer-col">From</th>
<th class="offer-player-col player-1">{{P1}}</th>
<th class="offer-player-col player-2">{{P2}}</th>
<th class="offer-player-col player-3">{{P3}}</th>
<th class="offer-player-col">{{P1}}</th>
<th class="offer-player-col">{{P2}}</th>
<th class="offer-player-col">{{P3}}</th>
</tr>
</thead>
<tbody id="past-offers-table"></tbody>
Expand All @@ -154,9 +155,9 @@ <h3>Currently accepted proposal </h2>
<tbody>
<tr>
<th></th>
<th class="offer-player-col player-1">Player {{P1}}</th>
<th class="offer-player-col player-2">Player {{P2}}</th>
<th class="offer-player-col player-3">Player {{P3}}</th>
<th class="offer-player-col">Player {{P1}}</th>
<th class="offer-player-col">Player {{P2}}</th>
<th class="offer-player-col">Player {{P3}}</th>
</tr>
<tr style="height: 3em;">
<th class="offer-left-col">Accepted proposal <span class="red-highlight">ID</span></th>
Expand Down
2 changes: 1 addition & 1 deletion introduction/Instructions.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</p>

<p>
You can form a group with as many of these players as you like. The group will receive a budget which can be distributed freely among its group members.
You can form a group with one or both of these players. The group will receive a budget which can be distributed freely among its group members.
The size of the budget depends on the size of the group and who is in the group (more details on this on the next page).
</p>

Expand Down
9 changes: 5 additions & 4 deletions introduction/Proposal.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@

{{ block content }}

<p> On this page, we explain how the budget of a group is determined and how you can make a proposal. </p>
<p> On this page, we explain how the group budget is determined and how you can make a proposal. </p>

<h4> Group budgets </h4>

<p>
You and the two other players will each be randomly assigned a player role ({{P1}}, {{P2}}, {{P3}}).
<b> The player roles will be reshuffled each round. </b>
<b> The player roles will be reassigned each round. </b>
</p>
{{ if not last_player_is_dummy }}
<p>
Expand All @@ -33,7 +33,7 @@ <h4> Group budgets </h4>
<p>
<b>
A group needs to include Players {{P1}} and {{P2}} to receive a budget of CHF {{grand_coalition_value}}.
The group's budget does not depend on Player {{P3}}'s inclusion. They can still be included in any group.
The group budget does not depend on Player {{P3}}'s inclusion. They can still be included in any group.
</b>
</p>
{{ endif }}
Expand Down Expand Up @@ -71,6 +71,7 @@ <h4> Past proposals </h4>
<h4> Try it yourself </h4>
<p>
<div>
<p>As an illustration, suppose you are <span style="color: #056fb7; font-weight: bold;">Player {{player_name}}</span> (the proposal options are the same no matter the role). </p>
<p> To become more familiar with the interface, we ask you to complete the following small exercise: </p>
<p>
For each of the criteria below, make a proposal that satisfies it.
Expand Down Expand Up @@ -112,7 +113,7 @@ <h3> Group budgets </h3>
<th id="payoff-table-header-title">Group members</th>
</tr>
<tr id="payoff-table-values">
<th>Group's budget </th>
<th>Group budget </th>
</tr>
</table>
<div style="height: 200px; width: 350px">
Expand Down
2 changes: 2 additions & 0 deletions introduction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def vars_for_template(player: Player):
grand_coalition_value=list(player.session.config["prod_fct"].values())[-1],
last_player_is_dummy=len(player.session.config["prod_fct"])
== 2, # hardcoded group size
player_name=player.session.config["player_names"]["P1"],
**player.session.config["player_names"],
)

Expand All @@ -72,6 +73,7 @@ def vars_for_template(player: Player):
return dict(
last_player_is_dummy=len(player.session.config["prod_fct"])
== 2, # hardcoded group size
player_name=player.session.config["player_names"]["P1"],
**player.session.config["player_names"],
)

Expand Down
2 changes: 1 addition & 1 deletion live_bargaining/Bargain.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<th id="payoff-table-header-title">Group members</th>
</tr>
<tr id="payoff-table-values">
<th>Group's budget</th>
<th>Group budget</th>
</tr>
</table>
<div style="height: 200px; width: 350px">
Expand Down
2 changes: 1 addition & 1 deletion survey/Questions.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h4>Preference questions</h4>
<th>Neutral</th>
<th>Agree</th>
<th>Strongly agree</th>
<th>Prefer not to say</th>
<th>No opinion</th>
</tr>
</thead>
{{ for field in form }}
Expand Down
24 changes: 12 additions & 12 deletions survey/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Player(BasePlayer):
"Medium difficulty",
"Difficult",
"Very difficult",
"Prefer not to say",
"No opinion",
],
label="How would you rate the difficulty level of the game?",
widget=widgets.RadioSelectHorizontal,
Expand All @@ -142,7 +142,7 @@ class Player(BasePlayer):
"Neutral",
"Well",
"Very well",
"Prefer not to say",
"No opinion",
],
label="How well was the game explained?",
widget=widgets.RadioSelectHorizontal,
Expand All @@ -154,7 +154,7 @@ class Player(BasePlayer):
"Neutral",
"Well",
"Very well",
"Prefer not to say",
"No opinion",
],
label="How well could you work with the bargaining interface?",
widget=widgets.RadioSelectHorizontal,
Expand All @@ -166,7 +166,7 @@ class Player(BasePlayer):
"Just right",
"Too much",
"Way too much",
"Prefer not to say",
"No opinion",
],
label="Did you feel there was enough time for the bargaining?",
widget=widgets.RadioSelectHorizontal,
Expand All @@ -189,7 +189,7 @@ class Player(BasePlayer):
"Neutral",
"Agree",
"Strongly Agree",
"Prefer not to say",
"No opinion",
],
label="If adding player X to a group never increases the budget, player X should get nothing. ",
widget=widgets.RadioSelectHorizontal,
Expand All @@ -202,7 +202,7 @@ class Player(BasePlayer):
"Neutral",
"Agree",
"Strongly Agree",
"Prefer not to say",
"No opinion",
],
label="If adding player X to a group always has the same impact on the budget as adding player Y, then player X and player Y should get the same payoff.",
widget=widgets.RadioSelectHorizontal,
Expand All @@ -215,7 +215,7 @@ class Player(BasePlayer):
"Neutral",
"Agree",
"Strongly Agree",
"Prefer not to say",
"No opinion",
],
label="The payoffs at the end of a bargaining round should always add up to the biggest possible budget (100 CHF). ",
widget=widgets.RadioSelectHorizontal,
Expand All @@ -228,9 +228,9 @@ class Player(BasePlayer):
"Neutral",
"Agree",
"Strongly Agree",
"Prefer not to say",
"No opinion",
],
label="Suppose in round 3 the budget each group (out of the three players) can get is the sum of the budget it can get in round 1 and 2. Then the payoff of player X should the be the sum of the payoff player X got in round 1 and 2.",
label="Suppose in round 3 the group budgets are the sum of the group budgets in round 1 and 2 for any group. Then the payoff of player X should the be the sum of the payoff player X got in round 1 and 2.",
widget=widgets.RadioSelectHorizontal,
) # type: ignore

Expand All @@ -241,9 +241,9 @@ class Player(BasePlayer):
"Neutral",
"Agree",
"Strongly Agree",
"Prefer not to say",
"No opinion",
],
label="Suppose in round 2 each group of players has double the budget they can get in round 1. Then the payoff of player X should be double the amount player X got in round 1.",
label="Suppose in round 2 each group budget is twice as large as in in round 1. Then the payoff of player X should be double the amount player X got in round 1.",
widget=widgets.RadioSelectHorizontal,
) # type: ignore

Expand All @@ -254,7 +254,7 @@ class Player(BasePlayer):
"Neutral",
"Agree",
"Strongly Agree",
"Prefer not to say",
"No opinion",
],
label="If player X and player Y would have a budget of Z if they formed a group on their own, then the payoffs of player X and Y should be at least Z in total in the final accepted proposal.",
widget=widgets.RadioSelectHorizontal,
Expand Down
2 changes: 1 addition & 1 deletion survey/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def play_round(self):
"symmetry_axiom": "Strongly Agree",
"efficiency_axiom": "Agree",
"linearity_additivity_axiom": "Neutral",
"linearity_HD1_axiom": "Prefer not to say",
"linearity_HD1_axiom": "No opinion",
"stability_axiom": "Disagree",
}
yield Questions, answers

0 comments on commit 355b468

Please sign in to comment.