General plugins

Accordion Resource

 
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Abrar
Accordion Resource
 

I have developed an accordion resource editor for courses, which can be added from resources drop down like label. You can add collapsable structures in between your topics and chapters. It is very handy in arrangment of large amount of data in little space. Looking forward for feedback.

Click here to access!

Ab 

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Accordion Resource
Group Particularly helpful MoodlersGroup Plugin developers

Hi Abrar.

Well I've successfully implemented your mod and minor hacks as pointed out on your module page. THANK YOU FOR A WONDERFUL RESOURCE!

Initially I though that it could be used just for multi-lines labels. Then it dawned upon me that I could use it to store embedded Web 2.0 code so that I can save vertical space on my Moodle coursepages.

Here'a screenshot of the Accordion resource in a closed-state on my site:

 

If I do a mouse over with my mouse pointer, the Accordian tab changes colour to a green pattern and colour (actually the original colour was blue but I wanted something that harmonised with my coursepage theme's colour):

 

And after I click on the green rounded tab, the Accordion opens up and I get:

 

I can immediately see the application of your Moodle 1.9.x  Accordion resource (does Moodle 2.0.x have this mod?):

I. Reduce / Eliminate the infamous Moodle "Scroll of Death" (SOD)

  • by emdedding Web 2.0 embed code (e.g., Moodle labels, Youtube, Blip.tv, any HTML code, etc.).
  • On my Moodle courses, I use the Accordion resource together with the Collapsible Topics format to keep things simple and neat. This helps to cut down the SOD to a manageable level.  What do you think?

II. Aesthetic Visual effect

  • Nice pop-down effect of the embedded HTML or Web 2.0 code object (e.g., Blip.tv or Youtube video)

II. A choice of NOT using links which lead to pop-up WIndows

  • With this Accordion Resource, a link to a webpage or that in turn opens out to a new Window, can be done away with. Instead of this clumbersome way of displaying Web 2.0 code, you can now have an Accordion link that opens to reveal the Web 2.0 object (e.g. Youtube or Blip.tv video) up in a pop-down method without leaving the Moodle coursepage!


Installing the mod

Your code works, but I spend a couple of hours to figure out exactly how to edit the file "..\course\lib.php" as it was not clear from the module page. Type the hack code wrongly or in the wrong way, and you end up crashing your lib.php code. So a backup of the original lib.php is a must so that you can restore it in case the worst happens.

Well for the benefit of others, the bold-faced black colour code shows where exactly the hack code is to be inserted inside the lib.php file. Here it is:

...starting from line 1356...
if (!empty($CFG->enablegroupings) && !empty($mod->groupingid) && has_capability('moodle/course:managegroups', get_context_instance(CONTEXT_COURSE, $course->id))) {
if (!isset($groupings)) {
$groupings = groups_get_all_groupings($course->id);
}
echo " <span class=\"groupinglabel\">(".format_string($groupings[$mod->groupingid]->name).')</span>';
}

} elseif ($mod->modname=="accordion") {
include('../mod/accordion/accordionlib.php');
} else { // Normal activity
...

The code and files I used to implement your Accordian Resource can be downloaded from here. Caution! Read the instructions by Abrar found here.

I also used http://pixlr.com/express/ to change the colour of the Accordian bars to suit my Moodle theme. Works for me.

If anyone needs any help getting this Accordion resource running on his or her Moodle site, feel free to contact me at boonsengkam at gmail dot com. And for a LIVE demo, you can login to my website http://scm.moodleace.com by using:
Username: student
Password: moodle
Specifically, you can head over to http://scm.moodleace.com/course/view.php?id=8

Lastly Abrar, if you are reading this, THANK YOU.

Regards
Frankie Kam
Melaka, Malaysia
"Malaysia can Moodle"

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Accordion Resource
Group Particularly helpful MoodlersGroup Plugin developers

Correction, I've deleted the earlier link which contained the lib.php file that I used because it caused an error when the user clicked on the Course Category link.

Instead, here is the current stable list of files that I use on my website now. No more login / course category problems anymore.

http://min.us/mvtq7K

The golden rule in Moodle administration is this: ALWAYS MAKE A BACKUP OF YOUR ORIGINAL FILES, especially those FILES that will be EDITED with a HACK or will be overwritten. This is so that you can always restore your system back to its working state. IN ALL THINGS, PROCEED WITH CAUTION AND DO THINGS ONE AT A TIME.

In conclusion, I managed to get the Accordion Resource working for my Moodle 1.9.7 site. If you want to use this good resource, read all the instructions careful and backup backup backup before making any changes.

Frankie

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Accordion Resource
Group Particularly helpful MoodlersGroup Plugin developers

Here's a Youtube video showing the Accordion Resource in action.

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Accordion Resource
Group Particularly helpful MoodlersGroup Plugin developers

Here's my video tutorial:

 
Average of ratings: -
Picture of Jordi Lopez
Re: Accordion Resource
 

I'll give it a try...Really nice resource, thanks for sharing Frankie !

 
Average of ratings: -
Picture of Jordi Lopez
Re: Accordion Resource
 

... Jordi here again, before getting hands-on: do we know if your nice hack works in Moodle 2.0 ? smile

 thanks in advance

 
Average of ratings: -
Picture of Jordi Lopez
Re: Accordion Resource
 

After some test, following Frankie's hack instructions, i answer my own question, unless i'm doing something wrong:

  >>  Doesn't work for Moodle 2.0 : once you modify lib.php with the hack, moodle gets secrewed !

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Accordion Resource
Group Particularly helpful MoodlersGroup Plugin developers

Hi Jordi

Sorry to hear that Accordion doesn't work with M2. I admire the fact that you tried to get it to work. Maybe the author could try to customise it for M2. One day perhaps. In the meantime, another way to reduce the scroll of death in M2 is the menu block. Perhaps you can give that one a try.

Frankie Kam

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Accordion Resource
Group Particularly helpful MoodlersGroup Plugin developers

Here's my video tutorial:

 
Average of ratings: -
Picture of William Mair
Re: Accordion Resource
 

Abrar/Frankie,

Is there anyway to change the code so that each accordion is a different colour? I know that their is no real 'colours' per say, as the colour comes from the image.

However, I am wondering whether there is a way to code it so that faculty 1 has bar1 (blue), faculty 2 has bar2 (green) etc..

Even if you can point me in the right direction of which of the files to be hacking (I assume that I can do this from if/case statements in php), then I can start looking at it myself.

Thanks

 
Average of ratings: -
Frankie's the name, Moodle's my game!
Re: Accordion Resource
Group Particularly helpful MoodlersGroup Plugin developers

Hi William.

That's an interesting idea you got there...my guess is to modify accordionlib.php which reads the accordion.css file. First you might have to create multiple css files. E.g., accordion1.css, accordion2.css, etc. Each css file would have to access a different accordianBar.png and accordianBarRollOver.png file.

This then begs the question: how to modify accordionlib.php so that it can detect different faculties and hence apply the appropriate image? Well, maybe you can poke around some a bit more...all the best. Please share the solution one you manage to solve it.

Frankie Kam
Email: boonsengkam at gmail.com

 
Average of ratings: -