Primary Elections and the Quality of Elected Officials