Study the examples.
Was it raining this morning? → It was raining that morning→ It had been raining that morning.
Was she wearing a red dress?→ She was wearing a red dress. → She had been wearing a red dress.
What is missing from the space?
Were they listening to music? → ... → They had been listening to music.