Web API to send a feedback file to a student

Web API to send a feedback file to a student

Tobias Bora -
Erantzun kopurua: 3

Hello,

I annotate the PDF of my student exams locally, and I'd like to be able to send them the annotated file automatically, via a bash/python script for example. I could send emails, but I saw the "feedback file" functionality of moodle.

Is there some API that let me script the sending of a feedback file?

Thanks!

Puntuazioen batez bestekoa: -
Tobias Bora(e)ri erantzunda

Re: Web API to send a feedback file to a student

Benjamin Ellis -
Particularly helpful Moodlers-ren irudia
Hi,

You could develop a local plugin that catches the feedback submitted event and then identify the uploaded file and send it to the student as an email attachment. You might want to consider the user's messaging preferences ...
Benjamin Ellis(e)ri erantzunda

Re: Web API to send a feedback file to a student

Tobias Bora -
Hum, I think I was not clear enough. I don't want to code a plugin that sends email to students when a feedback is put on the server, I want to be able to submit a feedback on the server (if possible without writing any plugin on the server side as I don't have access to the server) via an external script, so that the student can access it via the online moodle interface. For example, if on my computer I have the file "ex1_feedback.pdf" that corresponds to the feedback of the student 123456, I would like to be able to write something like:

```
wget --post-file=ex1_feedback.pdf https://uni_moodle.server/feedbackfile/ --post-data="user=123456;token=someWayToAuthenticateTheScript;exam_id=456789"
```

to automatically sends this file as a feedback on moodle interface. I could try to sniff what requests are actually sent to the server using Firefox "network" tab in dev tools, and see if I can "reverse engineer" the request, but I was thinking that maybe moodle provides a cleanner way to do that.
Tobias Bora(e)ri erantzunda

Re: Web API to send a feedback file to a student

Benjamin Ellis -
Particularly helpful Moodlers-ren irudia

Hi,

I am assuming you are talking about assignment feedback not mod_feedback.  There appears to be a web service support for assignment submissions but not for feedback which makes sense.  Don't think it is possible currently but I am happy to be corrected.