download all code submissions from coderunner?

download all code submissions from coderunner?

de către Jin Hong-
Număr de răspunsuri: 4
Hello,

I have been using the attachment options in coderunner question type in Moodle which worked well most of the time. But I can't only download them by accessing each question. Is there a way to download all files submitted to that question?
Ca răspuns la Jin Hong

Re: download all code submissions from coderunner?

de către Tim Hunt-

I see. I was going to say Quiz settings -> Results -> Responses, and download there. However, that won't get attachements.

You could try this tool we built recently: https://github.com/moodleou/moodle-quiz_answersheets - in combination with this hacky script: https://github.com/moodleou/save-answersheets

I wrote it thinking only about essay question attachments, but checking the code, I think I did it properly so it should work for CodeRunner too.


Ca răspuns la Tim Hunt

Re: download all code submissions from coderunner?

de către Jin Hong-

Hi Tim,

Thanks for that suggestion, I have tried it and found it working reasonably well!

I might tweak the js file a bit so there is a flag option to download only the attachments and to a single folder for convenience. 

I had to comment out lines 90-92:

        //if (!(/^[-_.a-zA-Z0-9]+$/.test(action[1]))) {

        //    throw new Error('The zip name may only contains characters -, _, ., a-z, A-Z and 0-9.');

        //}

as I had % and some other symbol chars.

I might also tweak a bit to have an option to name folders using names instead of "moodle-user-xxx".


But yes, thanks for that suggestion, I can definitely workaround with this :)

Ca răspuns la Jin Hong

Re: download all code submissions from coderunner?

de către Tim Hunt-

That script was just a quick hack to do what we wanted. Its fine if you want to modify it for your own needs.

Ca răspuns la Tim Hunt

Re: download all code submissions from coderunner?

de către Jin Hong-
Hello all,

The aforementioned script is working fine and all, but had an interesting question from my colleague, "How to check whether the code they submitted is the same as the one that they attached?"

It seems likely that directly downloading the code from the submission might be the answer. Would you have any suggestions on how to go about doing that?

Thanks!
Jin