Great game of Turkey: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(more code)
 
(20 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


question <- function() {
temp <- EvalOutput(issueofday)
  if(!exists("today")) today <- as.character(Sys.Date())
temp <- temp[temp$Date == as.character(Sys.Date()) , ]
  ques <- opbase.data("Op_en7421.questions")
 
 
if(nrow(temp@output) == 0) {
  qvote <- opbase.data("Op_en7421.question_vote")
cat("Issues have not yet been suggested for today.\n")
  colnames(qvote)[colnames(qvote) == "Result"] <- "Question"
} else {
  qvote <- unique(qvote[qvote$Date == today , ]) # Remove double votes
cat(
  qvote <- aggregate(qvote["User"], by = qvote["Question"], FUN = length)
  "Issue #",
  qvote <- qvote[order(qvote$User, decreasing = TRUE) , ][1,] # Choose the row with most votes
  temp$Issueid[1],
 
  ":",
  temp <- merge(ques, qvote)[1 , c("Question", "Description")]
  as.character(temp$Issue[1]),
  "\n",  
  as.character(temp$Issuedescription[1]),  
  "(", as.character(temp$issuevoteResult)[1],
  "votes).\n"
)
 


  # Find the most popular options
colnames(temp@output)[colnames(temp@output) == "issueofdayResult"] <- "Votes"
 
oprint(temp[ , c("Action", "Actiondescription", "Actionid", "Votes")], include.rownames = FALSE)  
  ovote <- opbase.data("Op_en7421.option_vote")
  colnames(ovote)[colnames(ovote) == "Result"] <- "Option"
  ovote <- ovote[nrow(ovote):1 , ] #Turn newest first
  #ovote <- ovote[!duplicated(ovote[c("Date", "User") , ]) , ] # Only keep the last vote
  out <- merge(temp, ovote)
  out <- aggregate(out["User"], by = out[c("Question", "Description", "Option")], FUN = length)
  out <- out[order(out$User, decreasing = TRUE) , ][1:4,] # Choose the 4 rows with most votes
  out <- out[!is.na(out$User) , ]
  out$User <- NULL
 
  return(out)
}
}
</rcode>


Then, make the decision about today's issue.


issues <- Ovariable("issues",
<rcode name="choices" label="Choose policy" embed=1 variables="
dependencies = data.frame(Name = "happiness"),
name:option|description:Check above the issue of the day and decide which option you would choose.|type:selection|options:
formula = function(...) {
1;First option;
  dat <- opbase.data("Op_en7421.issues")
2;Second option
#   colnames(dat)[colnames(dat) == "Result"] <- "Option"
">
#   dat$Obs <- NULL
# This is code Op_en7421/choices on page [[Great game of Turkey]]
#   dat$Result <- 1
# Parameters used:
  return(dat)
## option: numeric (1 or 2)
}
)


#ques <- question()
library(OpasnetUtils)
#ques <- EvalOutput(issues)


oprint(issuelist())
objects.latest("Op_en7421", code_name = "initiate")


#cat(as.character(ques$Description[1]), "\n")
temp <- EvalOutput(issueofday)
#cat(as.character(ques$Question[1]), "\n")
temp <- temp[temp$Date == as.character(Sys.Date()) , ]


#oprint(ques["Option"])
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>
</rcode>


<rcode name="choices" label="Choose policy" embed=1 variables="
== Question ==
name:option|description:Check above the question of the day and decide which option you would choose.|type:selection|options:
 
1;Option 1;
What is a good game to crowdsource citizen priorities about daily political decisions in such a way that
2;Option 2;
* it can be done using a mobile app,
3;Option 3;
* it characterises happiness of citizen groups of the decisions,
4;Option 4
* it characterises progress of important societal values,
">
* it enables crowdsourcing the actual issues and actions asked?
# This is code Op_en7421/choices on page [[Great game of Turkey]]
 
== 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(OpasnetUtils)
library(ggplot2)


objects.latest("Op_en7421", code_name = "initiate")
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


ques <- question()
happmean <- oapply(happindex, cols = c("Date", "Issue", "Action"), FUN = mean)
happequity <- oapply(happmean, cols = "Group", FUN = sd)


dat <- data.frame(
oggplot(mergeusers(happmean), x = "Decisionmaker", fill = "Group") + labs(title = "Mean happiness during the whole period")
Question = ques$Question[1],
oggplot(mergeusers(happequity), x = "Decisionmaker") + labs(title = "Deviation from the equity")
User = wiki_username,  
 
Result = ques$Option[option] # Option
valmean <- oapply(valindex, cols = c("Date", "Issue", "Action"), FUN = mean)
)
valequity <- oapply(valmean, cols = "Issue", FUN = sd)


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 = "Choices",  
act_type = "append",
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 109: 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 128: Line 191:
)
)


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


cat("Your group was successfully saved.\n")
cat("Your group was successfully saved.\n")
Line 151: 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 157: 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 186: Line 301:
)
)


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


cat("Your issue was successfully saved.\n")
cat("Your issue was successfully saved.\n")
Line 208: 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 <- issuelist()[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 310: 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 <- issuelist()[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 347: 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:option|description:Select an option|type:selection|options:
name:action|description:What is the Actionid (from 'See all actions') of the action you want to score?|type:default|
1;Option 1;
2;Option 2;
3;Option 3;
4;Option 4|
name:group|description:Select a group|type:selection|options:
'Nationalists';Nationalists;
'Conservatives';Conservatives;
'Minorities';Minorities;
'Liberals';Liberals;
'Kemalists';Kemalists|
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 426: 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)
user1 <- user[user@output$User == wiki_username , ]


dat <- data.frame(
dat <- data.frame(
Question = ques$Question[1],
Issue = temp$Issue[1],
Option = ques$Option[option],
Action = temp$Action[1],
Group = group,
Group = user1$Group[1],
User = wiki_username,  
User = user1$User[1],  
Result = hscore # Hscore
Hscore = hscore, # Happiness score
Result = as.numeric(Sys.time())
)
)


Line 450: Line 539:
)
)


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 476: 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")


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


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 506: 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) , ]
 
oprint(dat)
dat <- data.frame(
Date = as.character(Sys.Date()),
User = wiki_username,
Result = question # Question
)


opbase.upload(
opbase.upload(
Line 545: Line 625:
ident = "Op_en7421",  
ident = "Op_en7421",  
name = "Great game of Turkey",  
name = "Great game of Turkey",  
subset = "Question_vote", # You MUST spell it with _
subset = subset,  
act_type = "append",  
act_type = "append",  
language = "eng",  
language = "eng",  
Line 551: Line 631:
)
)


oprint(dat)
cat("Data uploaded successfully.\n")
</rcode>


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


</rcode>
<rcode name="initiate" label="Initiate objects (for developers only)" embed=1>
 
# This is code Op_en7421/initiate on page [[Great game of Turkey]]
<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)
library(OpasnetUtils)


ovote <- opbase.data("Op_en7421.questions")
issueofday <- Ovariable("issueofday",
ovote$Obs <- as.character(ovote$Obs)
  dependencies = data.frame(Name = "allactions"),
 
  formula = function (...) {
dat <- data.frame(
    first <- TRUE
  Question = ovote$Question[ovote$Obs == option],
    for (i in unique(allactions$Date)) {
  User = wiki_username,  
      test <- allactions[allactions$Date == i, ]
  Result = ovote$Result[ovote$Obs == option] # Option
      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)
  }
)
)


opbase.upload(
# Day is only selected afterwards. Action and issue selection based on votes is done in issueofday.
dat,  
allactions <- Ovariable("allactions",
ident = "Op_en7421",  
  dependencies = data.frame(Name = c("issues", "issuevote", "actions", "actionvote")),
name = "Great game of Turkey",  
  formula = function(...) {
subset = "Option_vote",  
   
act_type = "append",  
    issues$Issueid <- 1:length(result(issues))
language = "eng",
    iss <- oapply(issuevote, cols = "User", FUN = sum) # Sum votes for each issue across users
who = wiki_username
    iss <- merge(issues, iss, all.x = TRUE)
    iss$issuevoteResult[is.na(iss$issuevoteResult)] <- 0
    iss <- unkeep(iss, sources = TRUE)
    iss$User <- NULL
   
    actions$Actionid <- 1:length(result(actions))
    act <- oapply(actionvote, cols = "User", FUN = sum)
    act <- merge(actions, act, all.x = TRUE)
    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)
  }
)
)


oprint(dat)
cat("Your option vote was successfully saved.\n")
</rcode>
<rcode name="initiate" label="Initiate objects (for developers only)" embed=1>
# This is code Op_en7421/initiate on page [[Great game of Turkey]]


library(OpasnetUtils)
# Columns that determine unique rows in tables
# Issues: Date,Issue # Could also be Date,User but let's allow people suggest more than one but vote only one.
# Actions: Issue,Action # Could also be Issue,User but same as above.
# Issuevote: Date,User
# Actionvote: Issue,User
# Happiness: Action,User
# Values: Action,Value,User
# User: User
# Bonuses: User,Reason
# Decisions: Date,User


issuelist <- function() {
# Tables in which a column determines unique rows
  iss <- opbase.data("Op_en7421", subset = "Issues")
# Date: always
  iss <- iss[iss$Date == as.character(Sys.Date()) , ]
# Issue: Yes Issues, Actions, Actionvote; No Issuevote, Happiness, Values, Decisions
  colnames(iss)[colnames(iss) == "Description"] <- "IssueDescription"
# Action: Yes Actions, Values, Happiness; No Actionvote, Decisions
  iss$Result <- NULL
# User: always but Issues, Actions
  iss$User <- NULL
# Value: Always
 
# Reason: always
  acti <- opbase.data("Op_en7421", subset = "Actions")
  acti$Result <- NULL
  acti$User <- NULL
  issact <- merge(iss, acti, by = c("Date", "Issue"))
  return(issact)
}


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"
   if(!"Result" %in% colnames(out)) out$Result <- 1
   if(!"Result" %in% colnames(out)) out$Result <- 1
  out$Result <- as.numeric(as.character(out$Result))
   return(out)  
   return(out)  
}
}
#uniques("Happiness")


# 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 678: Line 785:
)
)


happpiness <- Ovariable("happiness",  
happiness <- Ovariable("happiness",  
   dependencies = data.frame(Name = c("dummy")),
   dependencies = data.frame(Name = c("dummy")),
   formula = function(...) {
   formula = function(...) {
Line 688: 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 701: 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(paste("Objects", ls(), "stored successfully.\n", sep = " ")
cat("Objects", ls(), "stored successfully.\n")
</rcode>
</rcode>


Line 800: Line 922:


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


== Keywords ==
== Keywords ==
Line 808: 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.