Great game of Turkey: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(more code)
 
(19 intermediate revisions by 2 users not shown)
Line 2: Line 2:


'''Make today's decision
'''Make today's decision
First, see the issue and possible actions.


<rcode label="See the question of the day" embed=1>
<rcode label="See the issue of the day" embed=1>
# This code is Op_en7421# on page [[Great game of Turkey]]
# This code is Op_en7421# on page [[Great game of Turkey]]


Line 9: Line 10:


objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en7421", code_name = "initiate")
happiness <- 0


out <- questionofday()
temp <- EvalOutput(issueofday)
cat("Issue:", out$Issue, "\n")
temp <- temp[temp$Date == as.character(Sys.Date()) , ]
cat(out$Issuedescription, "\n")
oprint(out[ , colnames(c("Action", "Description")])


if(nrow(temp@output) == 0) {
cat("Issues have not yet been suggested for today.\n")
} else {
cat(
  "Issue #",
  temp$Issueid[1],
  ":",
  as.character(temp$Issue[1]),
  "\n",
  as.character(temp$Issuedescription[1]),
  "(", as.character(temp$issuevoteResult)[1],
  "votes).\n"
)
colnames(temp@output)[colnames(temp@output) == "issueofdayResult"] <- "Votes"
oprint(temp[ , c("Action", "Actiondescription", "Actionid", "Votes")], include.rownames = FALSE)
}
</rcode>
</rcode>
Then, make the decision about today's issue.


<rcode name="choices" label="Choose policy" embed=1 variables="
<rcode name="choices" label="Choose policy" embed=1 variables="
name:option|description:Check above the question of the day and decide which option you would choose.|type:selection|options:
name:option|description:Check above the issue of the day and decide which option you would choose.|type:selection|options:
1;Option 1;
1;First option;
2;Option 2
2;Second option
">
">
# This is code Op_en7421/choices on page [[Great game of Turkey]]
# This is code Op_en7421/choices on page [[Great game of Turkey]]
# Parameters used:
## option: numeric (1 or 2)


library(OpasnetUtils)
library(OpasnetUtils)
Line 29: Line 49:
objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en7421", code_name = "initiate")


ques <- questionofday()
temp <- EvalOutput(issueofday)
temp <- temp[temp$Date == as.character(Sys.Date()) , ]
 
if(nrow(temp) == 0 {
cat("Issues have not yet been suggested for today.\n")
} else {
dat <- data.frame(
  Date = temp$Date[option],
  Issue = temp$Issue[option],
  Action = temp$Action[option],
  User = wiki_username,
  Result = as.numeric(Sys.time())
)
 
opbase.upload(
dat,
ident = "Op_en7421",
name = "Great game of Turkey",
subset = "Decisions",
act_type = "append",
language = "eng",
who = wiki_username
)
 
oprint(dat, include.rownames = FALSE)
cat("Your choice was successfully saved.\n")
}
</rcode>
 
== Question ==
 
What is a good game to crowdsource citizen priorities about daily political decisions in such a way that
* it can be done using a mobile app,
* it characterises happiness of citizen groups of the decisions,
* it characterises progress of important societal values,
* it enables crowdsourcing the actual issues and actions asked?
 
== Answer ==
 
=== How to play ===
 
In this game you get to be the president of Turkey, having to daily make decisions about big and small things. Once a day you choose between two options according to what you would decide about a certain issue. The issue changes daily. Making a decision will cause a change in happiness (see "Happiness") of different population groups and societally important values (see "Values"). Each player will be scored as a decisionmaker based on how they are able to promote happiness and societal values. Players see their own score over time, accompanied by the score of the crowd. The point of the game is to make decisions so that you increase the happiness of different groups as much as possible while also helping to promote important objectives.
 
'''Getting started
:Before beginning to play, you might consider creating a wiki account, but this is not mandatory. You can do this by clicking "Sign in/Create account" on the top right corner of the page. When you are signed in, you are able to participate in discussions on the possible actions for different issues (See "Suggesting and voting for issues for the issues"). If you do not create an account and play signed in, the IP address for your computer will be used to identify you in the game to keep your score.
:Whether you create yourself a wiki account or not, before you can begin to play, you have to setup your profile. This means choosing which social group you most identify with. There are six groups to choose from: nationalists, liberals, conservatives, minorities, kemalists and other. You can do this in the answer-section, under "Setup profile". You can only belong to one group. You may also change your preferences later. In the beginning you are given 1 bonus to start the game with.
 
'''Making today's decision
:Making decisions every day about the issue of the day is the basic thing to do in the game. By making a decision about the daily issue, you earn 0.1 bonus. To make a decision about the daily issue, first click "See the issue of the day" on the top of the page to see what the decision is about today and what the options are. After you have read the issue and the options, you can make the decision between the first and second options by choosing the correct one from the drop-down menu below this. Remember to also click on "Choose policy". These decisions will affect how happy you are able to keep the different groups of people (see "Happiness") and how well you are able to promote the different social objectives (see "Values").
 
'''Suggesting and voting for issues of the day
:You can also affect what the issues voted on will be. Under "Suggest issues and actions" you can submit your own suggestion for an issue for any specific day in the future. You can only suggest one issue for a specific day. If you suggest a new issue for that day, only your newest suggestion will appear in the list. You can also vote for the issue of the day from among the issues already suggested. The suggestion that is ranked highest will become the issue of the day, and the player who suggested it gains 5 bonuses. An issue can be suggested again for a later time point (for example, if it is not played on the first day suggested).
:To vote for an issue first see the issues suggested under "See all suggested issues and actions". You can check the issues suggested for any particular day, or all issues suggested for all days. To vote check the Issueid of the issue you want to vote for and type it into "What is the Issueid (from 'See all actions') of the issue that should be played?" under "Vote for issues and actions". You can only vote for issues on the day they have been suggested for, and only vote for one issue per day. The amount of bonuses you have gathered in the game tells the weight of your vote. If, for example, you have 3 bonuses, your vote equals the votes of three players who all have 1 bonus.
 
'''Suggesting and voting for actions for the issues
:In the same way as you can suggest and vote for issues of the day, you can also suggest and vote for the action options for any of the issues. The two actions ranked highest will become the options for a certain issue, and the players who suggested them will gain 1 bonus. You can suggest actions for an issue as soon as the issue has been suggested, and the actions can be voted for as soon as they are in the system. The purpose of this is to promote discussion about actions and hence critical evaluation which actions should be upvoted to be played. To participate in the discussion, you need to have a wiki account (see "Getting started" above). You can find the discussions on the "Discussion" tab of this page. You can only vote for one action per issue, and like with voting for issues, the bonuses you have add to the weight of your vote. If an issue is suggested again for a later time point than the original suggestion was, previous related actions and their votes apply.
 
'''Happiness
:You can also take part in evaluating how much happiness or unhappiness the different actions bring to the social group you belong in, practically meaning how satisfied the people of the group would be if the action was the one chosen. You can do this under "Evaluate happiness and values". Type in the Actionid (you can see this under "See all suggested issues and actions"), and choose from the drop-down menu the happiness score that best describe the amount of happiness the action would bring to your group. You can do this only once per action. Negative scores mean it would decrease happiness within the group. Evaluation of happiness related to an action is possible as soon as the action has been suggested.
:The evaluations of all players are then brought together and are used to determine how much a player is able to increase happiness when making the daily decisions. This, you may remember, is the point of the game.
 
'''Values
:Aside from happiness, you can also evaluate how much value different actions bring to different objectives. There are five objectives: Civil rights, woman's rights, religion, national values and democracy. Under "Evaluate happiness and values" you can tell how much value different actions bring to different objectives. Value practically means the improving of the conditions having to do with an objective. Type in the Actionid and then choose the objective you want to evaluate and the value the action would bring to it from the drop-down menus. The evaluation of values related to actions is possible as soon as the actions are suggested. You can only evaluate the value once per action and objective.
:The value of each action given to the objective is summarised from all layers the same way as the happiness scores and are used to determine how much it promotes the different social objectives. Making decisions that make things better in respect to these objectives is also the point of the game.
 
'''Overview of the decisions'''
: In time, you will make a lot of decisions. You can see and overview of these decisions under "Game results" by clicking "Run code". It shows you a graph of a cumulative timeline so that every day your decision will take you up or down in the eyes of different groups (see "Happiness" above) or different objectives (see "Values" above), compared with the majority vote. This gives you an idea of what kind of decisions you have on average made and how you have answered compared to other players. You should try to get the happiness scores of different groups as well as the objectives as high as possible.
 
=== Game results ===
 
:''See the top of the page for the main questionnaire of the game. Here we present results from the game.
 
<rcode embed=1 graphics=1>
#This is code Op_en7421/ on page [[Great game of Turkey]]
 
library(OpasnetUtils)
library(ggplot2)
 
objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en6007", code_name = "answer") # oggplot etc
 
BS <- 24
 
happindex <- EvalOutput(happindex)
valindex <- EvalOutput(valindex)
 
ggplot(happindex@output, aes(x = Date, y = happinessResult, colour = Group, group = Group)) + geom_point() + facet_grid(Decisionmaker ~ .) + theme_gray(base_size = BS)
 
ggplot(valindex@output, aes(x = Date, y = valuesResult, colour = Value, group = Value)) + geom_point() + facet_grid(Decisionmaker ~ .) + theme_gray(base_size = BS)
 
oggplot(happindex, x = "Date", fill = "Group") + facet_wrap(~ User) + labs(title = "Happiness per day") +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) # Turn text and adjust to right
 
happmean <- oapply(happindex, cols = c("Date", "Issue", "Action"), FUN = mean)
happequity <- oapply(happmean, cols = "Group", FUN = sd)
 
oggplot(mergeusers(happmean), x = "Decisionmaker", fill = "Group") + labs(title = "Mean happiness during the whole period")
oggplot(mergeusers(happequity), x = "Decisionmaker") + labs(title = "Deviation from the equity")


dat <- data.frame(
valmean <- oapply(valindex, cols = c("Date", "Issue", "Action"), FUN = mean)
Question = ques$Question[1],
valequity <- oapply(valmean, cols = "Issue", FUN = sd)
User = wiki_username,  
Result = ques$Option[option] # Option
)


opbase.upload(
oggplot(mergeusers(valmean), x = "Decisionmaker", fill = "Issue") + labs(title = "Mean values over time")
dat,  
oggplot(mergeusers(progequity), x = "Decisionmaker") + labs(title = "Deviation from the policy balance")
ident = "Op_en7421",  
name = "Great game of Turkey",
subset = "Decisions",  
act_type = "replace",
language = "eng",
who = wiki_username
)


oprint(dat)
cat("Your choice was successfully saved.\n")
</rcode>
</rcode>
=== Setup profile ===


'''Setup your profile. Do this before you start.
'''Setup your profile. Do this before you start.
Line 63: Line 170:
">
">
# This is code Op_en7421/choices on page [[Great game of Turkey]]
# This is code Op_en7421/choices on page [[Great game of Turkey]]
# Paramters:
## group: selection (text string)


library(OpasnetUtils)
library(OpasnetUtils)
Line 82: Line 191:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your group was successfully saved.\n")
cat("Your group was successfully saved.\n")
Line 105: Line 214:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your seed bonus was successfully saved.\n")
cat("Your seed bonus was successfully saved.\n")
Line 111: Line 220:
</rcode>
</rcode>


=== See all suggested issues and actions ===
<rcode label="See all actions" embed=1 variables="
name:date|description:Issues and actions for which day?|type:date|
name:all|description:Do you want to see a single day or all?|type:selection|
options:FALSE;Show only the selected day;TRUE;Show all days|default:FALSE
">
# This code is Op_en7421# on page [[Great game of Turkey]]
# Parameters:
## date: date type
## all: logical (if TRUE, show all days)
library(OpasnetUtils)
objects.latest("Op_en7421", code_name = "initiate")
allactions <- EvalOutput(allactions)
if(all) temp <- allactions else temp <- allactions[allactions$Date == as.character(date) , ]
colnames(temp@output)[colnames(temp@output) == "allactionsResult"] <- "Votes"
if(nrow(temp@output) == 0) {
  cat("Issues not found for that time.\n")
} else {
  for(i in sort(unique(paste(temp$Date, temp$Issueid)))) {
    temp2 <- temp[paste(temp$Date, temp$Issueid) == i , ]
    cat(
      as.character(temp$Date[1]),
      "Issueid",
      as.character(temp2$Issueid[1]),
      ":",
      as.character(temp2$Issue[1]),
      "\n",
      as.character(temp2$Issuedescription[1]),
      "(", as.character(temp$issuevoteResult)[1],
      "votes).\n"
    )
    oprint(temp2[ , c("Action", "Actiondescription", "Actionid", "Votes")], include.rownames = FALSE)
  }
}
</rcode>
=== Suggest issues and actions ===
{|
|
<rcode label="Suggest issue" embed=1 variables="
<rcode label="Suggest issue" embed=1 variables="
name:date|description:When should this issue be played?|type:date|
name:issue|description:What is the issue (decision) that should be played? (briefly)|type:textbox|
name:issue|description:What is the issue (decision) that should be played? (briefly)|type:textbox|
name:description|description:Give a more detailed description.|type:textbox
name:description|description:Give a more detailed description.|type:textbox|
name:date|description:When should this issue be played?|type:date
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
# This is code Op_en7421/ on page [[Great game of Turkey]]
# Parameters:
## date: date type. Default: today
## issue: textbox (text string)
## description: textbox(text string)


library(OpasnetUtils)
library(OpasnetUtils)


bonus <- 1
objects.latest("Op_en7421", code_name = "initiate")
 
bonus <- EvalOutput(bonuses)
bonus <- result(bonus)[bonus$User == wiki_username]


dat <- data.frame(
dat <- data.frame(
Date = as.character(date),
Date = as.character(date),
Issue = issue,
Issue = issue,
Description = description,
Issuedescription = description,
User = wiki_username,  
User = wiki_username,  
Result = as.numeric(Sys.time())
Result = as.numeric(Sys.time())
Line 140: Line 301:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your issue was successfully saved.\n")
cat("Your issue was successfully saved.\n")
Line 162: Line 323:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("The issue was also voted for with your bonuses.\n")
cat("The issue was also voted for with your bonuses.\n")


</rcode>
</rcode>
|


<rcode label="Suggest action" embed=1 variables="
<rcode label="Suggest action" embed=1 variables="
name:issue|description:What is the number of the issue (decision) to which this action relates?|type:default|
name:issue|description:What is the Issueid (from 'See all actions') of an issue?|type:default|
name:action|description:What is the action you suggest? (briefly)|type:textbox|
name:action|description:What is the action you suggest to this issue? (briefly)|type:textbox|
name:description|description:Give a more detailed description.|type:textbox
name:description|description:Give a more detailed description.|type:textbox
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
# This is code Op_en7421/ on page [[Great game of Turkey]]
# Parameters:
## issue: numeric (Issueid)
## action: textbox (text string)
## description: textbox (text string)


library(OpasnetUtils)
library(OpasnetUtils)


bonus <- 1
objects.latest("Op_en7421", code_name = "initiate")


iss <- opbase.data("Op_en7421", subset = "Issues")
bonus <- EvalOutput(bonuses)
iss <- iss$Issue[iss$Date == as.character(Sys.Date())][issue]
bonus <- result(bonus)[bonus$User == wiki_username]
if(length(iss) == 0) stop("Issue not found")


dat <- data.frame(
allactions <- EvalOutput(allactions)
Date = as.character(Sys.Date()),
issue <- allactions$Issue[allactions$Issueid == issue][1]
Issue = iss,
Action = action,
Description = description,
User = wiki_username,
Result = as.numeric(Sys.time())
)


opbase.upload(
if(length(bonus) == 0) {
dat,
cat("Setup your account first by selecting a group.\n")
ident = "Op_en7421",
} else {
name = "Great game of Turkey",  
if(length(issue) == 0) {
subset = "Actions",  
cat("Issue not found.\n")
act_type = "append",  
} else {
language = "eng",  
dat <- data.frame(
who = wiki_username
Issue = issue,
)
Action = action,
Actiondescription = description,
User = wiki_username,  
Result = as.numeric(Sys.time())
)


oprint(dat)
opbase.upload(
dat,
ident = "Op_en7421",
name = "Great game of Turkey",
subset = "Actions",
act_type = "append",
language = "eng",
who = wiki_username
)


cat("Your action was successfully saved.\n")
oprint(dat, include.rownames = FALSE)


dat <- data.frame(
cat("Your action was successfully saved.\n")
Date = as.character(Sys.Date()),
Issue = iss,
Action = action,
User = wiki_username,
Avotes = bonus,
Result = as.numeric(Sys.time())
)


opbase.upload(
dat <- data.frame(
dat,
Issue = issue,
ident = "Op_en7421",  
Action = action,
name = "Great game of Turkey",  
User = wiki_username,  
subset = "Actionvote",  
Avotes = bonus,
act_type = "append",  
Result = as.numeric(Sys.time())
language = "eng",
)
who = wiki_username
)


oprint(dat)
opbase.upload(
dat,
ident = "Op_en7421",
name = "Great game of Turkey",
subset = "Actionvote",
act_type = "append",
language = "eng",
who = wiki_username
)


cat("The action was also voted for with your bonuses.\n")
oprint(dat, include.rownames = FALSE)


cat("The action was also voted for with your bonuses.\n")
}
}
</rcode>
</rcode>
|}
=== Vote for issues and actions ===


'''Votes
{|
|


<rcode label="Vote for an issue" embed=1 variables="
<rcode label="Vote for an issue" embed=1 variables="
name:issue|description:What is the number of issue (decision) that should be played?|type:default
name:issue|description:What is the Issueid (from 'See all actions') of the issue that should be played?|type:default
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
# This is code Op_en7421/ on page [[Great game of Turkey]]
# Paramters:
## issue: numeric (Issueid)


library(OpasnetUtils)
library(OpasnetUtils)


bonus <- 1
objects.latest("Op_en7421", code_name = "initiate")


objects.latest("Op_en7421", code_name = "initiate")
bonuses <- EvalOutput(bonuses)
bonus <- result(bonuses)[bonuses$User == wiki_username]


temp <- allquestions()[issue , ]
temp <- EvalOutput(allactions)
temp <- temp[temp$Date == as.character(Sys.Date()) & temp$Issueid == issue , ]


dat <- data.frame(
dat <- data.frame(
Date = temp$Date,
Date = temp$Date[1],
Issue = temp$Issue,
Issue = temp$Issue[1],
User = wiki_username,  
User = wiki_username,  
Ivotes = bonus,
Ivotes = bonus,
Line 264: Line 446:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your issue vote was successfully saved.\n")
cat("Your issue vote was successfully saved.\n")
</rcode>
</rcode>
|


<rcode label="Vote for an action" embed=1 variables="
<rcode label="Vote for an action" embed=1 variables="
name:action|description:What is the number of the action you vote for?|type:default
name:action|description:What is the Actionid (from 'See all actions') of the action you vote for?|type:default
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
# This is code Op_en7421/ on page [[Great game of Turkey]]
# Parameters:
## action: numeric (Actionid)


library(OpasnetUtils)
library(OpasnetUtils)


bonus <- 1
objects.latest("Op_en7421", code_name = "initiate")


objects.latest("Op_en7421", code_name = "initiate")
bonuses <- EvalOutput(bonuses)
bonus <- result(bonuses)[bonuses$User == wiki_username]


temp <- allquestions()[action , ]
temp <- EvalOutput(allactions)
temp <- temp[temp$Date == as.character(Sys.Date()) & temp$Actionid == action , ]


dat <- data.frame(
dat <- data.frame(
Date = temp$Date,
Issue = temp$Issue[1],
Issue = temp$Issue,
Action = temp$Action[1],
Action = temp$Action,
User = wiki_username,  
User = wiki_username,  
Avotes = bonus,
Avotes = bonus,
Line 301: Line 488:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your action vote was successfully saved.\n")
cat("Your action vote was successfully saved.\n")


</rcode>
</rcode>
|}


== Question ==
=== Evaluate happiness and values ===
 
What is a good game to crowdsource citizen priorities about daily political decisions in such a way that
* it can be done using a mobile app,
* it characterises happiness of citizen groups of the decisions,
* it characterises progress of important societal values,
* it enables crowdsourcing the actual questions and options asked?
 
== Answer ==
 
:''See the top of the page for the main questionnaire of the game. Here we present results from the game.
 
<rcode embed=1 graphics=1>
#This is code Op_en7421/ on page [[Great game of Turkey]]
 
library(OpasnetUtils)
library(ggplot2)
 
objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en6007", code_name = "answer") # oggplot etc
 
BS <- 24
 
happindex <- EvalOutput(happindex)
oggplot(happindex, x = "Date", fill = "Group") + facet_wrap(~ User) + labs(title = "Happiness per day") +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) # Turn text and adjust to right
 
happmean <- oapply(happindex, cols = c("Date", "Question", "Option"), FUN = mean)
happequity <- oapply(happmean, cols = "Group", FUN = sd)
 
oggplot(mergeusers(happmean), x = "User", fill = "Group") + labs(title = "Mean happiness during the whole period")
oggplot(mergeusers(happequity), x = "User") + labs(title = "Deviation from the equity")
 
progindex <- EvalOutput(progindex)
oggplot(progindex, x = "Date", fill = "Issue") + facet_wrap(~ User)+ labs(title = "Progress per day") +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) # Turn text and adjust to right
 
progmean <- oapply(progindex, cols = c("Date", "Question", "Option"), FUN = mean)
progequity <- oapply(progmean, cols = "Issue", FUN = sd)
 
oggplot(mergeusers(progmean), x = "User", fill = "Issue") + labs(title = "Mean progress over time")
oggplot(mergeusers(progequity), x = "User") + labs(title = "Deviation from the policy balance")
 
</rcode>
 
== Rationale ==
 
<t2b name="Choices" index="Description" obs="Option" unit="-">
</t2b>
 
=== Calculations ===


{|
|
<rcode name="happiness" label="Save your happiness score" embed=1 variables="
<rcode name="happiness" label="Save your happiness score" embed=1 variables="
name:date|description:Give the date of the action you want to score|type:date|
name:action|description:What is the Actionid (from 'See all actions') of the action you want to score?|type:default|
name:action|description:Give the number of action you want to score (from code 'See actions')|type:number|
name:hscore|description:How much happiness would this option bring to this group?|type:selection|options:
name:hscore|description:How much happiness would this option bring to this group?|type:selection|options:
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
">
">
# This is code Op_en7421/happiness on page [[Great game of Turkey]]
# This is code Op_en7421/happiness on page [[Great game of Turkey]]
# Parameters:
## action: numeric (Actionid)
## hscore: numeric (integer from -2 to 2)


library(OpasnetUtils)
library(OpasnetUtils)
Line 371: Line 513:
objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en7421", code_name = "initiate")


ques <- question()
temp <- EvalOutput(allactions)
 
temp <- temp[temp$Actionid == action , ]
cat(as.character(ques$Question[1]), "\n")
cat(as.character(temp$Issue), ":", as.character(temp$Action), "\n")
 
oprint(ques["Option"])


user <- EvalOutput(user)
user <- EvalOutput(user)
user <- user[user@output$User == wiki_username , ]
user1 <- user[user@output$User == wiki_username , ]


dat <- data.frame(
dat <- data.frame(
Date = ques$Date,
Issue = temp$Issue[1],
Issue = ques$Issue,
Action = temp$Action[1],
Action = ques$Action,
Group = user1$Group[1],
Group = user$Group,
User = user1$User[1],  
User = user$User,  
Hscore = hscore, # Happiness score
Hscore = hscore, # Happiness score
Result = as.numeric(Sys.time())
Result = as.numeric(Sys.time())
Line 395: Line 534:
name = "Great game of Turkey",  
name = "Great game of Turkey",  
subset = "Happiness",  
subset = "Happiness",  
act_type = "replace",  
act_type = "append",  
language = "eng",  
language = "eng",  
who = wiki_username
who = wiki_username
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)
cat("Your happiness score was successfully saved.\n")
cat("Your happiness score was successfully saved.\n")


</rcode>
</rcode>


<rcode name="progress" label="Save your progress score" embed=1 variables="
|
name:option|description:Select an option|type:selection|options:
 
1;Option 1;
<rcode name="value" label="Save your value score" embed=1 variables="
2;Option 2;
name:action|description:What is the Actionid (from 'See all actions') of the action you want to score?|type:default|
3;Option 3;
name:value|description:Select an objective to evaluate|type:selection|options:
4;Option 4|
name:issue|description:Select an issue|type:selection|options:
'Civil Rights';Civil Rights;
'Civil Rights';Civil Rights;
'Women´s Rights';Women´s Rights;
'Women´s Rights';Women´s Rights;
'Religion';Religion;
'Religion';Religion;
'National Values';National Values;
'National Values';National Values;
'Democracy';Democracy|
'Democracy';Democracy;
name:pscore|description:How much progress would this option bring to this issue?|type:selection|options:
'Other';Other|
name:vscore|description:How much value would this action bring?|type:selection|options:
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
">
">
# This is code Op_en7421/progress on page [[Great game of Turkey]]
# This is code Op_en7421/value on page [[Great game of Turkey]]
# Parameters:
## action: numeric (Actionid)
## value: selection (text string)
## vscore: numeric (integer from -2 to 2)


library(OpasnetUtils)
library(OpasnetUtils)
Line 426: Line 568:
objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en7421", code_name = "initiate")


ques <- question()
temp <- EvalOutput(allactions)
temp <- temp[temp$Actionid == action , ]


cat(as.character(ques$Question[1]), "\n")
cat(as.character(temp$Issue), ":", as.character(temp$Action), "\n")
 
oprint(ques["Option"])


dat <- data.frame(
dat <- data.frame(
Question = ques$Question[1],
Issue = temp$Issue[1],
Option = ques$Option[option],
Action = temp$Action[1],
Issue = issue,
Value = value,
User = wiki_username,  
User = wiki_username,  
Result = pscore # Pscore
Vscore = vscore,
Result = as.numeric(Sys.time())
)
)


if(!is.na(pscore)) {
if(!is.na(vscore)) {
opbase.upload(
opbase.upload(
dat,  
dat,  
ident = "Op_en7421",  
ident = "Op_en7421",  
name = "Great game of Turkey",  
name = "Great game of Turkey",  
subset = "Progress",  
subset = "Values",  
act_type = "append",  
act_type = "append",  
language = "eng",  
language = "eng",  
who = wiki_username
who = wiki_username
)
)
oprint(dat)
oprint(dat, include.rownames = FALSE)
cat("Your progress score was successfully saved.\n")
cat("Your progress score was successfully saved.\n")
} else {
} else {
Line 456: Line 598:
}
}
</rcode>
</rcode>
|}


<rcode label="See all questions of the day" embed=1>
== Rationale ==
# This code is Op_en7421/ on page [[Great game of Turkey]]
 
library(OpasnetUtils)


ques <- opbase.data("Op_en7421.questions")
There is no need to edit the wiki page. Everything can be written into the text slots and uploaded by pressing the respective buttons. You can also create a full day's simulated activity in tables and copy-paste those directly. There is an example file that I used for uploading today's game at the end of the page.
colnames(ques)[colnames(ques) == "Result"] <- "Option"


questions <- unique(as.character(ques$Question[ques$Date == as.character(Sys.Date())]))
=== Calculations ===
 
for(i in questions) {
  cat(as.character(ques$Description[ques$Question == i][1]), "\n\n")
  cat(as.character(ques$Obs[ques$Question == i][1]), ": ", i, "\n")
  oprint(ques[ques$Question == i , "Option", drop = FALSE])
}
 
</rcode>


<rcode label="Vote for the day's question" embed=1 variables="
<rcode embed=1 label="Append data to database (for developers only)" variables="
name:question|description:Give the number of the question you want for today.|type:text
name:subset|description:What is the database table?|type:text|
name:dat|description:Insert data as table|type:table
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
#This is code Op_n7421/ on page [[Great game of Turkey]]
# Parameters:
## subset: text (name of the Opasnet Base table)
## dat: table (automatically onverts to data.frame. Must have the structure of the database table)


library(OpasnetUtils)
library(OpasnetUtils)


ques <- opbase.data("Op_en7421.questions")
colnames(dat) <- as.matrix(dat)[1 , ]
question <- as.character(ques$Question[ques$Obs == question])
dat <- dat[2:nrow(dat) , ]
 
dat <- data.frame(
Date = as.character(Sys.Date()),
User = wiki_username,
Result = question # Question
)
 
opbase.upload(
dat,
ident = "Op_en7421",
name = "Great game of Turkey",
subset = "Question_vote",  # You MUST spell it with _
act_type = "append",
language = "eng",
who = wiki_username
)
 
oprint(dat)
oprint(dat)
cat("Your question vote was successfully saved.\n")
</rcode>
<rcode label="Vote for a question's option" embed=1 variables="
name:option|description:Give the number of the option you want for today (up to 4 options used).
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
library(OpasnetUtils)
ovote <- opbase.data("Op_en7421.questions")
ovote$Obs <- as.character(ovote$Obs)
dat <- data.frame(
  Question = ovote$Question[ovote$Obs == option],
  User = wiki_username,
  Result = ovote$Result[ovote$Obs == option] # Option
)


opbase.upload(
opbase.upload(
Line 527: Line 625:
ident = "Op_en7421",  
ident = "Op_en7421",  
name = "Great game of Turkey",  
name = "Great game of Turkey",  
subset = "Option_vote",  
subset = subset,  
act_type = "append",  
act_type = "append",  
language = "eng",  
language = "eng",  
Line 533: Line 631:
)
)


oprint(dat)
cat("Data uploaded successfully.\n")
 
cat("Your option vote was successfully saved.\n")
 
</rcode>
</rcode>


Line 545: Line 640:
library(OpasnetUtils)
library(OpasnetUtils)


issueofday <- Ovariable("issueofday",
  dependencies = data.frame(Name = "allactions"),
  formula = function (...) {
    first <- TRUE
    for (i in unique(allactions$Date)) {
      test <- allactions[allactions$Date == i, ]
      test <- test[order(-test$issuevoteResult), ][1, ]
      if (first)
        issday <- test
      else issday <- combine(issday, test)
      first <- FALSE
    }
    issday <- issday[, c("Date", "Issue")]
    first <- TRUE
    for (i in unique(allactions$Issueid)) {
      test <- allactions[allactions$Issueid == i, ]
      test <- test[order(-result(test)), ][1:min(2,nrow(test@output)), ]
      if (first)
        actday <- test
      else actday <- combine(actday, test)
      first <- FALSE
    }
    actday <- actday[!is.na(actday$Action) , ]
    out <- merge(issday, actday, all.x = TRUE)[ , c("Date", "Issue", "Action")]
    out <- merge(out, allactions)
    out@name <- "allactions"
    return(out)
  }
)


questionofday <- function(today = as.character(Sys.Date())) {
# Day is only selected afterwards. Action and issue selection based on votes is done in issueofday.
  qvote <- EvalOutput(issuevote)
allactions <- Ovariable("allactions",
  qvote <- qvote[qvote@output$Date == today , ] # Remove wrong days
  dependencies = data.frame(Name = c("issues", "issuevote", "actions", "actionvote")),
  qvote <- oapply(qvote, cols = "User", FUN = sum) # Sum votes for each issue across users
  formula = function(...) {
  qvote <- qvote[order(result(qvote)) , ][nrow(qvote@output) , ] # Choose the issue with most votes
   
  qvote@output
    issues$Issueid <- 1:length(result(issues))
  ovote <- EvalOutput(actionvote)
    iss <- oapply(issuevote, cols = "User", FUN = sum) # Sum votes for each issue across users
  out <- oapply(ovote, cols = "User", FUN = sum)
    iss <- merge(issues, iss, all.x = TRUE)
  out <- merge(out, qvote)
    iss$issuevoteResult[is.na(iss$issuevoteResult)] <- 0
  out@output
    iss <- unkeep(iss, sources = TRUE)
  out <- out[order(out$actionvoteResult) , ][(nrow(out@output)-1):(nrow(out@output)) , ] # Choose the 2 rows with most votes
    iss$User <- NULL
  out <- merge(out, EvalOutput(issues))
   
  out$User <- NULL
    actions$Actionid <- 1:length(result(actions))
  colnames(out@output)[colnames(out@output) == "Description"] <- "Issuedescription"
    act <- oapply(actionvote, cols = "User", FUN = sum)
  out <- merge(out, EvalOutput(actions))
    act <- merge(actions, act, all.x = TRUE)
  out@name <- "actions"
    act$actionvoteResult[is.na(act$actionvoteResult)] <- 0
    act <- unkeep(act, sources = TRUE)
    act$User <- NULL
    out <- merge(iss, act, all.x = TRUE)
    out@name <- "actionvote"
    return(out)
  }
)


  return(out)
}


allquestions <- function(today = as.character(Sys.Date())) {
# Columns that determine unique rows in tables
  iss <- EvalOutput(issues)
# Issues: Date,Issue # Could also be Date,User but let's allow people suggest more than one but vote only one.
  iss <- iss[iss@output$Date == today , ]
# Actions: Issue,Action # Could also be Issue,User but same as above.
  colnames(iss@output)[colnames(iss@output) == "Description"] <- "IssueDescription"
# Issuevote: Date,User
  iss$Result <- NULL
# Actionvote: Issue,User
  iss$User <- NULL
# Happiness: Action,User
 
# Values: Action,Value,User
  acti <- EvalOutput(actions)
# User: User
  acti$Result <- NULL
# Bonuses: User,Reason
  acti$User <- NULL
# Decisions: Date,User
  issact <- merge(iss, acti, by = c("Date", "Issue"))
 
  return(issact)
# Tables in which a column determines unique rows
}
# Date: always
# Issue: Yes Issues, Actions, Actionvote; No Issuevote, Happiness, Values, Decisions
# Action: Yes Actions, Values, Happiness; No Actionvote, Decisions
# User: always but Issues, Actions
# Value: Always
# Reason: always


uniques <- function(subset) {
uniques <- function(subs) {
   #Create a temporary ovariable temp and fetch the respective table with ddata.
   #Create a temporary ovariable temp and fetch the respective table with ddata.
   #indices that are used to find unique rows:  
   #indices that are used to find unique rows:  
   uncolumns <- c("Date", "Issue", "Action", "User", "Value", "Group", "Reason")
   uncolumns <- c("Date", "Issue", "Action", "User", "Value", "Reason")
   #However, take away the index that is being added:
   #However, take away indices as listed above.
  #Issue (for Issuevote and Issues); Action (for Actionvote and Actions). None for other tables.
   addindex <- NULL
   addindex <- NULL
   if(subset %in% c("Issues", "Issuevote")) addindex <- "Issue"
   if(subs %in% c("Issuevote", "Happiness", "Values", "Decisions")) addindex <- c(addindex, "Issue")
   if(subset %in% c("Actions", "Actionvote")) addindex <- "Action"
   if(subs %in% c("Actionvote", "Decisions")) addindex <- c(addindex, "Action")
   uncolumns <- uncolumns[!uncolumns %in% addindex]
  if(subs %in% c("Issues", "Actions")) addindex <- c(addindex, "User")
   uncol <- uncolumns[!uncolumns %in% addindex]
   #indices that are transformed to Result:  
   #indices that are transformed to Result:  
   rescolumns <- c("Ivotes", "Avotes", "Bonus", "Vscore", "Hscore")
   rescolumns <- c("Ivotes", "Avotes", "Bonus", "Vscore", "Hscore")
 
 
   dat <- opbase.data("Op_en7421", subset = subset)
   dat <- opbase.data("Op_en7421", subset = subs)
   temp <- aggregate(dat["Result"], by = dat[colnames(dat) %in% uncolumns], FUN = max)  
  for(i in colnames(dat)[colnames(dat) %in% uncolumns]) dat <- dat[!is.na(dat[[i]]) & dat[[i]] != "NA" , ]
   out <- merge(dat, temp)
   temp <- aggregate(dat["Result"], by = dat[colnames(dat) %in% uncol], FUN = max)  
   out <- merge(dat, temp["Result"])
   out$Result <- NULL
   out$Result <- NULL
   colnames(out)[colnames(out) %in% rescolumns] <- "Result"
   colnames(out)[colnames(out) %in% rescolumns] <- "Result"
Line 603: Line 738:
}
}


# dummy is needed to get correct marginals in downstream ovariables.
dummy <- Ovariable("dummy",  
dummy <- Ovariable("dummy",  
   data = data.frame(Date=1, Issue=1, Action=1, User=1, Value=1, Group=1, Reason=1, Result=1)
   data = data.frame(Date=1, Issue=1, Action=1, User=1, Value=1, Group=1, Reason=1, Result=1)
Line 659: Line 795:
   dependencies = data.frame(Name = c("dummy")),
   dependencies = data.frame(Name = c("dummy")),
   formula = function(...) {
   formula = function(...) {
     return(uniques("Bonuses"))
     dat <- opbase.data("Op_en7421", subset = "Bonuses")
    dat$Bonus <- as.numeric(as.character(dat$Bonus))
    dat <- aggregate(dat["Bonus"], by = dat["User"], FUN = sum)
    colnames(dat)[colnames(dat) == "Bonus"] <- "Result"
    return(dat)
   }
   }
)
)
Line 672: Line 812:
mergeusers <- function(happ) {
mergeusers <- function(happ) {
   if(length(happ$User) != length(happ$User[happ$User == wiki_username])) {
   if(length(happ$User) != length(happ$User[happ$User == wiki_username])) {
     test1 <- happ[happ$User == wiki_username , ]
     happ$Decisionmaker <- ifelse(happ$User == wiki_username, "You", "Crowd")
    test1$User <- "You"
    test2 <- happ
    test2$User <- "Crowd"
    happ <- combine(test1, test2)
   }
   }
   return(happ)
   return(happ)
}
}


happindex <- Ovariable("happindex",  
deci <- Ovariable("deci",
   dependencies = data.frame(Name = c(
   dependencies = data.frame(Name = "decisions"),
    "happiness",
    "decisions",
    "issues"
    )),
   formula = function(...) {
   formula = function(...) {
 
    deci <- mergeusers(decisions)
     happindex <- oapply(happiness, cols = "User", FUN = mean)
     deci <- oapply(deci, cols = "User", FUN = length)
     happindex <- mergeusers(decisions) * happiness * issues
     for(i in unique(paste(deci$Date, deci$Issue))) {
     return(happindex)
      test <- deci[paste(deci$Date, deci$Issue) == i , ]
      test <- test[order(-test$decisionsResult) , ][1 , ] # Choose the 1 row with most decisions
      if(exists("out365")) out365 <- combine(out365, test) else out365 <- test
    }
     return(out365)
   }
   }
)
)


valueindex <- Ovariable("valueindex",  
happindex <- Ovariable("happindex",  
dependencies = data.frame(Name = c(
  dependencies = data.frame(Name = c(
  "values",
    "happiness",
  "decisions",
    "deci",
  "issues"
    "actions"
)),
  )),
formula = function(...) {
  formula = function(...) {
    actions$User <- NULL
    happindex <- oapply(happiness, cols = "User", FUN = mean)
    happindex <- deci * happindex * actions
    return(happindex)
  }
)


  valueindex <- oapply(values, cols = "User", FUN = mean)
valindex <- Ovariable("valindex",
  valueindex <- mergeusers(decisions) * valueindex * issues
  dependencies = data.frame(Name = c(
  return(valueindex)
    "values",
}
    "deci",
    "actions"
  )),
  formula = function(...) {
    actions$Result <- NULL
    valindex <- oapply(values, cols = "User", FUN = mean)
    valindex <- deci * valindex * actions
    return(valindex)
  }
)
)


rm(wiki_username)
objects.store(list = ls())
objects.store(list = ls())
cat("Objects", ls(), "stored successfully.\n")
cat("Objects", ls(), "stored successfully.\n")
Line 771: Line 922:


{{assessment|moderator=Jouni|ongoing=Yes}}
{{assessment|moderator=Jouni|ongoing=Yes}}
* [[Govlab]]


== Keywords ==
== Keywords ==
Line 779: Line 931:


== Related files ==
== Related files ==
{{#l:Great game of Turkey seed data.ods}} Example data to be copied in for a new day.

Latest revision as of 21:44, 4 March 2016


Make today's decision First, see the issue and possible actions.

+ Show code

Then, make the decision about today's issue.

Check above the issue of the day and decide which option you would choose.:

+ Show code

Question

What is a good game to crowdsource citizen priorities about daily political decisions in such a way that

  • it can be done using a mobile app,
  • it characterises happiness of citizen groups of the decisions,
  • it characterises progress of important societal values,
  • it enables crowdsourcing the actual issues and actions asked?

Answer

How to play

In this game you get to be the president of Turkey, having to daily make decisions about big and small things. Once a day you choose between two options according to what you would decide about a certain issue. The issue changes daily. Making a decision will cause a change in happiness (see "Happiness") of different population groups and societally important values (see "Values"). Each player will be scored as a decisionmaker based on how they are able to promote happiness and societal values. Players see their own score over time, accompanied by the score of the crowd. The point of the game is to make decisions so that you increase the happiness of different groups as much as possible while also helping to promote important objectives.

Getting started

Before beginning to play, you might consider creating a wiki account, but this is not mandatory. You can do this by clicking "Sign in/Create account" on the top right corner of the page. When you are signed in, you are able to participate in discussions on the possible actions for different issues (See "Suggesting and voting for issues for the issues"). If you do not create an account and play signed in, the IP address for your computer will be used to identify you in the game to keep your score.
Whether you create yourself a wiki account or not, before you can begin to play, you have to setup your profile. This means choosing which social group you most identify with. There are six groups to choose from: nationalists, liberals, conservatives, minorities, kemalists and other. You can do this in the answer-section, under "Setup profile". You can only belong to one group. You may also change your preferences later. In the beginning you are given 1 bonus to start the game with.

Making today's decision

Making decisions every day about the issue of the day is the basic thing to do in the game. By making a decision about the daily issue, you earn 0.1 bonus. To make a decision about the daily issue, first click "See the issue of the day" on the top of the page to see what the decision is about today and what the options are. After you have read the issue and the options, you can make the decision between the first and second options by choosing the correct one from the drop-down menu below this. Remember to also click on "Choose policy". These decisions will affect how happy you are able to keep the different groups of people (see "Happiness") and how well you are able to promote the different social objectives (see "Values").

Suggesting and voting for issues of the day

You can also affect what the issues voted on will be. Under "Suggest issues and actions" you can submit your own suggestion for an issue for any specific day in the future. You can only suggest one issue for a specific day. If you suggest a new issue for that day, only your newest suggestion will appear in the list. You can also vote for the issue of the day from among the issues already suggested. The suggestion that is ranked highest will become the issue of the day, and the player who suggested it gains 5 bonuses. An issue can be suggested again for a later time point (for example, if it is not played on the first day suggested).
To vote for an issue first see the issues suggested under "See all suggested issues and actions". You can check the issues suggested for any particular day, or all issues suggested for all days. To vote check the Issueid of the issue you want to vote for and type it into "What is the Issueid (from 'See all actions') of the issue that should be played?" under "Vote for issues and actions". You can only vote for issues on the day they have been suggested for, and only vote for one issue per day. The amount of bonuses you have gathered in the game tells the weight of your vote. If, for example, you have 3 bonuses, your vote equals the votes of three players who all have 1 bonus.

Suggesting and voting for actions for the issues

In the same way as you can suggest and vote for issues of the day, you can also suggest and vote for the action options for any of the issues. The two actions ranked highest will become the options for a certain issue, and the players who suggested them will gain 1 bonus. You can suggest actions for an issue as soon as the issue has been suggested, and the actions can be voted for as soon as they are in the system. The purpose of this is to promote discussion about actions and hence critical evaluation which actions should be upvoted to be played. To participate in the discussion, you need to have a wiki account (see "Getting started" above). You can find the discussions on the "Discussion" tab of this page. You can only vote for one action per issue, and like with voting for issues, the bonuses you have add to the weight of your vote. If an issue is suggested again for a later time point than the original suggestion was, previous related actions and their votes apply.

Happiness

You can also take part in evaluating how much happiness or unhappiness the different actions bring to the social group you belong in, practically meaning how satisfied the people of the group would be if the action was the one chosen. You can do this under "Evaluate happiness and values". Type in the Actionid (you can see this under "See all suggested issues and actions"), and choose from the drop-down menu the happiness score that best describe the amount of happiness the action would bring to your group. You can do this only once per action. Negative scores mean it would decrease happiness within the group. Evaluation of happiness related to an action is possible as soon as the action has been suggested.
The evaluations of all players are then brought together and are used to determine how much a player is able to increase happiness when making the daily decisions. This, you may remember, is the point of the game.

Values

Aside from happiness, you can also evaluate how much value different actions bring to different objectives. There are five objectives: Civil rights, woman's rights, religion, national values and democracy. Under "Evaluate happiness and values" you can tell how much value different actions bring to different objectives. Value practically means the improving of the conditions having to do with an objective. Type in the Actionid and then choose the objective you want to evaluate and the value the action would bring to it from the drop-down menus. The evaluation of values related to actions is possible as soon as the actions are suggested. You can only evaluate the value once per action and objective.
The value of each action given to the objective is summarised from all layers the same way as the happiness scores and are used to determine how much it promotes the different social objectives. Making decisions that make things better in respect to these objectives is also the point of the game.

Overview of the decisions

In time, you will make a lot of decisions. You can see and overview of these decisions under "Game results" by clicking "Run code". It shows you a graph of a cumulative timeline so that every day your decision will take you up or down in the eyes of different groups (see "Happiness" above) or different objectives (see "Values" above), compared with the majority vote. This gives you an idea of what kind of decisions you have on average made and how you have answered compared to other players. You should try to get the happiness scores of different groups as well as the objectives as high as possible.

Game results

See the top of the page for the main questionnaire of the game. Here we present results from the game.

+ Show code

Setup profile

Setup your profile. Do this before you start. You may change your preferences later.

Into which group do you identify most? (You only need to choose once):

+ Show code

See all suggested issues and actions

Issues and actions for which day?:
..

Do you want to see a single day or all?:

+ Show code

Suggest issues and actions

What is the issue (decision) that should be played? (briefly):

Give a more detailed description.:

When should this issue be played?:
..

+ Show code

What is the Issueid (from 'See all actions') of an issue?:

What is the action you suggest to this issue? (briefly):

Give a more detailed description.:

+ Show code

Vote for issues and actions

What is the Issueid (from 'See all actions') of the issue that should be played?:

+ Show code

What is the Actionid (from 'See all actions') of the action you vote for?:

+ Show code

Evaluate happiness and values

What is the Actionid (from 'See all actions') of the action you want to score?:

How much happiness would this option bring to this group?:

+ Show code

What is the Actionid (from 'See all actions') of the action you want to score?:

Select an objective to evaluate:

How much value would this action bring?:

+ Show code

Rationale

There is no need to edit the wiki page. Everything can be written into the text slots and uploaded by pressing the respective buttons. You can also create a full day's simulated activity in tables and copy-paste those directly. There is an example file that I used for uploading today's game at the end of the page.

Calculations

What is the database table?:

Insert data as table:

Cancel

+ Show code


+ Show code

Structure and functionalities

Data structure of the great game. Each blue box is a data table. Arrows show the information flows. Happiness and value performances are calculated based on decisions and scores estimated by the players (or researchers?). Upload data and select newest are generic functions needed to operate with the data.

The content of and use of the data tables is the following:

  • Issues: List of decisions to be made. A user can suggest only one issue per day. For each day, the most popular issue is taken to the game.
  • Actions: List of decision options to be made. A user can suggest only one action per issue. For each time point, two most popular actions are taken to the game. However, the actions in the game may change during the day, if the rank of the issues changes.
  • Issue vote: List of votes for each issue. Each user can cast a single vote either for or against an issue. The number of votes a user has equals their bonuses.
  • Action vote: List of votes for each action under issues. The voting system is the same as for issues.
  • Decisions: List of decisions each user makes from the actions and issues on the game.
  • Bonuses: List of bonuses the users have earned during the game. In the beginning, each user has 1 bonus. You can earn bonuses if your actions suggestions gets to be played (+1) or if your issues gets to be played (+5). Every time a user makes a decision, they get +0.1 bonus.
  • Happiness: Users' opinions about how much happiness an action brings to their own group.
  • Values: Users' opinions about how much value an action brings to a selected group.
  • Users: List of users' groups (i.e. to which group each user identifies themselves).

The functions needed are the following.

  • Upload data: Take the data provided by the user or calculated. Add automatic fields, e.g. ts, user and date. Upload data to the respective table.
  • Create ovariable: Download data from a table. From the data, find the unique rows with a given condition (e.g. discard previous decisions made by a user previously on the same day). Then create an ovariable with the structure needed.
  • Firstuser: Check's whether user's wiki_username is found from Bonuses. If not, it is added there and 1 bonus given.

The interface codes used are the following:

  • Suggest issues: Ask date, issue and description from user. Date means the date when this issue will be played. Default is today, but user can change that and suggest future issues. Timestamp (ts) come automatically. User is the wiki_username. Upload data to Issues table. No need to check previous entries. Upload user's bonus to Issue vote as number of votes.
  • Show issues: Ask date (today by default) and show all issues and each one's actions listed from the most to least popular. This is necessary for suggesting actions.
  • Show today's issue: Ask nothing. Show today's top-ranked issue and its two top-ranked actions. [Calculate the sum of results over all users. Show these popularity sums as the result of object popularity? Select the most popular row among a group defined by an index; use oapply to integrate over the index using which.max and pick that row only. Should this be a function or ovariable?]
  • Suggest actions: Ask date, issue, action and description from user. Date is today by default. Ts and user come as previously. If the date-issue pair does not exist in Issues table, give error message. Upload data to Actions and user's bonus to Action vote.
  • Vote for issue: Ask the rank number of the issue as a number. The user can check the numbers with Show issues. Date, user, and ts come automatically. Do firstuser. Votes is the number of user's bonuses and comes from Bonuses. Upload data to Issue vote. Store information about the rank before voting somewhere (as an ovariable or a technical data table?). If the information has changed from the last time, give bonus to the user whose information is now on the top.
  • Vote for action: Similar to vote for issue, except that the action number is asked and data is uploaded to Action vote.
  • Make decision: Ask the action from the two top choices of the most popular issue using a drop-down list. The options can be seen with show today's issue. Upload data to Decisions. However, if an issue was the most popular at some point during the day, it is still kept in the issue list. ----#: . Is it? How? --Jouni (talk) 17:21, 7 February 2016 (UTC) (type: truth; paradigms: science: comment)
  • Evaluate happiness: Ask date (today is the default), action number from show issues for that date, and hscore for happiness score in the user's own group. Ts, user as previously. Check if user has a group in Users and if not, give an error message to sign up to a group first. Upload data to Happiness.
  • Evaluate values: As evaluate happiness, except that unlike group, the value is asked from the user and nothing is checked. Upload data to Values.
  • Manage profile: Ask the group to which user identifies themselves. Take user and ts as previously. Add data to Users.
  • Show results: This code is divided into several parts:
    • Show happiness performance: Ask nothing. From Decisions, take the action of each day; do this separately for You, the user's own decisions, and Crowd, i.e. the most popular action of each day. Combine that with the happiness scores from Happiness. Show cumulative happiness across time for both decision makers.
    • Show value performance: Similar to show happiness performance, but for values from Values. It is imprtant to notice that value scores for each action are only partly a matter of opinion and partly a matter of research. Therefore, ideas should be developed how this research is gathered and used.
    • Show situation': Show the situation of the current issue: the issue and description, and the two actions and their votes.
    • Show all issues: Show all issues and actions and their votes for today.


Important categories
Groups for Turkey Value categories
  • Nationalists
  • Conservatives
  • Minorities
  • Liberals
  • Kemalists
  • Civil Rights
  • Women's Rights
  • Religion
  • National Values
  • Democracy

See also


Keywords

References


Related files

Great game of Turkey seed data Example data to be copied in for a new day.