Winning an election for class president is not a technique that can be used to randomly assign students to a treatment group. The reason for this not being random is because it can easily be preferential and everybody could vote for a specific person.
B is not a technique for randomly assigning students to a treatment group.