Enrolled Courses List on Frontpage Issue - Split from Adaptable support

Enrolled Courses List on Frontpage Issue - Split from Adaptable support

by Nadirshah Ferozepurwalla -
Number of replies: 33

Thankyou for such an excellent theme,

I would like to filter the courses displayed on the frontpage, such that it displays only the courses the user is enrolled in.

Just as my course menu does.

Can you please guide me where to adjust the code, and code to write.

I known php but moodles code is something every new, your help will be really helpful.

thankyou

(Edited by Mary Evans - original submission Sunday, 7 February 2016, 3:50 PM)

Average of ratings: -
In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

You dont need to alter the code anywhere, Moodle already does it.

Front Page Settings > Front Page Items when logged in > Enrolled Courses

Its a core moodle setting

Front page settings

In reply to Richard Oelmann

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

yes i did this but it doesnot work, it still shows all courses available in moodle, 

when i access the url for site page BY USING A STUDENT LOGIN not admin, all courses show in blocks

http://localhost/LMS/?redirect=0

have done these two settings, but no use

 


and in settings page of frontage of the theme




In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Using  http://localhost/LMS/?redirect=0 you are redirecting the users to the moodle Home page and then they are able to see all the courses, not only the courses they are enrolled.

You must change the default page to Dashboard, then the users will see only the courses where they are enrolled after login.

The Dashoboard page is not controlled by Adaptable so the courses list is the same that you can see in other themes.





In reply to Fernando Acedo

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

'then they are able to see all the courses, not only the courses they are enrolled.'

That's not correct Fernando. If the front page setting to show Enrolled Courses to logged in users is selected then that is what will be shown (as per my screenshot above) - there is another option for showing All Courses, which will - as it says - show all courses irrespective of the ones enrolled.

@Nadirshah, Have you perhaps given the user the student role across the whole site, rather than in individual courses? That would probably cause them to show up with all courses listed as they will have the student role in all courses.

You can check by enabling both the Enrolled Courses and the All Courses options in two separate drop downs of the 'Front Page when logged in' setting I showed earlier.

But Fernando is right - this is not a theme issue, Adaptable works exactly the same way as Clean, Flexibase, Essential and every other theme in this regard (just tested - Enrolled/All Courses show up separately and as expected based on the front page settings).

Adaptable Enrolled or All Courses

In reply to Richard Oelmann

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

no the user is not given any role until he self enrolls in a course.

I believe this is a theme issue, as the layout.png of this theme shows a compulsory courses area, which may be listing all courses directly?

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Front Page of Adaptable with all front page settings disabled - no course listing, whether enrolled or not.

Adaptable - no courses

This is part of Moodle core main_content() and not part of any adaptable theme function.

There is nothing 'compulsory' about the courses area in that diagram - in fact if you chose to only display news items on the front page that is what would appear there. It's simply where the main_content() of the front page appears. That diagram simply displays it as where the courses would be IF they are selected from front page settings because that is a common use of that area and one that the theme has worked to restyle from the default.

Please check the front page settings documentation https://docs.moodle.org/30/en/Front_page_settings

You will probably need to ask a new thread in the general help forum as this is not an Adaptable issue - adaptable works exactly the same as Clean in this regard.

Average of ratings: Useful (1)
In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Sorry but I created the layout image and I don't remember to add any "compulsory" area.

The image is just for help purposes and show the name of the different areas in the front page. That's all.

If you setup moodle frontpage to display the courses as Richard indicated, you will see only the enrolled courses after login. I think is much better to redirect the users to the Dashboard (the default moodle option) but anyway you can do it with the Home.

If you want to remove the "All courses" link then you can do it in:

Site administration > Plugins > Blocks > Courses

Uncheck "Hide all courses link"


In reply to Richard Oelmann

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

I am not sure what are you trying to show by the images, but just to make sure, there are no courses appearing in the "My courses" dropdown either. that means the user is not enrolled in any course.

please help.

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Nadirshah, the images show my test site with MY Courses, and ALL Courses which are separate. Showing that Adaptable works correctly and displays them as expected. This is NOT an Adaptable theme issue. Please check the documents about using the front page settings.

You should then repost in the General Help forum if you continue to have issues

Average of ratings: Useful (1)
In reply to Fernando Acedo

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

thankyou, but i need the display of courses as blocks, the way they are displayed on the redirect=0 page.

The dashboard course overview block doesnot display the courses that way.

So my question should be what should i do to display only the courses the user is enrolled in? on the moodle homepage.

Yes its controlled by the theme as shown in theme layout png, therefore what could should i change?


Average of ratings: Useful (1)
In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

The Course Overview block is a Fake Block and only associated with the MyDashboard page. Moodle/my

I have not read much of this discussion, but I note Richard has had enough for this weekend. 

My suggestion to you Nadirshah is to be wary of Themes that are still in development stage. 

I do not know enough about this theme so I have been quiet, only answering that which I know more about.

As for Fonts.

The correct way to address this is to have served the font via the theme, as well as offer webfonts with provision to fall back on the theme fonts if web connections are not possible.

The Code to do that was in Bootstrap, but was never added in Moodle as none of our core themes use Fonts.

So this is perhaps a theme design issue that needs to be addressed.

Cheers

Mary

Average of ratings: Useful (1)
In reply to Mary Evans

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Mary,

Adaptable is the first theme you can select any Google font from a dropdown. So add all the GF to the theme was not an option even they are available for download.

About Font Awesome, yes it could be integrated in the theme but not in the to do list for the moment. Moodle is supposed to run in a server with Internet connectivity and should not have problems to load the font.




In reply to Mary Evans

Re: Adaptable Theme Support

by Jez H -

There are also licensing issues, some fonts which are free to use are not free to distribute, i.e. not completely open, I dont think HQ particularly like fonts being bundled with themes for this reason. FA could be accommodated as so many use its under a "GPL Friendly" MIT license but last time this cropped up I am pretty sure David said it was better to load fonts rather than pack them in the theme.

In reply to Fernando Acedo

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

@Fernando,

I did notice, in testing the issue for Nadirshah (which is NOT an Adaptable issue as you have already said), that the Combo List Front Page option does not work correctly in Adaptable.

Attached image shows Clean and Adaptable with the Combo List option selected in the front page settings

In reply to Richard Oelmann

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Richard, this is an old BCU issue and has not been fixed and is not in the priority list for the moment. So only the courses list without categories is rendered by Adaptable.

In reply to Fernando Acedo

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

To both Richard and Fernando

found the problem,

Moodle shows all the courses if the user is enrolled in none!!

When u enroll the user in a course, then only the enrolled course is listed on the frontpage.

Can any one raise a tick or so called tracker for this issue? and tag me too smile

thanku

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

You are able to do that yourself Nadirshah - just create an account on the tracker site (which you would have to do to be tagged into it anyway) and add a new issue.

Might have been helpful if you'd said that your user wasn't enrolled on any courses! - if you ask about a course listing for enrolled users being displayed I think its probably reasonable that myself Fernando and Mary (below) all assumed that your user was enrolled in some courses! It would have helped identify potential issues, or allow me to test that option rather than spend the time I have on this! We do our best to help Nadirshah, but we really need full information to do so in any meaningful way!

Richard

PS This is a different thread about the Combo list issue I saw while testing your problem. Please try not to mix threads - it can be confusing enough to follow anyway

In reply to Richard Oelmann

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

true, i myself spent two hours on this thing, diving into dreamviewer "find" option to find the source code for this thing, then decided to move forward ignoring the issue and start enrolling users, that is when i  realised this bug.

I assumed if it displays all courses without the user being enrolled in any course, then it will still display all courses no matter what!

The options clearly states show enrolled courses, so this is clearly a bug. It must not show all courses if the user is enrolled in none.

and yes i did mention this, read the above discussions, it says the

 ""My courses" dropdown shows no courses" for the user 

smile

Thankyou


ya sure will create a bug report

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Agree - you did eventually mention it Nadirshah, but by that time I had already wasted my time fully investigating and testing this for you and was telling you this was not a theme issue - which it isn't.

Anyway, you have found the issue and now need to check whether this is an existing issue on the tracker and if you believe it to be a bug or improvement then post an issue there, preferably with a patch to fix it.

Right now I've wasted the evening on this and don't intend to spend any more time. Enough.

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Jez H -

Hi Nadirshah,

If you are enrolled on any courses (even a single course) it will show only those courses.

If you are not enrolled on any courses it will show all up to the maximum limit you have in your frontpage settings. I cannot remember what the default limit is, but you can control it so that users with no enrollments see a reasonable list instead of an enormous one.



In reply to Jez H

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

but that should not be the case, i want that the user can only and only see the courses he is enrolled in, that it, no other course

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

I attach two screenshots showing you that the solution Richard and me posted yesterday is working well.


Before login:


After login:

screen1






If it is not working in your site, then review the settings.

Sorry but I will not waste more time in something that is obvious is working well and not only in Adaptable.


In reply to Fernando Acedo

Re: Adaptable Theme Support

by judith rantho -

hi.i really want my site to look like that but im failing to upload a picture.it want me to put an url i did and when i save the changes evrything its cool but on my front page before i log in it doesnt show.


In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

It is actually not a bug but by design.  However, there have been a lot of complaints about the feature.  I suggest adding to the tracker as a feature request.

In reply to Emma Richardson

Re: Adaptable Theme Support

by Mary Evans -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

There is an Admin setting in Moodle (somewhere) to either 'Enable' or 'Disable the All Courses list.

In reply to Emma Richardson

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Emma, this is from a long time ago bug (not an issue) because the link is added in the core renderer.

So the question is if it should be added or not. And as someone proposed probably the best would be a new capability instead a setting.

Taking a look in the Moodle Tracker you can see many issues about it and some are really old:

https://tracker.moodle.org/browse/MDL-24634 (2010?! )

https://tracker.moodle.org/browse/MDL-44562


This is one of those bugs that nobody takes care and ends lost in the deep (and dark) Tracker.

From my point of view this is a security bug because some users can gain access to restricted areas. And it should be fixed asap.


PS: the css I posted and many users also commented in the tracker is just a bad workaround (in spanish we have a word to describe it: 'chapuza'). Not a real solution to the problem.

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

As this is NOT a theme issue, let alone an Adaptable one, please can I request that this discussion is continued in a more appropriate forum than the Themes forum.

As I have previously requested this and it has continued here, I have now created the thread in the General Help forum and would suggest any further discussion be carried out there, or in an appropriate tracker item.

https://moodle.org/mod/forum/discuss.php?d=327720#p1317966

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

This is not true. If you select "Enrolled courses" in the Front Page settings then Moodle will display ONLY the courses you are enrolled.

But, and this is for me the issue, still displays the "All courses" link below the enrolled courses.

Add the code I posted before and it will work well.


In reply to Fernando Acedo

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

OK.

Can you say what the issue is? Perhaps I can take a look if there's a (reasonably) simple fix smile

In reply to Richard Oelmann

Re: Adaptable Theme Support

by Nadirshah Ferozepurwalla -

Currently the issue is that all courses link is displayed even if the Hide 'All courses' link box is unchecked.

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Wrong thread Nadirshah - I was asking Fernando what the issue is re the Combo List

In reply to Nadirshah Ferozepurwalla

Re: Adaptable Theme Support

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Yes, you're right. This is a moodle issue and not related with the theme because it is displayed in other themes I tested.

Add this code to the Custom CSS box and will be removed:


.courses > .paging.paging-morelink, .course_category_tree .subcategories > .paging.paging-morelink {
    display: none;
}
Average of ratings: Useful (1)