To do this, create a Short Answer question and enable Allow learners to upload a file as part of their answer and click Save Question.
When your learner attempts the question, there will be an option to upload a file.
If you want your learners to have the option to attach files such as images or documents to assessments, this article covers the process.