I am trying to modify mod_activequiz to have a chat feature. The chat module is embedded in an iframe on the active quiz page. This works, but only the first time it is used, as only the first time do course module ids and instance ids align. When trying to repeat, these ids do not align, and there are course module related errors. The problem seems to be that the underlying code requires each module to be separate, but I have combined them as one. I just can't seem to hack my way around all the errors without producing more problems.
Is it possible to embed the chat module in another module this way? Or is there another way to get both modules into the same page?