Great game of Turkey: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(allquestions made to ovariable)
(→‎Rationale: issueofday and allactions work now)
Line 355: Line 355:


<t2b name="Choices" index="Description" obs="Option" unit="-">
<t2b name="Choices" index="Description" obs="Option" unit="-">
|
</t2b>
</t2b>


Line 537: Line 538:
cat("Your option vote was successfully saved.\n")
cat("Your option vote was successfully saved.\n")


</rcode>
<rcode embed=1 label="Append data to database (for developers only)" variables="
name:subset|description:What is the database table?|type:text|
name:dat|description:Insert data as table|type:table
">
library(OpasnetUtils)
colnames(dat) <- t(dat)[ , 1]
dat <- dat[2:nrow(dat) , ]
oprint(dat)
opbase.upload(
dat,
ident = "Op_en7421",
name = "Great game of Turkey",
subset = subset,
act_type = "append",
language = "eng",
who = wiki_username
)
cat("Data uploaded successfully.\n")
</rcode>
</rcode>


Line 545: Line 570:
library(OpasnetUtils)
library(OpasnetUtils)


issueofday <- Ovariable("issueofday",
  dependencies = data.frame(Name = "allactions"),
  formula = function(...) {


questionofday <- function(today = as.character(Sys.Date())) {
    for(i in unique(allactions$Date)) {
  qvote <- EvalOutput(issuevote)
      test <- allactions[allactions$Date == i , ]
  qvote <- qvote[qvote@output$Date == today , ] # Remove wrong days
      test <- test[order(-test$issuevoteResult) , ][1 , ] # Choose the 1 row with most votes
  qvote <- oapply(qvote, cols = "User", FUN = sum) # Sum votes for each issue across users
      if(exists("issday")) issday <- combine(issday, test) else issday <- test
  qvote <- qvote[order(result(qvote)) , ][nrow(qvote@output) , ] # Choose the issue with most votes
    }
  qvote@output
  ovote <- EvalOutput(actionvote)
  out <- oapply(ovote, cols = "User", FUN = sum)
  out <- merge(out, qvote)
  out@output
  out <- out[order(out$actionvoteResult) , ][(nrow(out@output)-1):(nrow(out@output)) , ] # Choose the 2 rows with most votes
  out <- merge(out, EvalOutput(issues))
  out$User <- NULL
  colnames(out@output)[colnames(out@output) == "Description"] <- "Issuedescription"
  out <- merge(out, EvalOutput(actions))
  out@name <- "actions"


  return(out)
    for(i in unique(allactions$Issueid)) {
}
      test <- allactions[allactions$Issueid == i , ]
      test <- test[order(-result(test)) , ][1:2 , ] # Action votes are the result column of allactions
      if(exists("actday")) actday <- combine(actday, test) else actday <- test
    }
    return(merge(issday, actday))
  }
)


# Day is only selected afterwards. Action and issue selection based on votes is done in questionofday.
# Day is only selected afterwards. Action and issue selection based on votes is done in issueofday.
allquestions <- Ovariable("allquestions",
allactions <- Ovariable("allactions",
   dependencies = data.frame(Name = c("issues", "issuevote", "actions", "actionvote")),
   dependencies = data.frame(Name = c("issues", "issuevote", "actions", "actionvote")),
   formula = function(...) {
   formula = function(...) {
 
      
     qvote <- oapply(issuevote, cols = "User", FUN = sum) # Sum votes for each issue across users
     issues$Issueid <- 1:length(result(issues))
     issues$Issueid <- 1:length(result(issues))
     iss <- merge(issues, qvote)
     iss <- oapply(issuevote, cols = "User", FUN = sum) # Sum votes for each issue across users
     iss@name <- "issuevote"
     iss <- merge(issues, iss)
    colnames(iss@output)[colnames(iss@output) == "Description"] <- "Issuedescription"
     iss$User <- NULL
     iss$User <- NULL
#    iss <- oapply(iss, cols = "Issueid", FUN = max) # The most popular issue of each day.
 
   
    ovote <- oapply(actionvote, cols = "User", FUN = sum)
     actions$Actionid <- 1:length(result(actions))
     actions$Actionid <- 1:length(result(actions))
     out <- merge(actions, ovote)
     act <- oapply(actionvote, cols = "User", FUN = sum)
    out@name <- "actionvote"
    act <- merge(actions, act)
    out$User <- NULL
    act$User <- NULL
#    out2 <- oapply(out, cols = "Actionid", FUN = max) # Find the most popular action
     out <- merge(iss, act)
#    out <- out[!(out$Date == out2$Date & out$Issue == out2$Issue & out$Action == out2$Action) , ] # Remove the most popular action.
#    out <- oapply(out, cols = "Actionid", FUN = max) # Find the second most popular action
#    out2 <- combine(out2, out)
#    out <- out[order(out$actionvoteResult) , ][(nrow(out@output)-1):(nrow(out@output)) , ] # Choose the 2 rows with most votes
     out <- merge(out, iss)
     out@name <- "actionvote"
     out@name <- "actionvote"
     return(out)
     return(out)

Revision as of 12:07, 13 February 2016


Make today's decision

+ Show code

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

+ Show code

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

When should this issue be played?:
..

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

Give a more detailed description.:

+ Show code

What is the number of the issue (decision) to which this action relates?:

What is the action you suggest? (briefly):

Give a more detailed description.:

+ Show code

Votes

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

+ Show code

What is the number of the action you vote for?:

+ 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 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.

+ Show code

Rationale

Choices(-)
ObsDescriptionOption
1

Calculations

Give the date of the action you want to score:
..

Unknown var type

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

+ Show code

Select an option:

Select an issue:

How much progress would this option bring to this issue?:

+ Show code

+ Show code

Give the number of the question you want for today.:

+ Show code

Give the number of the option you want for today (up to 4 options used).:

+ Show code


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