Well, perhaps I spoke too soon.
On Saturday, July 17, Moodle performance slowed down, hung and eventually the database crashed. The logs show no precipitating issues or high loads. This is what happened in May. We rebooted and most things looked okay. We still have not discovered a cause for this repetition of the June DB crash.
Today, using FireFox, I went to work (as a teacher) on the reconstructed course (the one I made from scratch after the initial course started showing the invalid courseID module). Everything appeared to be okay; I changed the names on a few exercises to make theme consistent, but I could access the quiz contents and review student work.
Then I duplicated a quiz and moved the copy to a new section, intending to delete the questions but use the quiz settings for responses and question behavior. When I opened the quiz to work on it, I got the Invalid Course Module ID error. I tried opening other quizzes in the course, and now all the quizzes (even the one I had opened first to check -- which worked then) gave me an invalid course ID error.
I logged out, closed my browser (FireFox), then logged in as a student, and accessed all of the quizzes correctly. I logged back in as the teacher (still using Firefox), and accessed the quizzes again, so I figured it was just a glitch in session variable retention. However, as soon as I tried to copy the quiz again -- something I have done repeatedly in this course before without a problem since the May 17 crash -- I had the same issue: an "Invalid course module ID" error on that quiz, and (when I checked) on every quiz activity in the course. Assignment and forum activities do not appear to be affected.
So I logged out and back in -- but I still had the invalid course module ID error on opening a quiz (even without doing any copy first).
I then logged out, quit the browser, and logged back in as the teacher -- this time I was able to access the course materials and student work.
So it appears there is no actual DB data corruption, but something is causing session variables or cookies to have a fit in FireFox -- and was probably doing so in June.
I was able to log in using Safari, duplicate the quiz, move it to a new section, and open it. I could then log in using FireFox and edit it. My attempt to duplicate a different quiz using Firefox worked; so I tried the original problem causing quiz, and this time duplicating it in Firefox worked; I was able to move it to a new section and open it. For what it may be worth, the quiz causing the problem included one question using the Word Select module. The quizzes in the June incident also included questions of this type...so maybe something is related to this question type module?