My Moodle: Sorting courses on My Moodle page in 2.1

My Moodle: Sorting courses on My Moodle page in 2.1

by Glenn Pillsbury -
Number of replies: 6

Hi,

We're using 2.1.

I would like the course listing on the My Moodle page to be sorted with the newest visible courses on top (startdate DESC).

Can anyone help?

Thanks!

Average of ratings: -
In reply to Glenn Pillsbury

Re: My Moodle: Sorting courses on My Moodle page in 2.1

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Glenn,

An administrator can manually sort the order in which courses are listed in Settings > Site Administration > Courses > Add/edit courses. As far as I know, this order is used in My Moodle as well as on the front page.

In reply to Helen Foster

Re: My Moodle: Sorting courses on My Moodle page in 2.1

by Gus Hagelberg -

Manually sorting the pages would be rather silly and terribly troublesome. Isn't there a way of having the courses in myMoodle sorted alphabetically for example?

In reply to Helen Foster

Re: My Moodle: Sorting courses on My Moodle page in 2.1

by Jamie Tinley -

Just for anyone else arriving here too I tested this concept of the mymoodle course sort order by changing the order as Helen suggests in add/edit courses and found the my moodle page did NOT change for me in Moodle version 2.5.9 (build 20141110) I verified this by enrolling in a course in a category at the bottom and the course correctly showed up at the bottom of my mymoodle page. then I moved my top category where I have many courses to the very bottom below the category of the new courses I added.  refreshing my mymoodle page still had the same order. 

I also tried was re-sort courses in the pugins/local plugins which did not change mymoodle page.

I would like to sort the mymoodle page alphabetically like I did in 1.9 with a hack to the my/index.php file but this is not possible in 2.59 that I see.

this video

shows how a user can manually arrange the courses but this is not an auto sort option like I am interested in doing.

I also tried hiding courses which should according to this comment here go to the bottom but I did not find that to be the case either. (the hidden course is still in the same middle of mymoodle page even after F5 refreshing)

I made sure in appearance/navigation I had mymoodle as default user page and sort order full course name which I tried variations to no affect.

I read that admin/courses/manage course and categories should show a way to sort it but I am missing that tool in courses ( I only see under site admin/courses  add/edit courses, course request, backups, and upload courses (which I had to add and is included in moodle 2.6 but not 2.59)

so any other ideas are welcome but I really should not have to edit the php again as suggested above but I will if I must.

thanks,



In reply to Glenn Pillsbury

Re: My Moodle: Sorting courses on My Moodle page in 2.1

by Gus Hagelberg -

Is anyone aware of how to make the sort order alphabetical in mymoodle? In moodle 1.9 is was an easy tweak to my/index.php. In moodle 2 it seems more tricky.

Thanks

In reply to Gus Hagelberg

Re: My Moodle: Sorting courses on My Moodle page in 2.1

by Gus Hagelberg -

I got the how to from another post. Here's how to do it:

Sort Order of myMoodle Block “Course Overview”

In blocks/course_overview/block_course_overview.php line 67 there is

$courses = enrol_get_my_courses('id, shortname, modinfo', 'visible DESC,sortorder ASC', $courses_limit);

The ordering is determined by the 'visible DESC,sortorder ASC' bit so for example for visible courses to appear first in alphabetical order by fullname, then hidden courses in the same order change to:

$courses=enrol_get_my_courses('id, shortname, modinfo','visible DESC, fullname ASC',$courses_limit); 

In reply to Gus Hagelberg

Re: My Moodle: Sorting courses on My Moodle page in 2.1

by Jamie Tinley -

unfortunately my moodle version 2.5.9 must differ because my block_course_overview.php does not even have a $courses anywhere in the file nor when I searched for other words like enrol. I found get but here's the part on mine that probably deals with sorting but I'm not clear how to edit it. This is on line 82



Attachment code in Moodle block course overview.jpg