MIDI input directly into browsers seems to be at a pretty early stage, with very limited support, so I suspect only suitable for experiments at this point.
However, if your students can save the MIDI data to a file that could be uploaded - and maybe use a standalone browser MIDI player, or a third-party hosting and playing service. (I expect those links are not the only options - they're just the first I thought of.)
Or the easiest option would be to use audo files (e.g. MP3s) via Moodle's audio tools.
HTH!
Dave.