Hi,
I just finished writing some code that lets users add custom fields to a course - just like the custom fields for a user. I also customized the custom reporting module to let a user choose and report on any of those fields and create reports as he or she may wish.
Now, what I would like to know is how do I contribute it back to the community? I see there is an issue open at http://tracker.moodle.org/browse/MDL-18319
I'm however not sure if I have adhered to all moodle code guidelines and if I my code is of that great quality. But I'm willing to work on it and submit a patch that adheres to guidlines, architecture and standards.
So, where do I begin? I basically looked at the code and tables for custom user fields, copied it, and made changes wherever necessary. This did induce some duplication of code in following directories
MOODLE_HOME/user/profile
MOODLE_HOME/user/profile/field
MOODLE_HOME/user/profile/field/checkbox
MOODLE_HOME/user/profile/field/datetime
MOODLE_HOME/user/profile/field/menu
MOODLE_HOME/user/profile/field/text
MOODLE_HOME/user/profile/field/textarea
I renamed some of the class to avoid naming confict but I don't think thats a good idea. My first thought was to reuse the classes for user profile but they have been named in way that imply they are specific to custom user fields. Not sure, maybe you guys can enlighten me?
So the question is, is it okay to duplicate code in this module or maybe I should re-use the 'custom user field' classes or maye re-work both the modules with generic names?
I'll really appreciate any help and guidance in this regard