示例#1
0
def snackChoice(round,p):
  player = query_dbs.findPlayerInMongo('_id',p[0])
  score = 0
#round means pre1 = 0 , post1 = 1, pre2 = 2, or post2 = 3. Therefore, round starts from 0 to 4. 
  if ((round+1)*5>len(player['snackazonItemChoices'])):
    return "empty"
  for i in player['snackazonItemChoices']:
    if i['item']['round'] > (round *5) and i['item']['round'] <= ((round+1) *5):
      #this indicates that EACH ITEM is counted separately???
      if i['item']['card_name'] in card_info.bad_cards :
        score += (-1)
      elif i['item']['card_name'] in card_info.ok_cards :
        score += 0
      elif i['item']['card_name'] in card_info.good_cards :
        score += 1
  return score
def gatherClicksFake(which, session, p):
    try:
        mongoPlayer = query_dbs.findPlayerInMongo('_id', p[0])
        filteredInfo = mongoPlayer['informationSeekingBehavior']
        i = splitInfo(filteredInfo)
    except KeyError:
        i = [[]]
    i.append([])
    i.append([])
    i.append([])

    sessionInfo = i[session]
    count = 0
    for b in sessionInfo:
        if (b['button'] == which and (b['name'] in card_info.fake_cards)):
            count = count + 1
    #I believe if below was "return (count) then the original ALL clicks would be produced"
    return min(9, count)
def gatherClicksFake(which,session,p):
  try:
    mongoPlayer = query_dbs.findPlayerInMongo('_id',p[0])
    filteredInfo = mongoPlayer['informationSeekingBehavior']
    i = splitInfo(filteredInfo)
  except KeyError:
    i = [[]]
  i.append([])
  i.append([])
  i.append([])

  sessionInfo = i[session]
  count = 0
  for b in sessionInfo:
    if (b['button']==which and (b['name'] in card_info.fake_cards)):
      count = count+1
  #I believe if below was "return (count) then the original ALL clicks would be produced"
  return min(9,count)
示例#4
0
def group(p):
    player = query_dbs.findPlayerInMongo('_id', p[0])
    return player['group']
示例#5
0
def informationSeekingBehavior(p):
    player = query_dbs.findPlayerInMongo('_id', p[0])
    try:
        return (player['informationSeekingBehavior'])
    except Exception as e:
        return "NA"
示例#6
0
def pop(p):
    player = query_dbs.findPlayerInMongo('_id', p[0])
    try:
        return (player['pop'])
    except Exception as e:
        return "NA"
示例#7
0
def group(p):
    player = query_dbs.findPlayerInMongo('_id', p[0])
    try:
        return player['group']
    except Exception as e:
        return "NA"
示例#8
0
def times(p):
    player = query_dbs.findPlayerInMongo('_id', p[0])
    return len(player['snackazonItemChoices'])
示例#9
0
def group(p):
  player = query_dbs.findPlayerInMongo('_id',p[0])
  return player['group']
示例#10
0
def informationSeekingBehavior(p):
  player = query_dbs.findPlayerInMongo('_id',p[0])
  try:
      return (player['informationSeekingBehavior'])
  except Exception as e:
      return "NA"
示例#11
0
def pop(p): # pop stands for population: either 'sm' for social media and 'mt' for mechanical turk
  player = query_dbs.findPlayerInMongo('_id',p[0])
  try:
      return (player['pop'])
  except Exception as e:
      return "NA"
示例#12
0
def group(p):
  player = query_dbs.findPlayerInMongo('_id',p[0])
  try:
      return player['group']
  except Exception as e:
      return "NA"
示例#13
0
def times(p):
  player = query_dbs.findPlayerInMongo('_id',p[0])
  return len(player['snackazonItemChoices'])
示例#14
0
def pop(p):
  player = query_dbs.findPlayerInMongo('_id',p[0])
  try:
      return (player['pop'])
  except Exception as e:
      return "NA"