Back to news list

Course instances are now sorted by date

Posted on 2024-07-23 by Matt West

When a course has multiple course instances (semesters), PrairieLearn will now order them in reverse date order. This improvement is thanks to Tim Bretl and means that you should now see a sensible ordering like:

The most recent course instance should be first in the list and older ones are below.

How exactly are they ordered? The date used for ordering is the first-access date for each course instance. You can see this date by clicking on the course rubric (e.g., "TAM 212") in the top navigation bar and then selecting the "Course instances" tab. This date is determined from the infoCourseInstance.json files, where PrairieLearn uses the earliest startDate of any allowAccess rule. In case of ties between dates, the endDate is used as a tie breaker.

How did PrairieLearn used to order the course instances? Before this change, PrairieLearn used a combination of an undocumented number field in the infoCourseInstance.json files and an internal database identifier. This often resulted in an apparently random order. The new order should be better in all cases, but do let us know if you encounter a bad ordering.