Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.6.5
-
Fix Version/s: STABLE backlog
-
Component/s: Course
-
Labels:
-
Environment:ANY
-
Database:Any
-
Affected Branches:MOODLE_16_STABLE
Description
An exploitation of metacourse functionality to very easily build well structured courses.
This is so simple yet so useful you'll kick yourselves for not having done it already!
The attached file contains the essence of the code required.
Attachments
-
$i18n.getText("admin.common.words.hide")
- Archive.zip
- 11/Jun/07 11:05 PM
- 2 kB
- Daniele Cordella
-
- pagelib.patch 1 kB
- view.patch 2 kB
- weblib.patch 0.7 kB
-
$i18n.getText("admin.common.words.hide")
- child_courses_v2.zip
- 04/Sep/08 6:22 PM
- 4 kB
- Daniele Cordella
-
- child_courses_v2/.DS_Store 6 kB
- __MACOSX/child_courses_v2/._.DS_Store 0.1 kB
- child_courses_v2/block_child_courses.php 2 kB
- __MACOSX/.../._block_child_courses.php 0.1 kB
- child_courses_v2/lang/.DS_Store 6 kB
- __MACOSX/child_courses_v2/.../._.DS_Store 0.1 kB
- child_courses_v2/.../block_child_courses.php 0.1 kB
- __MACOSX/.../._block_child_courses.php 0.1 kB
$i18n.getText("admin.common.words.show")- child_courses_v2.zip
- 04/Sep/08 6:22 PM
- 4 kB
- Daniele Cordella
-
- courseformat.txt
- 06/Jun/07 11:10 PM
- 3 kB
- Alan Whittamore
-
- courseformat-breadcrumbs.txt
- 07/Jun/07 6:48 PM
- 9 kB
- Alan Whittamore
-
- m18-finalbits.txt
- 02/Jul/07 9:37 PM
- 15 kB
- Alan Whittamore
-
- M18-V3-courseformat-breadcrumbs.txt
- 08/Jun/07 10:14 PM
- 376 kB
- Alan Whittamore
-
- M18-V4-courseformat-breadcrumbs.txt
- 11/Jun/07 10:12 PM
- 376 kB
- Alan Whittamore
-
- M20Super.tgz
- 30/Nov/09 6:55 PM
- 129 kB
- Alan Whittamore
-
- mdl10039text.txt
- 30/Nov/09 6:55 PM
- 3 kB
- Alan Whittamore
-
- moodle18-courseformat-breadcrumbs.txt
- 07/Jun/07 10:05 PM
- 13 kB
- Alan Whittamore
-
- RC1super.tgz
- 24/Sep/10 5:07 PM
- 2 kB
- Alan Whittamore
-
- V2-courseformat-breadcrumbs.txt
- 08/Jun/07 5:04 PM
- 141 kB
- Alan Whittamore
-
- navigation.jpg
- 35 kB
- 07/Jun/07 4:13 PM
-
- sample.jpg
- 37 kB
- 06/Jun/07 11:32 PM
-
- Screenshot.jpg
- 188 kB
- 06/May/10 10:56 PM
-
- screenshotEdit.jpg
- 40 kB
- 12/Jun/07 12:02 AM
-
- ss01.png
- 17 kB
- 07/Jun/07 8:34 PM
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions
Very good idea. Please use this hint to solve problem related to breadcrumb navigation.
With metacourses whatever you try gives problems in the breadcrumbs.
Wherever you put metacourses when you try to return from the child metacourse to the parent course with breadcrumb you have problems.
I tried:
-> metacourses in a hidden category with the same name of the parent course (showing categories in the breadcrumb)
-> hidden metacourses close to parent course (hiding categories in the breadcrumb)
it is never clear where you arrive with the breadcrumb, and you never arrive in the parent course, of course!!!!!!!!!!! ![]()
Thanks for the hint on the breadcrumb problem - not even thought about that!
Anyway I think we can live with this
(see navigation.jpg above)
People are already asking me about using this to share modules between courses.
That may lead to some issues not least of which is sequencing. Currently the course_meta table has no field (or the means to maintain it) to allow different super-courses to have different sequences on intersecting sub-courses. No doubt Mr D can fix that easily enough!
Two warnings and a comment.
The solution to return to the parent course with the "My Courses" block is only a partial solution.
Because if you are enrolled in more than few courses it may not be so clear which one of your courses is the parent of the one you are browsing
Second: it is not possible to add a html block with a link to the parent course because this child course (metacourse) may have more than one parent (may be the child of more than one parent_course)
The right solution should be to change the logic in the header/breadcrumb code of this new kind of course in order to change the breadcrumb to: moodle_site->parent_course->child_course. This is what is not present in your patch. Please add it!!!!!!!!! Ciao and thank you.
Last comment.
> People are already asking me about using this to share modules between courses.
I join thit gruop of people. I am already delivering courses of this kind addind resources type="link to a file or web site" and pointing child metacourses. But I am facing the already explained problems.
Martin assigned this issue to Moodle 1.9... so, probably, the solution is not planned for tomorrow.
Extras for the breadcrumbs (see file courseformat-breadcrumbs.txt)
1st: thank you
2nd: I updated a Moodle 1.8+, 9 days old, and I found two problems.
The first: child courses are not in the central column but on the right. They overwrite the blocks on the right column. I switched the theme to standard but the problem is still present.
See attachment named ss01.png
The second: entering in the child course, the breadcrumb is not correct. I have m18 > child_course instead of m18 > parent_course > child_course.
Yes, the original code is for version 1.6.5, so I'm not surprised it didn't work on 1.8
You can try the 1.8 version in the attached file (moodle18-courseformat-breadcrumbs.txt)
Yes, the breadcrumbs will show as m18->child->Return to parent.
Best I could do for you as an easy fix - a proper job would take longer that I have time for at the moment!
Thank you.
I am now requested by my two children but I'll try it asap.
I was building a home made solution. I'll also post it in order to coompare my one with your one and get the best.
At the end Martin D will only have to implemet the best solution in a moment.
It is six thirty in the morning, here. Babies are sleeping. ssssshhhhhh.
Ok, you are right.
This version works nice with Moodle 1.8
IMO I believe there are very few particolars still to fix.
The first (and less relevant):
for normal/standard courses in moodle18/course/view.php the variable $morebreadcrumbs is not defined until you add
$morebreadcrumbs = NULL;
before your
if (!empty($parent)) {
if (!($parentcourse = get_record('course', 'id', $parent)) ) {
error('Invalid parent course id');
$morebreadcrumbs = array();
} else {
$morebreadcrumbs = array($course->shortname => $CFG->wwwroot.'/course/view.php?id='.$course->id.'&parent='.$parent,'Return to '.$parentcourse->shortname => $CFG->wwwroot.'/course/view.php?id='.$parent, '' => '');
}
}
The second:
the possibility to reorder the child courses inside the parent one in not given and should be added.
The third:
There is no way to add resources and activities to the parent course. This has to be added because, for instance, if I group two child courses to create a parent course what I deliver is the parent and, at the and, I will add test to evaluate user competencies (quizzes) in the parent course. The child courses are tools of the parent. The parent is the course I am delivering and so it is the one I have to evaluate. Quizzes have to belong to parent as far as labels to explain the meaning of the list of child courses, as far as all the resources that can't belong to one specific child.
The fourth (and last):
as you wrote, the breadcrumb has to be elaborate more.
I'll try to work on this points. My limit is that I am not a developer. I have no IDE, and mainly, I have no idea of moodle architecture. My developing tool is the moodle debug level and a unicode text editor.
Ciao e thank you.
Martin. Can be done something to ask you to plan this improvement request for 1.8.1 instead of 1.9? Please, let us know.
Now Daniele, we can't have you waking up the babies can we?
Try the new version (file V2-courseformat-breadcrumbs.txt)
You may have noticed that V2 was only partially working. Well I've found time to dig in further and produced V3! Let me know how it goes. (see file M18-V3-courseformat-breadcrumbs.txt)
I didn't see your release V3 yesterday.
Versione 2 is working correctly and I am taking my time to think about it.
I'll post my impressions as soon as I have somethink more to add.
I go to installa release three.
Thank you.
I am sorry if i tell you this but...
I found somethings that I can't understand.
In the moodle18/course/index.php and in moodle18/course/category.php
you added the pass of the global variable SESSION but then I don't understand how and when do you use it. I am not a dveloper. Maybe their location is correct.
Using the addition I get a notice from Moodle debug. It writes at the beginning of the course/view.php page: "Notice: Undefined variable: parentlink in /moodle18/course/view.php on line 189". Well actually, looking at the code, $parentlink is never used nor called before in moodle18/course/view.php
Moodle18/course/format/super/format.php forces the child courses before the first argument of the parent course. Good. It works correctly but... environmental condition may lead to situation in which it may be better to have links to child courses not in the first/top argument but in a different position. In this way they are forced to be where they are and there is no way to reorder them or to move them to a different place inside the parent course. If my parent course starts with a self assessment I may want to have it before the child courses.
What is really very good is the breadcrumb that is really fantastic.
What I am thinking now is... do we really need this new "static/fixed format" to only get the benefit to have pre-build links to child courses? This is good but the fee to pay is too hight. Where do each child course has to be embedded/linked into the parent course? There is no standard correct position. How much does it costs the tool to reorder child courses? Do we really need it? We already have it in each argument format course if we link child courses manually inside arguments as we already do.
In my opinion what we really need is only the code in course/view.php
if (this course is a metacourse) {
breadcrumb = moodle -> parent course -> child course
} else {
breadcrumb = moodle -> course
}
All the other work can be done manually... even more efficently.
I am in you same condition, I believe. What do you think about?
First let me say it's nice to have you debug my code (and yes there are some)!
I've loaded a new file (V4) which I hope fixes things.
The reason for using the $SESSION->parent is that if you're viewing a subcourse and click on say 'Participants' you need to remember what the parent course is to reconstruct the breadcrumbs. Conversely, if you go to course categories, you need to forget the parent.
You may have noticed that the breadcrumbs in the footer were not correct either (now fixed).
The next step is to have a sequence field in the course_meta table so that when you turn editing on you'll be able to re-order the subcourses.
It may even be possible to move these around Topic sections too!
If we can get to that stage, I think this will be better than manual construction (but you'll always have that option too)!.
Let me tell you what I did.
At the end I'll advance my proposal.
//-> moodle18/course/format/super/format.php
I removed the folder and whatever was inside
//-> moodle18/course/view.php
what I did is in the file view.patch in the zipped file.
//-> moodle18/course/lib.php
I didn't touch it
//-> moodle18/lib/pagelib.php
what I did is in the file view.patch in the zipped file.
//-> moodle18/lib/weblib.php
what I did is in the file view.patch in the zipped file.
//-> moodle18/course/index.php
I didn't touch it
//-> moodle18/course/category.php
I didn't touch it
All is right.
Nothing is missing.
The only problem is that I have to remember to add the last parameter (&parent=xx) to the IP address of the child course inside the resource "link to a file or web poage" of the parent course.
My proposal.
It would be useful if inside the page of the "link to a file or web page" settings (of the parent course) I could find a drop down menu with the list of all child courses of the parent course I am editing. This drop down menu could be located close to the edit field to enter the link of/to the file to link.
The idea: To enter the IP ddress of the resource to link (in the resource type "link to a file or web page") should be to give to the user four options:
-> type the link (option already existing)
OR
-> choose a file by pushing the button "Choose or upload a file" (option already existing)
OR
-> push the button "Search for a web page" (option already existing)
OR
-> select the course you want to include from the drop down menu. (option to add)
By choosing this last option what Moodle add is the IP address of the child course with added "&parent=xx", the id of the parent course
If no children are found the the menu will not be displayed.
This closes the problem, fixes all, avoid the new type of course, avoid the problem of the reorder of child courses and is very simple to develop.
What do you think about?
Yes, I agree you can use the manual approach with what we have now. I'm sure though that my users would find it easier if they had the functionality implied in my screenshotEdit.jpg (sees above).
There is no code yet to do this but that's where I'm headed!
Would you like this too?
As first approach, your solution is faster for end user teacher and more user friendly but...
with my solution I can even modify the argument including the child course.
My solution is more general and less invasive.
With the new drop down menu my solution will become simple to use too!!!!
With my solution I do get all the same new funtionalities that you get and some more with less modification of the code.
Do you agree?
I tried to add the drop down menu in the resource type "link to a file or web page" settings page but it was not simple at all. Can you give me suggestions/hints?
Having thought through this further, I'm now convinced that my original concept for the 'Super Format' is the right choice. The goal was to produce clean, simple, well structured courses. Mixing in Topics is just a bad idea!.
You need to think in terms of course components (the metacourses) which you can assemble into 'Super' courses.
So you want a pre-course asessment? That's just another component.
So you want a post-course Quiz? That too is just another component.
In this way, you can do anything and the Super Format is really just materialising the view of what is in the course_meta table. There will be a need to add a sequence field to the course_meta table and allow the user to maintain the sequence with an interface similar to the screenshotEdit.jpg (but without the Topics!!). For example, you may want to add a new Quiz component right in the middle!
You just move the 'components' up or down.
The breadcrumbs is a nice idea and certainly improves the navigation and should stay. So that's it - nothing else.
I'm also convinced that adding web links manually (even with a drop-down helper) is a bad way to go. What happens if you backup your course and restore it to another system. Your web links will either be pointing at the wrong system or broken altogether. Not much use!
I've attached a file (m18-finalbits.txt) with the final chunk of code to allow subcourses to be moved within the super course (don't forget to add the extra field to course_meta).
I have a working version of this too for moodle 1.6.5+ should that be useful to anyone.
Isn't more easy to create an activity module which represents another course? Such module can automatically enroll students to the given course, provide a link to this course aas view.php and return summary grade from another course as it's grade.
This is more modular solution as it simply allows to mix acitvities and courses in one course.
Oleg you could be right BUT my goal was to get away from the large monolithic course which takes longer to display (using much resource), scrolls 'forever', and takes longer to backup and restore.
Also, the amount of code required to implement this is relatively small and simple. The bulk of the 'clever' stuff was already done in the implementation of metacourses, This just exploits those (albeit in a fashion which is opposite to the original intention).
I've already reapplied most of my changes to 1.9 now that its released and it was even easier than in 1.6.5.
Anyway, as an example you can take a look at http://students.castlecollege.ac.uk/course/view.php?id=8
to see this in action (this is a course as moodle understands it though not a true academic course, but you'll get the idea). This is one of the few 'public' courses I can point you to.
Incidentally, this is one feature our academic staff just won't live without - they love it!
Alan, You wrote: 'BUT my goal was to get away from the large monolithic course which takes longer to display (using much resource), scrolls 'forever', and takes longer to backup and restore.'
It's one of the thing, that I try to achieve using special activity module: you subcourse is just an activity in you parent course, only one string in the course screen (link that get user to this course), and very small amount of meta-data. Using events API such module can automatically enroll/unenroll students to child courses, maintain groups and so on. It can also automatically handle grades from child courses as one grade in parent. I don't see any drawbacks of this approach for you goals (execpt that it isn't implemented yet).
And I don't think that implementation of metacourses is so clever. It has well known issues (metacourses doesn't automatically preserve groups from a parent course for example), so it's not very wise to rely on it. For many real courses we want to preserve groups in child courses.
Oleg, the only downside to what you say is 'execpt that it isn't implemented yet' I have my solution in production TODAY!
I would be keen to explore what you have in mind though.
As for metacourses, if there are issues then shouldn't we campaign to get those fixed?
For now I just hasn't enough time now to implement my solution (I expect it takes not more than a week) - this academical semester is very busy for me (thought I have a student, working on this, but not very bright student), for example I must create new academical course from scratch. Maybe I can find time in several months.
The implementation should be fairly easy, especially if there are events for enrolling/unenrolling of the users and group management. Than simple activity solution can have two options: combo-box with courses (I think, there was places in Moodle where there is such combo-box) and check-box preserve groups. Than view.php must simply redirect users to new course. All enroll/unenroll and group management operations must be done first time when creating activity, and later on per-event basis. Grade must came from summary grade of the course.
As for metacourses, I don't see much perspective for such campaign. Formally this is not a bug, but not implemented feature, so Moodle developers can safely ignore it. And they do that! There are MDL-7675, MDL-8040 and MDL-8041 issues (as well as numerous forum discussions), for this problem, and none of them ever get one comment from Moodle staff for more than one year.
As I see, metacourses is non-modular, awkwardly created solution, which none want to modify or expand, and that maintained more for historical reasons.
During the implementation of this new feature, I feel the attached very basic block will be useful.
I refactored it starting from the original work of Marty Jacobs I found in http://moodle.org/mod/data/view.php?d=13&rid=1723.
I believe that ss far as Moodle core provides the "Section Links" block, it should provide this block too.
Some might be interested in http://docs.moodle.org/en/Subcourse_module
Updates for Moodle 2.0
Please read my notes in mdl10039text.txt
The code is in the archive M20Super.tgz
Enjoy ![]()
Alan.
NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.
Here's a screenshot (see sample.jpg above) showing a course with two sub module courses.
The nice thing about metacourses is that enrolling on this course automatically enrolls the student on the sub module metacourses. All this comes 'for free' too since the relationships are maintained in the course_meta table.
It would be nice (for me) if metacourses could be hidden from students to avoid clutter. I expect others might disagree so a configurable option would be best.
As the icing on the cake, it would be even nicer if backup/restore could deal with such a hierachy of courses as a single unit.