Prevent user enter 2 same answers

my question is to count how many correct answer the user will enter.
if the user enter the same correct answer twice,the 2 same answers will not be count and the other 2 answer will be check whether correct or wrong.
If the next 2 answer is correct markk will be add.
Take note that i have 5 answers for this question but the user only has to enter 4 of the answers only.
i can’t do that…pls help…
here is the code i add in my check button