Search from various English teachers...
Past Perfect & Past Perfect Progressive
Question 1 of 5

By the time he finished eating, the sun ............... .

had set
had been setting