Essay question type not saved on connection loss?

Essay question type not saved on connection loss?

by Olivier Wenger -
Number of replies: 5
Hi,

One of our customer noticed something, if a Student upload a file to an essay question and loose connection, the upload won't be accessible from the report view.

How to reproduce:
1. Create a quiz with an essay question with file upload and the settings Open attempts are submitted automatically
2. Login as a student and submit a file
3. Cut your connection
4. After the end of the time limit, login as teacher and check the reports
5. The file upload is not visible from there

For what I understand by looking at the code, when a file upload occurs, the file is first saved in  the table mdl_files as "draft" filearea. If you submit the attempt the file will be saved again as "response_attachment" filearea.
What I couldn't find is the creation of the second entry into the table mdl_files.

My question is the following, shouldn't the settings Open attempts are submitted automatically works for essay as well ?

Moodle version 3.9.8
Average of ratings: -
In reply to Olivier Wenger

Re: Essay question type not saved on connection loss?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Step 2 of your list above is vague. What exactly do you mean by 'Submit'?

Also, you need to realise that there are two separate things that are both important:

A) The responses have to be sent from the student's web browser to the Moodle server and stored.

B) The responses have to be processsed by Moodle when the quiz attempt is finally submitted.

The setting 'Open attempts are submitted automatically' only affects B).

Part A) is controlled by the setting Admin -> Plugins -> Activity modules -> Quiz -> General settings -> Auto-save delay (so check what that is on your server) - and, in the testing above, you need a delay of at least that long between steps 2 and 3 for it to have a chance of working.

If I wanted to test this, I would probably build a test quiz with an Essay question with attachments, and a multiple choice question, on the same page. We know auto-save works reliably for multi-choice, so that would verify that your testing is doing the right steps to have a chance of working.

It is possible that there is a bug with auto-save of files. I am not sure if anyone has tested it properly. If there is a bug here, we should fix it, so let us know how you get on.

In reply to Tim Hunt

Re: Essay question type not saved on connection loss?

by Olivier Wenger -
Sorry right, submit is not the right term, I meant "upload a file"

I made some tests again and this time waited for the autosave to occur and it worked.

My misunderstanding was with the file upload, I thought that it would count as a response since it was already uploaded on the server. But it still requires the auto-save to occur for it to count as a response.

Thanks a lot for your help
In reply to Olivier Wenger

Re: Essay question type not saved on connection loss?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Great. Thanks for clarifying that it is working - if you want for autosave.

You are right that this seems a bit odd in the context of a quiz. However, Moodle file-handling works the same everywhere, and this two-phase behaviour makes sense for Most forms in Moodle. There, you can open a form, make all sorts of changes to what is on-screen, and then later change your mind and click the Cancel button.
In reply to Tim Hunt

Re: Essay question type not saved on connection loss?

by Olivier Wenger -
Hi,

As I did further test, I realised that the file upload doesn't occur if there is only the file upload

I noticed that if you do a quiz with only a fileupload and only upload a file as an answer, the autosave function will never occur. As if a file upload doesn't trigger the autosave.

If you do the same and add a second question on the same page and answer it, then the autosave occur and the file will be autosaved as a response_attachment.

Shouldn't the upload of a file be counted as an answer and trigger the start of the autosave delay ?
Average of ratings: Useful (1)
In reply to Olivier Wenger

Re: Essay question type not saved on connection loss?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Well done for detecting this problem. This is a bug. I have reported it as MDL-72507.