You use categories. All the questions you create within a course are in the Default Category for that course: go to Categories tab to split them into Category A, B, etc : then on the quiz editing page [..moodle/mod/quiz/edit.php?quizid=nnn] you just add random questions from these categories, as many as you select.
When you add a Random Question to a quiz, then it will be replaced with a randomly-chosen question from the same category - for each attempt.