score = (x) -> if x == "Yes" 10 else 0 weights = [0.2, 0.2, 0.2, 0.2, 0.2] key_species = [key_species_disclosure, key_species_upstream_relationship, key_species_status, key_species_status_upstream_relationship, key_species_conservation_strategy] weights.reduce((weighted_sum, weight, index) -> weighted_sum + weight*score(key_species[index]) , 0)