Topic IDs from a course

Topic IDs from a course

by Marcus Santos -
Number of replies: 2

Hello,


 I would like to know if there's any way we can get the ID from a Course topic. I know it's possible to retrieve the course ID using the global $COURSE->ID, but now I want to get topic ID so I can get the topic title and include the topic into a selection box. Using firebug i can see that the ids are section-1, section-2 etc...



Thanks, Marcus.

Average of ratings: -
In reply to Marcus Santos

Re: Topic IDs from a course

by Sam Chaffee -
Picture of Core developers

Hi Marcus,

The course table and the course_sections table are related by course_sections.course. The numbers in 'section-1', section-2' html ids are generated from the course_sections.section field rather course_sections.id.

Average of ratings: Useful (1)
In reply to Sam Chaffee

Re: Topic IDs from a course

by Marcus Santos -

Hi Sam, I made it work smile. Since this feature i'm implementing is very specific I'll use the id from the url at edit screen and as you said that id is related to the course_sections table or the forum_discussions table if it's a forum. Then I get the names if there was any given. 


Thanks for the Help!