Hi to Moodle folk
When a user submits assignment files, their details are stored in the files table. The handy File API Internals doc has detailed information on this table, and although it's marked as v2.0 I'm assuming that it's still valid for v2.6. What I need to find out is what files in the table are related to assignments. I thought that maybe I could use the files.component column which has strings such as assignfeedback_editpdf, so maybe a search for substring "assign", but this fails as even simple images (eg smile.png) are stored as being part of such a component.
Another possibiility might be the files.filearea column, which contains strings such as "submissions".
I've two related questions which I'd be grateful if someone would answer:
1. What's the best way of differentiating assignment files from other files?
2. Is there a doc which lists the values that files.component and files.filearea can have?
This is not unrelated to a post by Jez H today...
I'm happy to RTFM if someone can point me to the relevant bits of TFM. I'm an old Moodle hand as an admin and course designer, but a naive newbie to Moodle development.
A tangential question: does Moodle use foreign keys at all, or is referential integrity enforced in code?
Cheers
Fred