Inside the quiz page, go to Settings (Admin Gear), then Questions.
If the quiz already has questions, follow the process below to delete them.
Delete Quiz Items
Click on “Select Multiple Items”
Select all the questions you would like to delete. If all of them should be removed, click on “Select all”
Click on "Delete Selected"
Add Quiz Items
Click on “Add”
Click on “+ a random question”
Select the question bank required for the quiz.
Select the number of questions you want to randomly select and click on Add random question
Verify that all of the questions are actually random. If so, they’ll be labeled with a dice icon and the word “Random”
For More Information
You can consult Moodle documentation for more detailed instructions: Moodle Documentation