1.Were the students writing a test at 12 o'clock yesterday?
Were the students writing a test at 12 or 10 o'clock yesterday?
The students were writing a test at 12 o'clock yesterday, weren't they?
Who was writing a test at 12 o'clock yesterday?
What were the students writing at 12 o'clock yesterday?
2. Had the students written a test by 12 o'clock yesterday?
Had the students written a test by 12 or 10 o'clock yesterday?
The students had written a test by 12 o'clock yesterday, hadn't they?
Who had written a test by 12 o'clock yesterday?
What had the students written by 12 o'clock yesterday?