Bugfix: Course sections extraction in moodle 2.3

Extracting the Course Sections number in moodle 2.3 was broken.
The function course_get_format is not available in moodle 2.3.