Hi,
Sorry for the delay. It turns out that the code isn't quite as nicely abstracted as I thought, so it will take a little work to get it up and running.
Here's a zip with the following:
- totara/customfield: This is the bulk of the code. It's implemented as a custom "totara" module but should be easy enough to put somewhere else
- course_custom_field.patch: a patch to apply the required changes to course editing. This probably won't apply cleanly because of other changes we have in that file but it should show what needs to be added
- custom_field_install.xml: a snippet of an XML file showing the tables that are needed.
There's no code in there for actually displaying the fields anywhere at the moment but the functions are there in each custom field class.
If there are any references to 'types' or 'hierachies' that's Totara specific code that should be removed. Ideally I think each "subject" should have it's own class too to make it easier to extend - e.g. something like custom_field_type_course extends custom_field_type_base { }.
Simon
