The correct answer is: B. were playing
The sentence "I was doing the shopping while you were playing tennis" is in the past continuous tense. This tense is used to talk about an action that was happening at a specific time in the past. In this case, the action is "playing tennis" and the specific time is when the speaker was doing the shopping.
The other options are not correct because they do not express an action that was happening at a specific time in the past. Option A, "played," is in the simple past tense. This tense is used to talk about an action that happened at a specific time in the past and is finished. In this case, the action is "playing tennis" and the specific time is not mentioned. Option C, "have played," is in the present perfect tense. This tense is used to talk about an action that happened at some point in the past and continues to happen in the present. In this case, the action is "playing tennis" and it is not clear whether it happened at a specific time in the past or not. Option D, "have been playing," is in the present perfect continuous tense. This tense is used to talk about an action that started in the past and continues to happen in the present. In this case, the action is "playing tennis" and it is not clear whether it started at a specific time in the past or not.