The easiest way to achieve this is to add the Plugin "End Quiz at a fixed question number" to your Quiz. Also you will need to click the Settings tab and select 'Quiz' and at the top Tick 'Randomize question order for entire quiz'.
Here is a guide to How do I show a subset of questions from a larger group:
https://www.quiz-maker.com/Quiz-Help/FAQ-Question-Subset