Course Categories and SubCategories

Course Categories and SubCategories

by Catalin Zmole -
Number of replies: 30
Hey,

I want to know if is possible (and if the answer is "yes" - how to do that ?!) to make subcategories to courses, for example:

Faculty of economics
 - Graduate studies
       - Course 1
       - Course 2
 - Postgraduate studies
       - Course 1
       - Course 2
By default courses are displayed like tree-view but the thing that I want to do is:
on the frontpage I should have only Faculty of economics and when I click on it to open "Graduate studies" and "Postgraduate studies". How can I do this ? smile

Thank you smile
Average of ratings: Useful (1)
In reply to Catalin Zmole

Re: Course Categories and SubCategories

by Rico Dredd -

Use Course category view on front page in Admin menu /Frontpage setting if not already.

Add this configuration variable 

$CFG->max_category_depth = 2;
to your config.php file.

Then use sub categories to sort out your structure, change depth to the setting you require.

Rico

In reply to Rico Dredd

Svar: Re: Course Categories and SubCategories

by Anders Berggren -
Hi,
I'd also like to have more levels. Not just one
category and then courses under that. I'd like to
be able to create subcategories like e.g.:

Category: English courses
Subcategory 1 - courses on different levels
English - beginners
English - intermediate
Subcategory 2 - major parts of a course
Talking
Subcategory 3 - parts of parts
Conversation
Discussion
Making speeches
Reading
English - advanced

I tried inserting the extra code you suggested
in my moodle/config.php but I didn't find any
administrative tools for adding any subcategories.

What to do? Grateful for help,
Anders B
In reply to Anders Berggren

Re: Svar: Re: Course Categories and SubCategories

by Rico Dredd -

Right you can't have subcategories inside courses as such only outside. Outside courses are via the edit page for all courses where you create new subcats.

So to recap Home page to All courses to Editing On and then Add new subcategory.

Hope this clears it up a bit?

Rico

In reply to Rico Dredd

Re: Svar: Re: Course Categories and SubCategories

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
Hmm, I don't see an "Add new subcategory" in Administration >> Course categories. thoughtful

However, it's possible to add sub-categories (and sub-sub-categories) by adding a new category then using the "move category to" drop-down to move the category inside another category (please see screen shot below).

I've not needed to edit config.php either (using Moodle 1.5.2) thoughtful What version are you using Rico?
Attachment course_categories.jpg
In reply to Helen Foster

Svar: Re: Svar: Re: Course Categories and SubCategories

by Anders Berggren -
Very neat smile! Thanks Helen.
This may be:
  • a technical issue
  • a pedagogical issue
  • an administrative issue
  • a usability issue

To me however this is more to do with the possiblity of applying
Information Architecture principles in Moodle. This I think
will be essential when Moodle is put into a mature practice
on a large scale. So even if this solution helped me proceed
- more needs to be done about this.

Cheers, Anders
In reply to Helen Foster

Re: Svar: Re: Course Categories and SubCategories

by Rico Dredd -

Doh yes can add new categories not subcategories but yes can make them subs by moving anyway.

The PHP tweak is for when you only wish to display the top level courses on the "Front page format Show a list of categories". Still valid else you see the courses and subs I think?

Rico

In reply to Rico Dredd

Re: Svar: Re: Course Categories and SubCategories

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
Rico, thanks for your reply. I realise that I didn't read the first post carefully enough! blush Anyway, I understand now, thanks. smile
In reply to Rico Dredd

Re: Course Categories and SubCategories

by Marion de Groot -
Rico I've used your tweak and got the front page showing all I want it to show. But now, on the underlying pages there is a selectbox, with all the categories! Now I would like to tweak that selectbox too, to make it show only the main categories, like my frontpage... Any ideas?
In reply to Rico Dredd

Re: Course Categories and SubCategories

by Catalin Zmole -
Thank you all for the advices, really helpfull and much appreciated.

I would like to ask one more thing: do you know if is possible to create a course in a category and on other category to have a link to the same course?\

Thank you.
In reply to Catalin Zmole

Re: Course Categories and SubCategories

by João Almeida -
I you would also like to know how to do that. If someone has the answer please come forward.

TIA,
João
In reply to João Almeida

Re: Course Categories and SubCategories

by Timothy Takemoto -
Catalin Zmole and João Almeida
> Do you know if is possible to create a course in a category and on other category to have a link to the same course?
Please see this post
http://moodle.org/mod/forum/discuss.php?d=32225&parent=159193
for my redirect course type. Only trouble is that the student will be left in two courses since the link is a course.
In reply to Timothy Takemoto

Re: Course Categories and SubCategories

by Chris Collman -
Picture of Documentation writers
Hi Timothy, Catalin and João,

Some creative linking using html seems to work in the course title.  Can't say much about sub catagories, but redirects seem  to work fine on my localhost.  Since student never gets to the course screen, they never enrol in the "fake" course in the "wrong" catagory.

Timothy suggested and I gave an example here on Oct 3, 2006
http://moodle.org/mod/forum/discuss.php?d=32225&parent=159193

Hope this helps

In reply to Chris Collman

Re: Course Categories and SubCategories

by Timothy Takemoto -
Thanks Chris

Ah, that is a cool idea. No need for the redirect course and to hack my courses.

Why didn't I think of that sooner.

Tim
In reply to Timothy Takemoto

Re: Course Categories and SubCategories

by Chris Collman -
Picture of Documentation writers
Tim,
I've mentioned this before elsewhere.  But I am running into lots of creative uses of linking that are really turning my head around in the last couple of weeks.   

*There was the Library(aka Course) of Lessons and resources idea that uses links from within another courses for standard refreshers or what ever
*There was (this one) about "course short cut" or course redirect
*The use of links to create an index of lesson pages, instead of branch table jumps gives endless possibilities of groupings
*Or indexes created on different resource pages using links that direct to courses, activities, resources on the Moodle site.
*What about use of certificates and activity locking and a links that essentially makes one course dependent upon another.

Yeah, why didn't we think of those?  Bless the new users who have not put themselves in a pre-defined Moodle box.  As the Rockman said to Oblio in The Point, "you see what you want to see" smile

Guess I better post those in tips and tricks.  BTW you are pretty good at stepping out of the box with creative solutions. 

Chris




In reply to Rico Dredd

Hide SubCategories on Front Page

by Lizzi Mills -

Hi all,

Could someone please let me know where I can find the file in which I need to make the change outlined by Rico above? I'm using 1.8 and would dearly love to use SubCategories, but I absolutely don't want them cluttering up my front page!

Hope someone can help!

Lizzi

In reply to Lizzi Mills

Re: Hide SubCategories on Front Page

by Feike Dirks -

Hi Lizzi,

I think it is like this:

* look for the file config.php in the root directory of the Moodle installation
* add the line $CFG->max_category_depth = 1;  to this file (I've placed in on line 18, that seemed the most logical choice)

This worked for me.

Regards,

.feike.

In reply to Feike Dirks

Re: Hide SubCategories on Front Page

by Sarah McClure -

I was trying to do this as well as I would love to have subcategories without them showing on the Front Page. However, I keep getting this error when I try to insert the line :

Parse error: parse error, unexpected T_VARIABLE in C:\Inetpub\wwwroot\config.php on line 19

I am not very familiar with PHP so I am sure that I have just done something wrong. Any suggestions?

Thanks. Sarah

In reply to Sarah McClure

Re: Hide SubCategories on Front Page

by October Smith -

I am not familiar with PHP either, but this is how mine looks:

$CFG->directorypermissions = 00777;  // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");
$CFG->max_category_depth = 2
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.

In reply to Sarah McClure

Re: Hide SubCategories on Front Page

by Jeffrey Silverman -
Hi. Coming to this thread a little late, but better late than never, right?

In PHP, "Parse error" means "Syntax error". Basically, something is incorrect in the syntax of the line. Those things could be a missing semicolon at the end, an extra or missing single or double quote, or similar.
In reply to Rico Dredd

Re: Course Categories and SubCategories

by Oliver Neumann -

Hi Rico,

thank you for your answer, but $CFG->max_category_depth = x; only takes affect on the "Course Categories" block, not on the "Courses->Add/Edit courses" controls

Oliver.

In reply to Rico Dredd

Re: Course Categories and SubCategories

by Elaine Batiste -
I want to hide subcategories on the front page but don't know how to find the config.php files.

I am moodle admin for my school but my Moodle is hosted by our Local education authority - can I edit PHP remotely, if so can anyone show me how? We're using version 1.8.

Thanks
In reply to Catalin Zmole

How to hide sub categories in moodle front page??

by Maths User -
Hello,

How to hide sub categories in moodle front page??

Please tell me if any one know?

I tried to edit this code in index.php. But no success. If any one know please tell me.

case FRONTPAGECATEGORYNAMES:

print_heading_block(get_string('categories'));
print_box_start('generalbox categorybox');
print_whole_category_list(NULL, NULL, NULL, -1, false);
//print_whole_category_list(NULL, NULL, NULL, -1, false);
print_box_end();
//print_course_search('', false, 'short');
break;

case FRONTPAGECATEGORYCOMBO:

print_heading_block(get_string('categories'));
print_box_start('generalbox categorybox');
print_whole_category_list(NULL, NULL, NULL, -1, true);
print_box_end();
print_course_search('', false, 'short');
break;

case FRONTPAGETOPICONLY: // Do nothing!! smile
break;

In reply to Maths User

Re: How to hide sub categories in moodle front page??

by Nisha Shirawala -
Hi,

We can hide subcategories on the front page without modifying php code.
Please follow below mentioned steps

1. Login to moodle as an admin.
2. In the "Site Administration" block, Click on "Front Page -> Front Page Settings"
3. Look for parameter "Maximum Category Depth", change its value to : 1
4. "Save Changes" and you are done.
5. Now Front page should only display Main Categories.

It worked for me. Hope this helps.

Thanks.
In reply to Nisha Shirawala

Re: How to hide sub categories in moodle front page??

by Vassilios Ioannidis -
Hello,

This works nicely but it is not only for the front page.

After you edit the front page settings and change the Maximum Category Depth to 1,
sub categories are hidden on the front page

But when you follow the 'All courses ...' link, something like:
http://moodle.yourdomain.com/course/index.php

The sub categories are also hidden! But on this page, it would be nice to all the sub categories. Is this possible ?

Thanks for any suggestion.
In reply to Vassilios Ioannidis

Re: How to hide sub categories in moodle front page??

by Rosario Carcò -

Have a look at myCourses and siteNavigation Blocks. Code could be customized to show in a ComboList or in the central area on the FrontPage or simply anywhere you like, even in a separate "all courses" List of your own.

myCourses: http://moodle.org/mod/forum/discuss.php?d=67494

siteNavigation: http://moodle.org/mod/forum/discuss.php?d=103703

Have a look also on my TestServer, where I use another neat category/courses Menu which opens horizontally (from Kevin Treussier). That's why I can not use it, because our large scale site with more than 4'000 courses deeply nested in more than 1'000 categories would scroll infinitely to the right.

TestServer: https://moodle.fhnw.ch/moodleTest

production: https://moodle.fhnw.ch

So I created the siteNavigation out of the myCourses Block which both show hierarchical nested folders.

Actually I am recoding to show both in a popUp-window to have more space than in the 210 Pixel wide Blocks.

Rosario

In reply to Nisha Shirawala

Re: How to hide sub categories in moodle front page??

by alejandro ramirez -
Thanks Nisha Excelent
In reply to alejandro ramirez

Re: How to hide sub categories in moodle front page??

by thulasi raman -

My category/course structure is as follows -

MS Program (CATEGORY)

Semester - 1(SUB-CATEGORY 1)

----- containing 4 courses

Semester - 2 (SUB-CATEGORY 2)

-----  containing 4 courses

My requirement is to upload the entire syllabus(4 Semesters) saved as a pdf file at the MS program category level. Is it possible ? Else where can it be done?