...
To draw the diagram you must proceed as follow:
Step 1. Identify the system and indicate it with a circle. (In this problem we will consider the system to be both cars. The reason is that we will assume that the collision time is very short so the possible external forces exerted on the system will produce a negligible external impulse, so we can solve the problem using the linear moment momentum of the two car system is constant).
Step 2. Identify the initial state of the system. (In this problem, the initial state is right before the collision when the car of mass m1 is at rest and the car of mass m2 is moving to the right with speed v2(tbefore).
Step 3. Identify the final state of the system. (In this problem, the final state is right after the collision when the car of mass m1 is moving to the right at speed v1(tafter), and the car of mass m2 is moving to the left with speed v2(tafter).