This test requires
- a question category X containing 4 or more questions,
- a category Y containing 2 or more questions, and
- during the test you will create a third category called Z.
- Log in as a teacher and add a quiz activity.
- Go to the "Questions" tab.
- Click "Add▾" "+ from question bank"
- Select a question from "Category X" in the "Select a category:" drop down.
- Click the button "Add selected questions to the quiz" to add one question to the quiz (non-randomly).
- Now click "Add▾" "+ a random question" and from the "Existing category" tab select "Category X" in the "Category" and add set "Number of random questions" to "2" and by clicking the button "Add random question" add 2 random questions to the quiz.
- Add one random question from category Y.
- Click "Add▾" "+ a random question" and select the "New category" tab to create a new "Category Z" with parent "Top" and click the button "Create category and add random question".
- Click the link "See questions" to navigate to the Z category and verify the category is empty. Create a new question in category Z.
- Click the "See questions" link for one of the other random questions, and check that the question bank display switches to that other category.
- Preview the quiz a few times. Check that
- the non-random question is always the same;
- the random questions for Category X are random, but do not duplicate the non-random question;
- the random question for Category Y is random; and
- the random question from the category Z is always the same. (We are testing that having only just enough questions in the category does not cause an error.)