When previewing a quiz, clicking the edit icon next to a question results in an error (cmunknown), or an attempt to edit a resource in a different course. Editing the same questions from the quiz Edit tab works fine.
1. Go to demo.moodle.org, Features Demo, A listening quiz.
2. Click the Preview tab and click the edit icon next to the question. Note the cmid in the url is 10, the quiz id.
3. Go back to the quiz, go to the edit tab and click the edit icon next to the question. The cmid in this case is 223, and the question edit page loads successfully.