In the quiz settings and under "Response Options", set "Response format" to "HTML editor with file picker".
If you set "Allow attachments" to 1, 2, 3 or Unlimited, students can drop the corresponding number of images into the attachment box. If you set "Allow attachments" to "No", students can still drop images into the text box.
With earlier versions of Moodle, students can retreive their images by first clicking on the "image icon" then on "Browse repositories...". See https://docs.moodle.org/36/en/Images ↗ for more details.
Starting with Moodle 3.9, students can drag and drop images directly from almost anywhere into the text box and/or attachment box. See https://docs.moodle.org/310/en/Images ↗.
It works great and it is very easy to use.