I am making an audio recording questiontype for Moodle 2.2. But I m having trouble understanding how I can do what I want.
I have based the new questiontype on the essay question type. The file is recorded in a non moodle location, and then copied over into moodle using the file API. The problem is that I can't see where I should put the copy code. I do not know which function is called when the question has been "answered."
I know that the question can exist in a number of contexts like the preview window or a quiz. So the "answered" state might be ambiguous. I am not very excited about calling the copy procedure from javascript, partly because students are likely to make several recording attempts before they are satisfied and I would rather take only the final attempt.
Hmm. I mean when does an attempt get put in the database? At that time I would like to do the copy.
Is there a way to do what I want, or should I just call the copy from javascript, ala when the student hits the stop recording button?