How can I completely hide or remove the TOC?

How can I completely hide or remove the TOC?

by Max Elander -
Number of replies: 29

I'd like to have a completely "clean" page where only the SCORM content is visible below the page header. No footer, no TOC, no blocks, nothing but the page header and the SCORM content.

I've tried messing with the theme, but the TOC won't hide easily. Using CSS to hide it messes everything up and the SCORM content disappears too...

I have tried searching the documentation but haven't been able to find any useful information on this particular issue. I've also googled for "moodle scorm hide toc" and scanned this forum, but nothing useful has turned up.

Does anyone have a solution, or at least a viable idea on how to do this? I'm quite prepared to hack the module itself if necessary, but I need a helping hand to find where to do the hacking...

Oh, and I'm using the 2.0 version of Moodle, and SCORM packages from Lectora.

Average of ratings: -
In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Chris Mr. -

I'm not sure if this helps you hide the entire TOC; but I had a similar interest in the hiding TOC for a Scorm File.

 

Click on the edit icon for the scorm section, this will display the "Updating: Scorm package" seciton, then click on the "Show advanced" button in the "Other settings" section, then select "Hidden" in the "Display course structure in player" drop down list. I also recommend selecting "Yes" in the "Hide navigation buttons" drop down list.Then click Save and display. The TOC will now be hidden and the Scorm file will take up the entire space.

In reply to Chris Mr.

Re: How can I completely hide or remove the TOC?

by Max Elander -

Nope. That only makes it collapse. It is still visible and clickable, I want it to disappear completely, so it can't be clicked and expanded. But thanks for trying.

In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Clark Burns -

Max,

I'm in the process of accomplishing what you are talking about. It's a bit tricky as YUI is being used to render the player components.

I'll let you know as soon as I have a solution.

-Clark

Average of ratings: Useful (1)
In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Clark Burns -

Max,

I figured out how to completly remove/hide the TOC.

Right now it's somewhat of a mess but my plan is to rewrite it so that when hide toc is selected in the admin section it will make the proper code changes. You only have to edit one file (module.js) to make this work however if you upgrade you would have to merge the changes as this will not be upgrade friendly.

If you want I can send you the modified module.js file so you can test it out.

 

Just let me know.

 

I'm off to bed to get some sleep!

-Clark

Average of ratings: Useful (2)
In reply to Clark Burns

Re: How can I completely hide or remove the TOC?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

What would be even better would be if you did this as a 4th option in the drop down for "Never" - then create a patch based on your changes (or commit the change to a git branch somewhere)

then, create a new Tracker issue for it and I'll take a look - if it's tidy it might end up in core. smile

Average of ratings: Useful (2)
In reply to Clark Burns

Re: How can I completely hide or remove the TOC?

by Max Elander -

YES!

(Sorry for shouting so early in the morning, just got so excited...)

I'd love to see your solution, can you upload it here as an attachment, or send it, or a link to it in mail?

I have a GMail account with just max.elander before the at-sign, and gmail.com after.

I'd love it even more if you also followed Dan Marsdens suggestion, and this ended up in core. That would be just perfect!

Thank you so very much in advance for making your solution available!

In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Leah Hemeon -
Picture of Testers

I got so excited about this fix that I HAD to post it on the tracker. I didn't see that anyone else had. Thank you for working on this - I'm working with my admins to see if we can use this solution.

http://tracker.moodle.org/browse/MDL-26482

Thanks again!

In reply to Clark Burns

Re: How can I completely hide or remove the TOC?

by Andrea LaPlume -

Hi Clark,

I am so excited to read that you have come up with a temporary solution for this TOC issue. Can you also send me this modified module.js file? My email is alaplume@guild1.com

Thank you so much for your help!! I look forward to when Moodle fixes this and has a "Never appear" for the TOC.

Cheers,

Andrea

In reply to Clark Burns

Re: How can I completely hide or remove the TOC?

by Scott Severn -

I'm also interested in the solution.  Could you perhaps post it here?

Thanks!

In reply to Scott Severn

Re: How can I completely hide or remove the TOC?

by Tony Hatfield -

A note to anyone having difficulty with this fix:

If you have an older 2.0 release of Moodle, you can simply replace module.js under the mod/scorm directory, and in a text editor ensure that: var scorm_disable_toc = true;

An updated version of this file can be obtained from:

https://github.com/danmarsden/moodle/tree/master/mod/scorm

There is a tracker issue which is marked as resolved, for those who are interested:

http://tracker.moodle.org/browse/MDL-26482

This change works correctly in IE as well!

Worth noting are the other forums posts on this issue. I'd recommend a merge so confused people stop hitting dead ends... 

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

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

 

In reply to Clark Burns

Re: How can I completely hide or remove the TOC?

by Alex Briones -

Hi Clark,


How can I collapse the TOC on Moodle 3.1? I noticed TOC is expanded by default. Do I have to change the module.js?

Yui is making it very hard for me to do a hack on this.

Thanks

In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by c p -

A "clean" page with "no footer, no TOC, no blocks, nothing but the page header and the SCORM content" is, I think, exactly what I am looking for as a way of getting around the problem of the stage size option disappearing in Moodle 2 which means I am currently resorting to using the new window option. For various user reasons I don't like pop-ups and anyway a new window leaving an empty player looks a little messy. My coding skills are limited to a very small amount of tinkering so I doubt if I can implement things but my thinking so far is as follows:

The pop-up appears as a completely clean page. This is because within all themes there is a defined layout for just this purpose. It might be possible to fix things so that when you enter a course you are taken to a page that uses this 'pop-up' layout albeit in the same window. This might not be completely ideal as it removes all moodle navigation and users will need to use the browser's back button to return to the course. If another layout were defined that was "clean" but with the header that may give us what we want.

Sorry, at the moment these are just thoughts and I haven't even reached the tinkering stage...

In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Max Elander -

OK, I got the code from Clark in a mail earlier today and I've tested it and it works as advertised.

He stated in the mail that he was going to tweak it a little before posting, but if you really can't wait to test it you can try the attached version. If you are a little less impatient I recommend waiting for the "official release" from Clark...

I have absolutely no idea what the license is supposed to b here?

Anyway, replace the "module.js" in "/mod/scorm/", and you're set. Might be good to keep a copy of the original, if something goes wrong in your installation (it didn't in mine, but that doesn't mean it won't in yours).

EDIT: Forgot to say a big THANK YOU to Clark for helping out with this. I really appreciate it!

In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Gilles Gagnon -

Hi Max, Clarke and everyone else,


This is exactly what I need. However, after replacing module.js with the one provided by Max, the TOC sill appears. I double-checked to ensure it had been ftp'd in the correct place and it has. I even renamed the file to ensure I'd get an error. I did, so the file is indeed there.

Here's a screenshot of the TOC which I want to get rid of.


Any ideas?

Attachment moodle-problems-2.jpg
In reply to Gilles Gagnon

Re: How can I completely hide or remove the TOC?

by Gilles Gagnon -

Hi Everyone!

I got it to work... I just needed to clear my browser cache.


Thanks again for the workaround Clark!

How do we know when this will be implemented in the core?

Gilles

In reply to Gilles Gagnon

Re: How can I completely hide or remove the TOC?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

someone needs to open a bug in the tracker asking for it to happen - if it's not you, then you can add yourself as a watcher to the bug to get notification of any changes.

It's unlikely I'll have time to look at this for quite a while. - unless someone creates a patch to add it as an extra option in the interface for me to review.

In reply to Dan Marsden

Re: How can I completely hide or remove the TOC?

by Gilles Gagnon -

Thanks Dan.  I'll stick to the workaround as I'm not versed enough in JS to create the fix.

Cheers,

In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Max Elander -

Gah! It only works in Firefox, the TOC is visible in IE and in Safari. Anyone else having this problem?

In reply to Max Elander

Ang: How can I completely hide or remove the TOC?

by Mikkel Steen -

I'm also trying to achieve this. But i still have 4 request i would like to ask if somebody could help me with, cause im not that experienced with javascript.

I've shown the problems below.

  1. First i would like if we could set the object to be transparent so that dropdowns and such can go in front.
  2. Second, is it possible to remove the black border around the scorm object?
  3. Third there's a light grey frame border still almost invisible, but at good screens it still visible.
  4. Was it possible to remove blocks at scorm view?
  5. When the scorm loads theres a darkgrey blackground, can this be made white instead?

I like this rewrite! I hope you can help me and others in this situation big grin

Regards Mikkel Steen

In reply to Mikkel Steen

Svar: Ang: How can I completely hide or remove the TOC?

by Calle S -

Please I would like exact the same thing here!

Why can't any LMS vendor do this right the first time off.

In reply to Calle S

Re: Svar: Ang: How can I completely hide or remove the TOC?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Bribes are always welcome....... also funding.... otherwise you'll just have to be patient... Do you actually pay a "vendor" to use your Moodle install? - perhaps you should contact them to see if they will do the work for you........

In reply to Dan Marsden

Re: Svar: Ang: How can I completely hide or remove the TOC?

by a d -

After lots of searching through the forum I just found this topic. This is exactly what I am looking for. Sadly the fix does only work in FF in IE the TOC is still displayed. I took a look at the JS-File and even though I am experienced in programming I did not find any place to start.

@Dan: do you have a rough idea when this fix will be finished for IE too?

In reply to a d

Re: Svar: Ang: How can I completely hide or remove the TOC?

by Mat P -

Has there been a solution to this annoying issue. I was told by Pukunui support to select disable from the drop down but there is no disable option.

In reply to Mat P

Re: Svar: Ang: How can I completely hide or remove the TOC?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

the disable option is only available in 2.1.1 and higher - see MDL-26482

In reply to Dan Marsden

Re: Svar: Ang: How can I completely hide or remove the TOC?

by Mat P -

Dan thanks, I thought we where on 2.1.1, but no we aren't. 2.0.5 I will contact our host to upgrade us.

In reply to Max Elander

Re: How can I completely hide or remove the TOC?

by Luis Cattel -

Although the solution has been implemented, another approach that we found to avoid the opening of multiple windows of the same activity is to block it using a piece of javascript available here:

http://stackoverflow.com/questions/528941/how-can-i-check-for-an-open-url-in-another-window

It´s not an counter-hacker solution (you still can open for example an activity in three windows in distinct browsers, one session in Opera, another in FF, another in IE), but it does the job at students level.

Maybe this behavior could be an optional setting in Moodle: to avoid or permit the opening of scorm activities in several windows as other LMS do.

In reply to Luis Cattel

Re: How can I completely hide or remove the TOC?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

nice idea - if someone throws this together as a patch for Moodle 2.3 I'd be happy to review it for inclusion in core!

In reply to Dan Marsden

Svar: Re: How can I completely hide or remove the TOC?

by Thomas Ylvin -

Go to mod/scorm/module.js

Disabled the TOC here  "var scorm_disable_toc = true;" 

T

Average of ratings: Useful (2)