Thank you for this question type, we are using it quite a bit! Actually, I recently went through the process of setting up a brand new 2.4 moodle, and realized that this no longer worked in that version - which would be a problem for upgrading. I went digging and found what needed to be fixed and thought I would offer it back to the community. Feel free to check it and make adjustments if I did anything wrong, but I just copied a few lines from one of the other question types in 2.4
One line I wasn't sure if I needed:
But it was there on the other one, so I left it. I did not make any changes other than the few changes needed to make it work in 2.4 English.
Hoping this helps someone!