farrellsupreme, well if you keep the questions in order (eg: questions 1 to 4 are category 1, 5 to 8 are 2, 9 to 15 are 3, etc).
You can do it this way:
global('QuestionNum') = floor(random(global('CategoryQuestions')) + global('CategoryFirstQuestion'))
So that could be this code for category 1:
QuestionNum = floor(random(4) + 1 )
Random always goes just up to the number inside so in this case it would be rounded (floored) to 3, then add the +1 for making the category range of 1 to 4