Moodle

number of courses in MyMoodle home page

Details

  • Type: Improvement Improvement
  • Status: Reopened Reopened
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.8.4, 1.9.4
  • Fix Version/s: STABLE backlog
  • Component/s: General
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

Hi

In MyMoodle home page, only 21 courses can appear.
But the number of courses that one student can choose is very higher.

So can we

  • change this number to 50, for example, or better
  • set it to the coursesperpage parameter (administration -> Front Page -> Front Page Settings), or best
  • create a new parameter, accessible from administration -> Appearence -> My Moodle

Waiting for this change, i modify $HOME/moodle/my/index.php
$courses = get_my_courses($USER->id, null, '*', false, 51);
if (count($courses) > 50) {

Thanks
Laurent

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

My +1 for this both in 19_STABLE and HEAD. I think that setting is the correct way (defaulting to 21 to respect current behaviour). Perhaps, also, it would be a good idea to review other usages of get_my_courses() to see if they need be changed too.

Assigning to Dongsheng, one +1 from MD is necessary. Ciao

Show
Eloy Lafuente (stronk7) added a comment - My +1 for this both in 19_STABLE and HEAD. I think that setting is the correct way (defaulting to 21 to respect current behaviour). Perhaps, also, it would be a good idea to review other usages of get_my_courses() to see if they need be changed too. Assigning to Dongsheng, one +1 from MD is necessary. Ciao
Hide
Martin Dougiamas added a comment -

Yes agree with Eloy, a new setting is a good idea (default 21)

Show
Martin Dougiamas added a comment - Yes agree with Eloy, a new setting is a good idea (default 21)
Hide
Martin Dougiamas added a comment -

Could be mycoursesperpage with a desc like "Maximum number of courses to display in any list of a user's own courses".

Show
Martin Dougiamas added a comment - Could be mycoursesperpage with a desc like "Maximum number of courses to display in any list of a user's own courses".
Hide
Petr Škoda (skodak) added a comment -

this is not going to work, sorry, because:
var_dump(is_int('1'));
returns false

anything coming from database is string value

Show
Petr Škoda (skodak) added a comment - this is not going to work, sorry, because: var_dump(is_int('1')); returns false anything coming from database is string value
Hide
Dongsheng Cai added a comment -

Thanks, Petr, I fixed the type-casting, please review

Show
Dongsheng Cai added a comment - Thanks, Petr, I fixed the type-casting, please review
Hide
Gary Anderson added a comment -

Reopening because strings for the admin control for mycoursesperpage and configmycoursesperpage are missing in the latest cvs for at least 1.9 stable.

Show
Gary Anderson added a comment - Reopening because strings for the admin control for mycoursesperpage and configmycoursesperpage are missing in the latest cvs for at least 1.9 stable.
Hide
Dongsheng Cai added a comment -

Sorry for missing language strings, commited, please review.

Show
Dongsheng Cai added a comment - Sorry for missing language strings, commited, please review.
Hide
Jerome Mouneyrac added a comment -

I just reopen for two observations (feel free to close if it's not important):

  • remote mnet courses are always displayed into my moodle (whatever number of course you save)
  • when I set to 0, all courses are displayed. If I wasn't an IT guy, I would expect no course displayed. This behavior should be explained into the "confirm" string.

Thanks.

Show
Jerome Mouneyrac added a comment - I just reopen for two observations (feel free to close if it's not important):
  • remote mnet courses are always displayed into my moodle (whatever number of course you save)
  • when I set to 0, all courses are displayed. If I wasn't an IT guy, I would expect no course displayed. This behavior should be explained into the "confirm" string.
Thanks.
Hide
Petr Škoda (skodak) added a comment -

Next time pretty please use smaller version bumps, we are running out of version umbers for 1.9.4+
also I removed the (int) conversion line because we do not do that elsewhere

Show
Petr Škoda (skodak) added a comment - Next time pretty please use smaller version bumps, we are running out of version umbers for 1.9.4+ also I removed the (int) conversion line because we do not do that elsewhere
Hide
Dongsheng Cai added a comment -

Looking into the mnet courses

Show
Dongsheng Cai added a comment - Looking into the mnet courses
Hide
Dongsheng Cai added a comment -

A new patch attached,
1. if mycoursesperpage == 0, no courses will be displayed, at the bottom, there is a "show all courses" link, click it, you will get all courses without limit.
2. if mycoursesperpage > 0, limit number of courses will be displayed, click "show all courses" link will show all courses

The "show all courses" link need to know how many courses this user enrolled, so I call get_my_courses without limit, otherwise, I need to create another SQL query to get the total number of courses, not sure which one is better, any comments?

Show
Dongsheng Cai added a comment - A new patch attached, 1. if mycoursesperpage == 0, no courses will be displayed, at the bottom, there is a "show all courses" link, click it, you will get all courses without limit. 2. if mycoursesperpage > 0, limit number of courses will be displayed, click "show all courses" link will show all courses The "show all courses" link need to know how many courses this user enrolled, so I call get_my_courses without limit, otherwise, I need to create another SQL query to get the total number of courses, not sure which one is better, any comments?
Hide
Jerome Mouneyrac added a comment -

Imo I would just change the string to explain that when set to 0, all courses are displayed. I don't think any admin really wants to set it to 0 and having all courses display is neither really user friendly.

Show
Jerome Mouneyrac added a comment - Imo I would just change the string to explain that when set to 0, all courses are displayed. I don't think any admin really wants to set it to 0 and having all courses display is neither really user friendly.
Hide
Séverin Terrier added a comment -

With Moodle 1.9.4 dated from 20090422, logged as admin, if i've selected 50 courses, i see 52 courses on MyMoodle page...

Show
Séverin Terrier added a comment - With Moodle 1.9.4 dated from 20090422, logged as admin, if i've selected 50 courses, i see 52 courses on MyMoodle page...
Hide
Eloy Lafuente (stronk7) added a comment -

Well, that's good, isn't it? Moodle knows you have more courses and gives yo a bit more.... :-D :-P

Seriously, I think the number should be accurate, what I'm not sure is if the patch has landed CVS already... it seems that Dongsheng was waiting for some feedback.

Dongsheng?

Show
Eloy Lafuente (stronk7) added a comment - Well, that's good, isn't it? Moodle knows you have more courses and gives yo a bit more.... :-D :-P Seriously, I think the number should be accurate, what I'm not sure is if the patch has landed CVS already... it seems that Dongsheng was waiting for some feedback. Dongsheng?
Hide
Dongsheng Cai added a comment -

Hi,
Séverin, do you have remote moodle courses included? we currently count local courses only.

Show
Dongsheng Cai added a comment - Hi, Séverin, do you have remote moodle courses included? we currently count local courses only.
Hide
Séverin Terrier added a comment -

No : only local courses...

Show
Séverin Terrier added a comment - No : only local courses...
Hide
Dongsheng Cai added a comment -

Sorry for delay, Séverin
Did you try the patch above? Let me know if you got the same problem after patch applied.

Show
Dongsheng Cai added a comment - Sorry for delay, Séverin Did you try the patch above? Let me know if you got the same problem after patch applied.
Hide
Eric Merrill added a comment -

I created a new ticket that is linked to this:
MDL-19089 Ellipses incorrectly displayed for My Moodle page

Show
Eric Merrill added a comment - I created a new ticket that is linked to this: MDL-19089 Ellipses incorrectly displayed for My Moodle page
Hide
Petr Škoda (skodak) added a comment -

we are very close to release, this will have to wait a bit, sorry

Show
Petr Škoda (skodak) added a comment - we are very close to release, this will have to wait a bit, sorry
Hide
Daniel Neis added a comment -

Hello,

what abou MDL-19089 ? Here at moodle.ufsc.br were are using the proposed solution on production since then and it's ok...

Show
Daniel Neis added a comment - Hello, what abou MDL-19089 ? Here at moodle.ufsc.br were are using the proposed solution on production since then and it's ok...
Hide
Eric Merrill added a comment -

The off by two issue is addressed in ticket MDL-20472

Show
Eric Merrill added a comment - The off by two issue is addressed in ticket MDL-20472
Hide
Eric Merrill added a comment -

The off by 2 error described by Séverin should be corrected in 19_STABLE and HEAD now.

Show
Eric Merrill added a comment - The off by 2 error described by Séverin should be corrected in 19_STABLE and HEAD now.
Hide
Dongsheng Cai added a comment -

Thanks, can this issue be marked as resoved onw?

Show
Dongsheng Cai added a comment - Thanks, can this issue be marked as resoved onw?
Hide
Eric Merrill added a comment -

I was unclear if there is still a problem with mnet courses - that is why I didn't close this ticket out.

-eric

Show
Eric Merrill added a comment - I was unclear if there is still a problem with mnet courses - that is why I didn't close this ticket out. -eric
Hide
Dongsheng Cai added a comment -

thanks, I will discuss the mnet courses issue with the other developers tomorrow

Show
Dongsheng Cai added a comment - thanks, I will discuss the mnet courses issue with the other developers tomorrow
Hide
Jerome Mouneyrac added a comment -

About mnet:
I could be wrong but I don't think that the note I wrote has been fixed: "remote mnet courses are always displayed into my moodle (whatever number of course you save)". This comment let me think that Moodle probably don't consider mnet courses.
I would say that you can resolve this issue, and create another related issue with this description: "remote mnet courses are always displayed into my moodle (whatever number of course you save in the option mycoursesperpage)"
thanks

Show
Jerome Mouneyrac added a comment - About mnet: I could be wrong but I don't think that the note I wrote has been fixed: "remote mnet courses are always displayed into my moodle (whatever number of course you save)". This comment let me think that Moodle probably don't consider mnet courses. I would say that you can resolve this issue, and create another related issue with this description: "remote mnet courses are always displayed into my moodle (whatever number of course you save in the option mycoursesperpage)" thanks

Dates

  • Created:
    Updated: