chamilo / chamilo-lms

Chamilo is a learning management system focused on ease of use and accessibility
https://chamilo.org
GNU General Public License v3.0
811 stars 481 forks source link

Courses list: set a default order #1655

Open ywarnier opened 7 years ago

ywarnier commented 7 years ago

Current behavior / Resultado actual / Résultat actuel

The list of courses for students and teachers appear with no particular logic. The issue with that is that a change in one of the course's settings can have the impact of changing the order, which makes it difficult to manage when you have 30-40 courses or so.

Expected behavior / Resultado esperado / Résultat attendu

Ordering by name would be just fine (first sessions by date then name (if no date), then courses by name).

Chamilo Version / Versión de Chamilo / Version de Chamilo

1.11.2

@p4pr8n for more info

shabsshab commented 4 years ago

Can we sort the course manually ? Eg:- I do have subject name online class and it should in top as around 20 courses are there and sometimes teachers and students are in different live classes ,So keeping a subject online class and it should in first

ywarnier commented 3 years ago

The ordering by alphabetical order has been fixed in 1.11.14, as far as I know (and should be the same code in 2.0). Assigning to Carlos for confirmation...

carlangas159 commented 3 years ago

hi @ywarnier

Good morning, if there is a logic although it is not easy to observe, I explain, when you enter the section of my courses, user_portal.php is loaded, the section of the courses is loaded in the following line https://github.com/chamilo/chamilo-lms/blob/1.11.x/user_portal.php#L191 calling the function $courseAndSessions = $controller->returnCoursesAndSessions($userId, true, null, true, $loadHistory);

If loadHistory is false, the course categories are called. For each category, the courses will be selected using the function (returnCoursesCategories) https://github.com/chamilo/chamilo-lms/blob/1.11.x/main/inc/lib/course.lib.php#L4063

It is here that the sql is structured to show the ordered courses that will be as follows

ORDER BY course_rel_user.user_course_cat, course_rel_user.sort ASC

It is ordered first by category and then by the order established by the user, if this order is not modified by the user an incremental is used by date of addition

It will be revised properly for version 2

nguyen-xuan-huan commented 3 years ago

Hi... How to show All courses on Homepage in chamilo v 1.11.16 (By default only 6 courses show on the homepage). Thank!

ywarnier commented 3 years ago

Hi @nguyen-xuan-huan This should be in a new issue, although it's not really a bug (only bugs or feature requests should be reported here - questions should go to forum.chamilo.org or on our Slack channel). You can change it in your code here: https://github.com/chamilo/chamilo-lms/blob/1.11.x/main/inc/lib/userportal.lib.php#L1180 (second parameter)

lonesomewalker commented 3 years ago

Slack is only available for @beeznest addresses ;-)

ywarnier commented 3 years ago

@lonesomewalker Not at all, you just have to ask for an invitation if you have legitimate interest in contributing. It's not open because we don't want to deal with spam account. Several people who have contributed issues/patches/PRs in the past are on Slack, unrelated to BeezNest