6 new course formats!

6 new course formats!

by Marty Jacobs -
Number of replies: 68

I've created a family of 6 simple course formats to improve communication in courses and combat the 'scroll of death'! These formats work with Moodle 1.9, but could easily be adapted to work with earlier versions (if there is demand for this I wouldn't mind doing the necessary work).

Here's a summary of what each new format does:

  • Noticeboard format - This format is similar to the Social format. It displays the latest post from the News forum at the top of the course home page (only one post is displayed). There is also a 'topics' area below the noticeboard, allowing you to add activities and resources to the page.
  • Activities format - Automatically generates links to activity types in the main content area (middle column) like the Activity modules block does. Avoids the need to create lots of links on the course home page, thus saving your users from the 'scroll of death'!
  • Noticeboard/activities format - This is simply a hybrid of the two courses above.
  • Meta format - Automatically provides links to the child courses associated with a Meta course.
  • Meta noticeboard format - A combination of the Meta and Noticeboard formats.

Demos of the formats, along with the download for the 6 formats, can be found here.

Hope you find them useful,

Marty

Average of ratings: Useful (1)
In reply to Marty Jacobs

Re: 6 new course formats!

by A. T. Wyatt -
Greetings, Marty!

I will be interested to try these out. You might put a link in the modules and plugins database. People often look there for new add-ons!

atw
Average of ratings: Useful (1)
In reply to A. T. Wyatt

Re: 6 new course formats!

by Marty Jacobs -

Thanks for the suggestion. I've added the formats to the Modules and Plugins database. Look for the MAN course formats (stands for Meta, Activities and Noticeboard course formats).

Marty

In reply to Marty Jacobs

Re: 6 new course formats!

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
Hi Marty,

Thanks a lot for sharing your new course formats and for adding them to the Modules and plugins database. approve You may like to read our guidelines for contributed code for suggestions on supporting, maintaining and evolving code.
Average of ratings: Useful (1)
In reply to Helen Foster

Re: 6 new course formats!

by Marty Jacobs -

Thanks for the link. I shall try and do all the things suggested on this page.

Marty

In reply to Marty Jacobs

Re: 6 new course formats!

by David Brighton -
Hi Marty, good work, these look really useful! I like the idea of being able to show the message forums in a more useful layout on the course page like your formats use. I am struggling away trying to work out how to adapt it so as to show forum messages in one of the other sections rather than in section 0 and then allow 'traditional' layout or resources etc in the remaining sections. Not having much luck but will feed back if I get anywhere.

Thanks again

David
In reply to David Brighton

Re: 6 new course formats!

by Jaap Marsman -
Hi Marty,

Just installed your 6 formats into our Moodle and it's working like a charm. However, is there an easy way to edit the Noticeboard-Activities format? At the moment it's only showing 1 noticeboard-message. I did change the Settings to 3 but apparently these things aren't linked. Even some hard-coded changes would be welcome if you could point me in the right direction.

Other than that, thanks for this!!
In reply to Jaap Marsman

Re: 6 new course formats!

by Jaap Marsman -
Solved my own problem!

In line 95 I changed

forum_print_latest_discussions($course, $forum, 1, 'plain', '', false);

to

forum_print_latest_discussions($course, $forum, 3, 'plain', '', false);
In reply to Jaap Marsman

Re: 6 new course formats!

by Marty Jacobs -

Yep, that's the way to do it! Sorry for not replying - I'm trying to check these forums on a more regular basis now smile

I'm currently tidying these course formats up. How are you getting on with the formats?

Marty

In reply to Marty Jacobs

Re: 6 new course formats!

by Marty Jacobs -
I've just updated the MAN course formats by incorporating two of the requests from this thread. Hopefully, these small changes will make the formats more flexible.

You can now display more than one post when using the noticeboard format (or variants) by changing the $numposts variable in config.php for the relevant format.

You can also add a section zero to the Noticeboard and Meta noticeboard formats by setting $seczerohidden to true in config.php for the relevant format.

I've also updated all the Meta formats, so that if you apply it to a child course, a list of accociated meta courses will be displayed.

See moodle.martyjacobs.net/courseformats for working demos.

Marty

P.S. CV copies of these files haven't been updated yet - I'll do this once I'm grated access.
In reply to Marty Jacobs

Re: 6 new course formats!

by Robert Sturgess -
Hi Marty,

I noticed in the Noticeboard format demo that there was an equivalent to the 'topic outline' of the topics format. It's a section that appears just below the announcement. However, even logging in as teacher, it appears you can't edit the contents of that section. Presumably, this is 'section zero'. Ideally, I would like to keep the topic outline section. The contents of the topic outline section do appear in the Noticeboard/activities format, under the "All activities/resources:" (although not the label I had created in topics format), but I would like them in the regular noticeboard format. If my words aren't clear, please ask for screenshots.

Many thanks,

Robert.

In reply to Robert Sturgess

Re: 6 new course formats!

by Marty Jacobs -
Hi Robert,

I might be miss-understanding you here, but you should be able to edit the "section zero/topic outline" area in the Noticeboard format demo. I've just logged in (username: megaman, pw:nintendo) and it worked for me. What didn't work for you?

In the noticeboard/activities format, only teachers can access "section zero" - this is where you have to add all course resources and activities. Students then access these items via the individual pages that list resources by type, e.g. forums, resources, quizzes.

If you want to create a mock-up of what you're after and post it here I'll try by best to help you.

All the best,

Marty
In reply to Marty Jacobs

Re: 6 new course formats!

by Robert Sturgess -
Thanks Marty, I had another look, and it's all good. I think I was just being a tool yesterday. Thanks for your help and sorry,

Robert.
In reply to Robert Sturgess

Re: 6 new course formats!

by Marty Jacobs -
No problem Robert. The different variant formats are quite confusing when you first look at them because they all do the same thing in a slightly different way.

Let me know if you need any additional help with them.

All the best,

Marty
In reply to Marty Jacobs

Re: 6 new course formats!

by Michael Jenkins -
Hello,

I am interested in this but we are looking to moving toward moodle 2.0 as soon as it arrives and would like to know if these will be compatible with it?
In reply to Marty Jacobs

Re: 6 new course formats!

by Mike Tilley -
Hi Marty

I installed the courses and they work very well - Thank you. I have 1 small issue with them which is potentially stopping our staff from using the format (it is only a minor issue). On our Moodle sitte we have ajax course editing turned on but it doesnt work with the noticeboard format, is there a way of getting it to work?

Thanks in advance

Mike
In reply to Mike Tilley

Re: 6 new course formats!

by Mike Tilley -
I have found a work around, it seems that ajax doesnt work if there is no section 0 on the page. So on line 154 of format.php where it says

$section = 1;

I changed it to

$section = 0;

This shows the news topic like a normal course then all I needed to do was hide that section.

Hope this makes sense

Mike

P.S. if there is a better way of doing this then please let me know.
Average of ratings: Useful (1)
In reply to Mike Tilley

Re: 6 new course formats!

by Marty Jacobs -

Yes you're right, a hidden section zero does cause problems with Ajax. Mike, your solution works fine, I'll modify the downloads so this no longer happens.

Speaking of which, I'm currently updating these formats for Moodle 2.0 also. I've had a few requests for the Noticeboard format, so I've converted this one first and attached it to this post, for those eager to upgrade. The rest of the formats will follow shortly, after I've got my head around how the Meta functionality has changed wink

I've tested the new format briefly and it appears to work fine in a clean install of Moodle 2.0. Let me know if you have any questions or problems using it (I promise I'll be better and reply to your messages!).

Marty

In reply to Marty Jacobs

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.
In reply to Deleted user

Re: 6 new course formats!

by Marty Jacobs -

Yes, I was being lazy. I shall fix this.

Thanks,

Marty

In reply to Marty Jacobs

Re: 6 new course formats!

by Marty Jacobs -

All course formats are available for Moodle 2.0 now, see following link:

http://moodle.org/mod/data/view.php?d=13&rid=1717

Please report any issues you have with these formats in this thread.

Best,

Marty

P.S. Custom strings are now in correct lang files and Ajax works correctly with all the formats too!

In reply to Marty Jacobs

Re: 6 new course formats!

by William Mair -

Marty,

I tried clicking on that link but it says that this has not yet been approved.

However, I am looking for a copy of the 1.9 file rather than the 2.0 one (if that's different).

Any way that I could get access to this?

Thanks

In reply to Marty Jacobs

Re: 6 new course formats!

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

Hi Marty,

Thanks for this Plugin which I am finding quite facinating.

Just a few things which need fixing...
any chance you could add a few lines on how to Install this plugin?  Not everyone is a coder. smile

Also I found that one of the $strings in format_metandact.php has have not been coded correctly in format/metanbact/layout/format.php

you have this...

- echo $OUTPUT->heading(get_string('rcourses', 'format_m')

but it should read this...

+ echo $OUTPUT->heading(get_string('rcourses', 'format_metanbact')

I have not checked them all yet but if I find any more I'll let you know here!

Cheers smile

Mary

In reply to Mary Evans

Re: 6 new course formats!

by Gary Newport -

Thanks for the fix to rcourse, Mary. As regards the install instructions, it is far simpler than you define. You simply need to copy the COURSE folder into the root of your Moodle installation. This will then update all relevant files (there is already a course folder, so this becomes an update).

One thing I have is that under Topic Outline I have Topic 0 box ready for content, followed by the All Activities box and finallt the Orphaned Activities box. I can see content in the first and last box but when I switch off the edit mode neither of these two appear.

I have, in Topic 0, added the caption General Information and this appears but none of the actual documents do. Why is this?

In reply to Gary Newport

Re: 6 new course formats!

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

You are welcome Gary.

With regards your question, if you are asking me Gary, I have NO idea!

I'm getting some errors with the Noticeboard format and Noticeboard Meta Activities format as the two seem to be sharing some code, and when I tried to delete one of my courses, Moodle would not let me, so I ended up deleting it directly from the DB. Now I am having the same problem with the Noticeboard on its own.

So I am guessing there are a few bugs with this plugin, and Marty does not seem to be about, to ask!

Mary

 

 

In reply to Mary Evans

Re: 6 new course formats!

by Gary Newport -

I haven't been able to delete any of my courses but not too sure if this is due to this plugin or not. I hadn't made the connection!

In reply to Gary Newport

Re: 6 new course formats!

by Gary Newport -

I have gotten a little closer to finding out why I cannot delete courses. I am currently getting the following error:

Fatal error: Cannot redeclare callback_nb_uses_sections() (previously declared in /var/www/vhosts/bexhill-vle.co.uk/httpdocs/course/format/nb/lib.php:33) in /var/www/vhosts/bexhill-vle.co.uk/httpdocs/course/format/nbact/lib.php on line 34

I believe this may be down to this module since this is not a common fault with Moodle and this is the only course factor I have installed.

I don't want to delete this since it is so useful for meta-courses. Any ideas?

In reply to Gary Newport

Re: 6 new course formats!

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

course/format/nbact is a custom course format plugin that you must have installed, and it is faulty.

In reply to Tim Hunt

Re: 6 new course formats!

by Gary Newport -

I do agree Tim; it is a part of this very plugin.

The thing is, as Mary says, it is an interesting plugin that has some really useful elements. I for one like the Meta-Activity-Notice layout since it does what I feel should be a standard part of Moodle - allows the meta-courses to be shown naturally through the child course.

I suppose the next part is to find out what is actually wrong with this part. I'll reinstall just in case it's simply a faulty install but maybe someone else could check that they can delete a course?

In reply to Gary Newport

Re: 6 new course formats!

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you look, the problem seems to be that the nbact plugin is defining a function called ..._nb_... where it should probably be ..._nbact_..., and that is what is causing the name collision.

In reply to Tim Hunt

Re: 6 new course formats!

by Gary Newport -

Funnily enough I had just undertaken that very modification when I came back to re-look at the error code in my own posting.

I'm going to need to clear the cache and try again but yes, that would seem the most logic change to the function.

What other things did you find Mary? The original builder seems to have vanished but maybe we can resolve these all. I am trying to avoid doing too much investigation into Moodle plugins since I have too many websites and phone apps to maintain at the moment anyway. But this could be fun!?

In reply to Gary Newport

Re: 6 new course formats!

by Gary Newport -

Yippee!

Okay, ALL the functions in the lib.php in nbact were wrongly named and as such would cause the invisible error. I have corrected all these functions and I can now delete courses!

So, if you can let me know what other issues we have maybe I can begin to slowly look into these. I know I have the non-invisible invisible topic issue but that's a slight annoyance rather than an error (as such).

In reply to Gary Newport

Re: 6 new course formats!

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

Check out 'metanbact' and the function name there has been abbreviated to 'm'

Like you say Gary this might be fun. LOL

Cheers

Mary

In reply to Mary Evans

Re: 6 new course formats!

by Gary Newport -

The issue I have is;

Where is the calling routine for these functions?

Simply renaming them may not be a solution if the calling routine is hardwired for the original or alternative name. If the calling routine uses the folder names (this would seem far too complex than it need be) then your example Mary would then fail to work. Renaming has seemedly not had a negative effect anywhere and I can now delete all courses and categories.

Tim, can you help here?

In reply to Gary Newport

Re: 6 new course formats!

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

Hi Gary,

I have had other experiences with renaming functions when creating custom settings pages where we use functions from output renderers in a renderers.php and similar coding in a themes lib.php. In themes the function has to be related to the themename which is the same name found in LANG/EN/theme_themename.php so using the same logic, the function in this case should follow the same pattern. lang/en/format_metanbact is correct name of the Plugin. Whereas

function callback_m_uses_sections() {
    return true;
}

Is incorrect and should read...

function callback_metanbact_uses_sections() {
    return true;
}

same here...

function callback_metanbact_load_content(&$navigation, $course, $coursenode) {
    return $navigation->load_generic_course_sections($course, $coursenode, 'topics');
}

So the same will apply to all the other plugin lib.php files in the set.

That is why we were getting the ERROR messages.

I may not have explained this properly...but I am 99% sure I am right.

Cheers

Mary


In reply to Mary Evans

Re: 6 new course formats!

by Gary Newport -

You have explained it perfectly; thank you.

I had explored all but the lang files and had assumed something far more complex as a solution - so this is a nice surprise!

What I propose Mary is that, unless we hear from the current developer, I'll make those adjustments on my copy and update the files. Then, if you could let me know of other issues, improvements you would like to see, etc then we could build a to-do list and take on one at a time; with maybe you taking on one of them and I'll take on another?

In reply to Gary Newport

Re: 6 new course formats!

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

Hi Gary,

Sounds like a plan! I'm game...however my PHP skills are pretty basic, but as I have found getting stuck into 'fixing' themes in Moodle is the only way to learn more so count me in.

I updated all the lib.php files last night and then ran a little check to see if I have caught all the wrongly names functions. A quick scan thru made me confident that I had covered all aspects. Then in one further check I stumbled on a get_string item in course/format/metanb/format.php which sighted "format_nb" as the LANG file where the get_string can be found.

Line 77 in course/format/metanb/format.php

echo $OUTPUT->heading(get_string('noticeboard', 'format_nb'), 2, 'headingblock header outline');

Which is fine if you have the full set of plugins, but someone may just want 2 or three of the "6" available plugins. So I added the $string['noticeboard'] = 'Noticeboard'; to course/format/lang/en/format_metanb.php for consitancy's sake.  and changed the above code in Line 77 to...

echo $OUTPUT->heading(get_string('noticeboard', 'format_metanb'), 2, 'headingblock header outline');

It's these little things which can send out those 'WARNING' error messages when debugging is enabled. This happens a lot in themes.

I'm letting you know this in case you want to do the same. smile

Cheers

Mary

In reply to Mary Evans

Re: 6 new course formats!

by Gary Newport -

Your later statements do not support your initial statement. ! clown

When I get home I'll have a look through this and see if I can get my head around it.

In reply to Gary Newport

Re: 6 new course formats!

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

Was that my comment about WARNING errors and such?  You will get an error IF and ONLY if someone uses a plugin which is pointing to another plugin with get_stringwhere the 2nd plugin is not present in the Moodle instal. So the best thing to do is make sure the $string is in the lang/en/format_pluginname.php.

Sorry for confusion...however this gets better when you introduce lang/fr/format_pluginname.php where all the strings need translating! LOL

Cheers

Mary

In reply to Mary Evans

Re: 6 new course formats!

by Gary Newport -

Sorry for the long delay in responding; work!

No, my comment was based upon your statement that your php was basic and yet your coding instructions are very clear, precise and shows a very good level of detail.

Also, are you not the Mary of Aardvark-Postit? If so, I am further grateful to you since this is our theme of choice!

I have made these changes and will hopefully spend some of this week going through this code to make sense of it and make some tidy ups if so needed.

In reply to Gary Newport

Re: 6 new course formats!

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

Ah...another Aardvark Post-It fan! Thanks I love to hear about where my themes have found a home.

The number of little typos (as I prefer to call them) in these individual plugins are quite hard to catch, as some are being miscalled in the get_string elements too, so be on your guard. If a get_string is pointing to a language string in another plugin's lang/en/format_anotherpluginname.php, this is wrong as it could be you might not have that particular plugin so make sure any reference to anything outside of the plugin folder you are working on is referenced correctly.

Cheers

Mary

In reply to Tim Hunt

Re: 6 new course formats!

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

Gosh you two are quick...I was just checking this and about to write and ask you if this is the problem.

I have just been checking this. Nearly all the lib.php files are affected. Thanks Tim for clarifying what I suspected was the problem. 

Cheers

Mary

In reply to Gary Newport

Re: 6 new course formats!

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

Hi Gary,

I have deleted the plugin as it was casuing more and more problems. It is faulty and most probably casued by some code being used in one or even all of the other course formats in this set. Perhaps it is that you can ony use one. Who knows?

I only have a small localhost setup with minimal courses, and not much data so I deleted the course directly in the Database. I suppose that is not the correct way to go about things but it worked for me.

Cheers

Mary

In reply to Marty Jacobs

Re: 6 new course formats!

by ashwath venk -

I am finding it difficult to install the zip folder has only 1 file. Please help me

In reply to ashwath venk

Re: 6 new course formats!

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

Hi,

Since downloading this plugin, which I am finding facinating as it's the first plugin that I can understand, I have just come accross a missing $string which I have managed to fix.

However, the disapointing part of this plugin is that there are no "install" instructions, so I had to go and read some other related plugins to get this one to work, but once I found out how to install this one it all fell into place.

This is what you need to do...

1. DOWNLOAD THE PLUGIN

2. EXTRACT ZIP TO DESKTOP: this is the part where it gets a little fuzzy...the one folder called 'course' contains another folder called 'format' inside format are the 6 directories you need to upload to your server...so...

3. UPLOAD CONTENT OF course/format TO moodle/course/format/

And that's it...easy peasy! smile

HTH

Mary

In reply to Marty Jacobs

Re: 6 new course formats!

by Steve Towson -

Thanks for these formats.  Since the metacourses block doesn't work anymore, the metacourse format fills the gap.  I have one issue:

Just suppose I'm a student.  The meta links at the bottom sometimes link to courses that I am not enrolled in.  Is there any way to limit the display of metacourses to those that the current viewer is actually enrolled in?

Thanks in advance.

In reply to Steve Towson

Re: 6 new course formats!

by Gary Newport -

I am not too sure how you are using this and where; since if you are using this at the child course level then you must be enrolled in the meta-courses by default.

You create your meta-courses independently of anything and then build your base course. So, we have a website development course that we enroll all the students into. I would then enroll each of the meta courses into that course (HTML and CSS, PHP and mySQL, etc). As I enrolled the meta-courses, all students enrolled on to the website development course would automatically enrolled into these meta-courses. Therefore they would be able to see them.

I know I am probably telling you something you already know but hopefully you can clarify where you differ from the above I may be able to generate a solution to your issue.

In reply to Gary Newport

Re: 6 new course formats!

by Steve Towson -

Here's the scenario.

Students enrolling in Course A are automatically enrolled in Module 1, Module 2 and Module 3.

Students enrolling in Course B are automatically enrolled in Module 1, Module 4, and Module 5.

Module 1 is common to both Course A and Course B.  When a Course A Student views the Course A course, they get the links to the appropriate meta courses at the bottom. That's great.  If they go into Module 1, at the bottom of the page they have a link back to both Course A AND Course B, even though they're not enrolled in Course B.

Can you help?

In reply to Steve Towson

Re: 6 new course formats!

by Gary Newport -

Ah, I now see! I have not used these formats in that way; using the meta course structure only to allow a connection from A to it's meta-courses and not the other way around.

So, the answer is of course it is possible; everything is possible. How easily I have no idea but I will have a look and get back to you - unless Mary wants to beat me to it! clown

In reply to Gary Newport

Re: 6 new course formats!

by Steve Towson -

That would be fantastic.  I would buy either or  both of you a virtual beer.

In reply to Gary Newport

Re: 6 new course formats!

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

I'd be interested to see how one would do this. I tend to learn from example. smile

Mary

In reply to Mary Evans

Re: 6 new course formats!

by Steve Towson -

Hello Mary.

Interested in seeing ?

  • problem solved
  • beer produced
  • use of this format to show child courses
Please advise.
In reply to Gary Newport

Re: 6 new course formats!

by Steve Towson -

Hello, I was wondering if you had managed to take a look at this issue?

Thanks

Steve

In reply to Steve Towson

Re: 6 new course formats!

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

Hi I have fixed what I believe was the problem.

I've attached the ZIP file here if you want to try it out.

Cheers

Mary

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

Re: 6 new course formats!

by Steve Towson -

Thanks so much Mary!  I'll have a look right now and see how it goes.

 

Steve

In reply to Mary Evans

Re: 6 new course formats!

by Steve Towson -

Thanks for that, Mary, but it didn't make any difference to the situation.

I've attached a screenshot of the issue.  A student is enrolled in Certificate III in Aged Care which comprises of three units:

  • CHCAC318A Work Effectively with Older People
  • CHCICS302A Participate in the Implementation of Individualised Plans
  • CHCICS303A Support Individual Health and Emotional Wellbeing 
The units are all metacourses, with Certificate III in Aged Care being their child.
There is also a Certificate IIin Aged Care which consists of the single unit 
  • CHCAC318A Work Effectively with Older People
but the student is not enrolled in Certificate II.
When the student is in the CHCAC318A Work Effectively with Older People course, a link is shown back to Certificate II, even though the student is not enrolled in that course.
I'd like only links to courses where the student is currently enrolled.
Do you think that is possible?
Steve
Attachment too-many-children.png
In reply to Steve Towson

Re: 6 new course formats!

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

Hi Steve,

When you added the new folders did you delete the older set?

Also after having adding this new set of course formats and after loging in did you by any change purge the system of it's cache? Site Administration > Development Purge all caches.  This is VERY important as the new formats will not work correctly, I see that there is a missing srtingname already!

You will also need to manually purge the moddledata cache of it's lang files.

so that's moodledata/cache/lang/en/format_filename.php (where file name is the name of the fomat you are using...so there may be quite a number but the one you need to delete are only the 6 from the set. It is sfae to delete theme here as they regenerate themselves afresh).

After all that...your formats should work better.

Tell me if that makes any difference?

Thanks

Mary

In reply to Mary Evans

Re: 6 new course formats!

by Steve Towson -

Hi Mary.

Thanks so much for all your work, but clearing all caches as instructed did nothing.  Same issue exists.

The missing string occurs in the meta course format, but not in any of the others.

A student still see child courses they are not enrolled in.

Sorry.

 

Steve

In reply to Steve Towson

Re: 6 new course formats!

by Steve Towson -

Hello Mary,

Have you had another opportunity to look at this?  I know I'm a pain, but this is a bit of a show-stopper for my school.

Steve

In reply to Steve Towson

Re: 6 new course formats!

by Steve Towson -

Hello Mary and Gary.

I was wondering if either of you had had a chance to look at this yet.  Sorry to be a bother.

Steve

In reply to Steve Towson

Re: 6 new course formats!

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

Hi Steve,

Sorry to keep you waiting, although I am not a developer as such, I do know how to fix errors in this sort of scenario, which is similar to fixing errors in theme code, which is what I am best at.

Altering a course format to make it do something else is really beyond my expertise/abilities at this present moment in time, so sorry if I have mislead you in this respect.

The more I look at these formats, however, I do see a similarity to the work we do with renderers and custom settings et al. in themes, so if I were to sit down and study the course format code in more detail I would perhaps be able to figure it all out. As it is I am extremely busy with all sorts of projects, so I honestly do not have the time to to do this, which in some ways does make me quite frustrated as I would dearly love to be able to create something in this line that would be helpful to you and to others.

Regards

Mary

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

Re: 6 new course formats!

by Steve Towson -

Hi Mary.

I understand completely.  Thanks so much for having looked at it in the first place.  Maybe I'll put an ad on Moodle jobs for someone to fix it.

Take care, and keep fighting the good fight!

Steve

In reply to Steve Towson

Re: 6 new course formats!

by Gary Newport -

I too must apologise; life has a habit of throwing itself full bodied into your face and currently I have a long list of projects I have to work through before I can begin to deconstruct this. I am trying during quiet moments but these are few and far between right now.

It seems a relatively easy thing to do but where and how evades me currently. Sorry.

In reply to Gary Newport

Re: 6 new course formats!

by Steve Towson -

That's ok, Gary. I'll pay someone to do it and post the results.

Steve

In reply to Marty Jacobs

Re: 6 new course formats!

by Jeff White -

Are these formats going to be made available for 2.4 and 2.5? 

In reply to Jeff White

Re: 6 new course formats!

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Dear Jeff,

I updated the 'Noticeboard format' to M2.3 for a client and have maintained it to M2.4 and there will be a M2.5 version.

For the others, I would contact Marty direct and ask.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: 6 new course formats!

by Jeff White -

Thanks!

I have found the metaf format especially helpful. 

In reply to Marty Jacobs

Re: 6 new course formats!

by Jeff White -

For users wanting to just have the listing of child courses like metaf format they can add these lines to format.php. I think you can pretty much add these to all your course formats because so long as the course is not a meta course it will show nothing. It is compatible for Moodle 2.4 and 2.5.

If you want to make a format just for this follow http://docs.moodle.org/dev/Course_formats

The code comes directly from metaf

///////////////

$sql="SELECT e.customint1, c.id, c.fullname, c.visible
FROM {$CFG->prefix}enrol e, {$CFG->prefix}course c
WHERE e.courseid = $course->id
AND c.id = e.customint1
AND e.enrol = 'meta'
AND c.visible = '1'
ORDER BY c.fullname ASC";

$courseslist = $DB->get_records_sql($sql);

foreach ($courseslist as $courseX) {
echo '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$courseX->id.'">'. format_string($courseX->fullname).'</a>';
echo '<br />';
}

$sql="SELECT e.courseid, c.id, c.fullname, c.visible
FROM {$CFG->prefix}enrol e, {$CFG->prefix}course c
WHERE e.customint1 = $course->id
AND c.id = e.courseid
AND e.enrol = 'meta'
AND c.visible = '1'
ORDER BY c.fullname ASC";

$courseslist = $DB->get_records_sql($sql);

foreach ($courseslist as $courseX) {
echo '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$courseX->id.'">'. format_string($courseX->fullname).'</a>';
echo '<br />';
}

///////////////

 

 

 

If you want the title of the course right above the listing add this to the top of the code

///////////////

 echo $OUTPUT->heading($PAGE->heading, 2, 'headingblock header outline'); 

///////////////