The parties do some scripting ahead of time, but the individual members can ask whatever they want and can follow each question with a supplementary question. It does tend to make for great theatre.
I’ve watched more than a few ‘episodes’ on TV ... Can’t remember why we’d air it, but I remember watching it when Tony Blair was PM and I thoroughly enjoyed it.