Course sorting on MyCourses page

Course sorting on MyCourses page

by Charles Johnson -
Number of replies: 3

Hi,

I'm curious what field or data is used to sort the courses on the MyCourses page for users. I would like to push all but the current term's courses to the bottom of the list of courses.

I have tried changing the first character of the short name, full name, and course id number to a value that would change the sort order of the courses on my MyCourses page, but it doesn't appear that it makes any difference.

So in light of that, what information is used to determine the sort order of courses? Is it something that I, as the administrator, have access to for the courses on my server?

Thanks,

Chuck Johnson

Simpson College
Indianola, IA

Average of ratings: -
In reply to Charles Johnson

Re: Course sorting on MyCourses page

by Kelly Turner -

This is something that you as the Administrator need to set.  I'm not aware of a Sort feature that will automatically sort something based on date or alphabet.  However, you can sort them. 

From Administration block, select add/edit courses.

If you have your course sorted into categories you will have to select the category.  Otherwise, you course are now listed on your screen. 

Turn Editing on. 

The course list will display.  On the right hand column under edit, each course title will show and up and down arrow.  Click on these to move the order of the display of courses. 

This is the only way I know how to do it.  If someone has a quicker way, please share it.

Good Luck.

In reply to Charles Johnson

Re: Course sorting on MyCourses page

by Sharon Goodson -
I found the courses sorted oddly on My Moodle pages regardless of how they were listed on the front page. I found my solution here: http://moodle.coleggwent.ac.uk/mod/resource/view.php?id=2068 , and edited my/index.php

According to this, courses sort by enrollment date. We wanted them displayed are we had them on the front page by category.

We also changed the way courses were listed in my course block. I'm not positive, but I think I found that solution here MDL-13112

Wherever I found it, in blocks/course_list/block_course_list.php I commented out the line

if ($courses = get_my_courses($USER->id, 'visible DESC, fullname ASC')) {
(I hate deleting core code)

and adding the line
if ($courses = get_my_courses($USER->id, 'sortorder ASC, visible DESC')) {

Hope that helps!
In reply to Sharon Goodson

Re: Course sorting on MyCourses page

by Thomas Hanley -
Hi Sharon,

Many thanks for your input here, it really helped me : ) I messed around for several hours looking for this solution!

I am using Moodle 1.94

I have specific aims for my course which require that I do not want courses to display alphabetically. I wanted them to sort based on the order I set in the admin settings. Your line above helped me do that. Seemed to only need to be changed in one place
in this file:

blocks/course_list/block_course_list.php

I do not understand really why I should be hacking PHP in order to make such a change. I will find somewhere in the Tracker to say this : )

Many thanks

~thomas