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)
def group(p): player = query_dbs.findPlayerInMongo('_id', p[0]) return player['group']
def informationSeekingBehavior(p): player = query_dbs.findPlayerInMongo('_id', p[0]) try: return (player['informationSeekingBehavior']) except Exception as e: return "NA"
def pop(p): player = query_dbs.findPlayerInMongo('_id', p[0]) try: return (player['pop']) except Exception as e: return "NA"
def group(p): player = query_dbs.findPlayerInMongo('_id', p[0]) try: return player['group'] except Exception as e: return "NA"
def times(p): player = query_dbs.findPlayerInMongo('_id', p[0]) return len(player['snackazonItemChoices'])
def group(p): player = query_dbs.findPlayerInMongo('_id',p[0]) return player['group']
def informationSeekingBehavior(p): player = query_dbs.findPlayerInMongo('_id',p[0]) try: return (player['informationSeekingBehavior']) except Exception as e: return "NA"
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"
def group(p): player = query_dbs.findPlayerInMongo('_id',p[0]) try: return player['group'] except Exception as e: return "NA"
def times(p): player = query_dbs.findPlayerInMongo('_id',p[0]) return len(player['snackazonItemChoices'])
def pop(p): player = query_dbs.findPlayerInMongo('_id',p[0]) try: return (player['pop']) except Exception as e: return "NA"