For this kind of logic you need to be very specific for it to work as expected. That means checking for the state of ALL the options.
So if the set of answers is [A, B, C, D and E] and the correct set is [A, B], what you need to check for is A = true and B = true and C = false and D = false and E = false.
In that case, your answer is correct, in any other case it is wrong.
If you don't do it that way, you will get unexpected results, as you have experienced already. This is because if you only check for A = true and B = true, the code is not taking into account any of the other options, as long as those two conditions are met, the answer is correct.