Seven trainees escaped one night, at the time the officers had retired to bed leaving the trainees to their own devices.
Seven trainees escaped one night. This was at the time. The officers had retired to bed. This bed was leaving the trainees to their own devices the time.