Posts made by Simon Coggins

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

Average of ratings: Useful (2)

We've implemented course custom fields in Totara, you can have a look at https://demo.totaralms.com/ log in as demoadmin/demoadmin, then visit Manage Courses > Custom Fields. We've also added some new field types such as date/time fields.

It's written in a reasonably generic way as we also use the same code in our hierarchies. Our approach was to have separate tables for each "type" of custom field (e.g. mdl_course_info_*), rather than an extra field in a single table. It's not currently integrated with user custom fields and would require some work to integrate into moodle. 

The demo is currently running 1.9 but this code has been ported to 2.2. We are happy to share what we have if it would be useful.

Simon

Average of ratings: Useful (4)

Hi Vijay,

The "My Courses" block is unchanged in Totara and included with the codebase so it should work the same as it does in any moodle 1.9 installation - just turn on editing > add a block > courses. If that's not available then check that you have code in the blocks/course_list/ folder.

If you want any Totara-specific help feel free to post in the Totara community forums.

Simon

I realise we're a bit late to the party here, but we've recently been porting lots of code to the moodle 2 codebase and we wrote a tool to make the job a bit easier. Since there's still a few 1.9 modules that need converting we thought we'd make it available in case it's helpful for others too.

It was original based on the check_db_syntax script here, but we've extended it significantly, adding support for a wider range of issues, automatically fixing some common issues and a web interface. It also has some support for moving and updating language strings, help files, etc.

It's designed to be extendable, so although we haven't got rules for fixing everything yet, feel free to add more and send us pull requests to be merged.

Here it is:

https://github.com/totara/moodle2_code_converter

and here's a typical screenshot:

Moodle 2 converter tool screenshot

 

Enjoy!

Simon and the TotaraLMS team.

Average of ratings: -