Thank you deegee, works great

but I still have problem with integrating it in the quiz script.
The question file loaded in the quiz script is defined as %qs_file. It would be great if your code could identify which file is loaded without the need of giving the filename again to catscan.
Is that possible?
I could't figure out how to change this in your code
