This looks like a good start. One thing that needs to change is the naming. Instead of quiz "versions" there should be quiz "attempts". This is something that WeBWorK has done wrong for a long time. The "version" wording is basically developer wording. We call it that because we create versions in the database of this quiz. Students don't use or understand such terminology. Even instructors don't use such terminology.
Also, I recommend that you create a draft pull request of what you have and move this discussion to the conversation in that pull request. You can get quicker feedback there, and your code will be more visible.