Transform "The bell had hardly stopped when the lights dimmed" by fronting hardly. Replace [The bell had hardly stopped] to complete: "Hardly ___ when the lights dimmed."
Correct answer
had the bell stopped
Explanation
Fronting hardly requires had to precede the subject, and the standard following connector remains when. Using than would cross this pattern with the separate no-sooner construction.