I have a custom database query that lists activities throughout a specific course category.
I can get them easily ordered by the courses, but I'm having trouble getting the activities to the same order as on each course.
I found out that the course_sections table holds the sequence of the activities within a single section. The data is however saved as a string e.g. "71,123,532" so it cannot be used directly for ordering. Especially when my query contains activities from multiple courses.
Are there any tricks that I could use to achieve my goal?