Bulk uploading a course in a set order

Bulk uploading a course in a set order

napisao/la Rikaz Sheriff -
Broj odgovora: 1
Hi!

Newbie here!

I'm working on a Version 4.0.4 (Build: 20220912) Moodle. 

I'm trying to upload a set of courses in a particular order


I uploaded in this csv format


I got this import result

Am I correct in thinking that if I had uploaded this list upside-down (first course last and vice versa) that Moodle would have uploaded it in order. It seems to have created the courses in that pattern. Would that be a consistent behavior? InshaAllah hoping someone will see this 🐟 in this big 🌊!
Odgovor na Rikaz Sheriff

Re: Bulk uploading a course in a set order

napisao/la Gareth J Barnard -
Slika Core developers Slika Particularly helpful Moodlers Slika Plugin developers
Dear Rikaz,

Intriguing!  I don't have an operational M4.0 instance but do have a M4.1 instance, and there is the option to change (persistently) the sort order:

Course sort order.

Looking at the code, there is the 'sortorder' field in the 'course' table that is an integer, default of '0'.  Thus initially, the first course shown will be the first one you've created in that category, as you've experienced.  Clicking on 'Sort courses' and selecting an alternative changes the value of the 'sortorder' field to reflect the choice you have made, thereby being the same when you refresh / revisit the page.

Kind regards,

Gareth