It really should be possible to do this (add multiple copies of the same calculated question to a quiz).
A long time ago, it would have been almost impossible to do that for technical reasons (question id was used as the part of the unique key for all sorts of quiz/question related data).
Over the years, I think all of those have been eliminated from the code. I least, that has been one of my goals. I think it has now been done, so really all that remains is to change the Edit quiz screen to let you add multiple copies of a question, if
that question has multiple variants (like calculated, STACK, formulas, ... questions do.)
If anyone would like to test this, you could try creating a quiz like this manually, and test if it works. Please only do this on a test server, at least until you have done enough testing to verify that it actually works:
- Create a calculated question with a dataset of 10 items (or use another similar qtype of your choice).
- Also make sure that you have at least 9 other questions in your question bank.
- Create a quiz.
- Add the calculated question as Q1.
- Add the 9 other questions.
- Now, look in the question bank, in the quiz_slots table. Find the 10 rows that link the quiz to the 10 questions. It might look something like
| slot | quizid | page | ... | questionid | ... |
| 1 | 123 | 1 | ... | 456 | ... |
| 2 | 123 | 2 | ... | 457 | ... |
| 3 | 123 | 3 | ... | 458 | ... |
| 4 | 123 | 4 | ... | 234 | ... |
| 5 | 123 | 5 | ... | 235 | ... |
| 6 | 123 | 6 | ... | 236 | ... |
| 7 | 123 | 7 | ... | 237 | ... |
| 8 | 123 | 8 | ... | 238 | ... |
| 9 | 123 | 9 | ... | 459 | ... |
| 10 | 123 | 10 | ... | 460 | ... |
- Now, edit that, so for all these rows, the questionid is 456 (the id of your calculated question).
Please test very carefully before assuming that it is working. Test:
- Attempting the quiz as a student.
- Verify that each variant of the question gets used once.
- Viewing all the quiz reports after there are some student attempts.
- In particular, how does the statistics report handle this?
- Be very careful with the Edit quiz page after you have done this. Some edits may be safe, but others will probably break.
Testing this manual method would tell us how close we are to being able to implement this fully in Moodle, if anyone has time to do the testing.