Locking responses

How do I lock responses if the required number of responses are met? for example, a question requesting a farmer to list 4 major crops he grew, out of a list of 10 crops. How do I make sure the software refuses to take in the 5th response?

You could put a constraint on this question. Assuming it's a multiple selection question so users are able to select only 4 options among the 10. In this scenario, you could put a constraint count-selected(.)=4