Skip to content

Instantly share code, notes, and snippets.

@eniuz
Created April 30, 2015 09:54
Show Gist options
  • Save eniuz/76b340970fad908c0d7f to your computer and use it in GitHub Desktop.
Save eniuz/76b340970fad908c0d7f to your computer and use it in GitHub Desktop.
public function get_course_sections()
{
global $DB;
$table = 'course_sections';
$condition ='section IS NOT NULL AND sequence != ""';
$params = ['course' => $this->course->id];
$asections = $DB->get_records_select($table, $condition, $params);
$modinfo = get_fast_modinfo($this->course, $this->user);
$sections = $modinfo->get_sections();
// return $sections or $asections
return $sections;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment