I received this error message 'Error writing to database' every time i attempted to do those actions.
I checked the folder and files permission of the moodle data, and it seems to be correct (writable by the server user and also the authenticated user). I checked the database privilege and it seems to be correct as well.
Would there be anyone having the same issue? and may i know how to solve this?