score = (x) -> if x == "Yes" 10 else 0 weights = [0.2, 0.12, 0.12, 0.12, 0.12, 0.12, 0.2] lobbying_advocacy = [lobbying_advocacy_associations, lobbying_advocacy_assessment_framework, lobbying_advocacy_framework_application, lobbying_advocacy_misalignment_reporting, lobbying_advocacy_action_plan, lobbying_advocacy_action_plan_deadlines, lobbying_advocacy_annual_review] weights.reduce((weighted_sum, weight, index) -> weighted_sum + weight*score(lobbying_advocacy[index]) , 0)