You can create the random number first in an equation question and then instead of the rand part from Tpartners example insert the responde of the equation question as the random number.
Hmm...not sure that would work because Expression Manager wraps piped values in a <span> element. (don't ask me why Image may be NSFW.Clik here to view.

Then this would be saved into the random question:
Yes, exactly Image may be NSFW.Clik here to view.
