Orphaned Activities with Collapsed Topics

Orphaned Activities with Collapsed Topics

by Brad White -
Number of replies: 12

I accidently changed some settings using the collapsed topics plugin and I orphaned all of my topics in my course. I honestly must have clicked some reset button on accident because I was only trying to change the colors. I'm only able to show 75 topics under the Number of Sections pull down under Formatting Options.

I was wondering if anyone know how I can get back my topics into regular collapsed form.

Average of ratings: -
In reply to Brad White

Re: Orphaned Activities with Collapsed Topics

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

Dear Brad,

75 topics!!! The maximum for any course regardless of format is 52.  How did you manage that?

Assuming that you are using M2.4, then the orphaned activities / resources will appear underneath the last section when editing is on.  Then you will be able to move them.  But, I think I understand your issue, however, a screen shot would be handy along with full details of the Moodle and CT version you are using from the 'version.php' file.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Orphaned Activities with Collapsed Topics

by Brad White -

Sorry if this is confusing. I attached 2 images that show what happened. Again, I believe I accidently hit a reset format button and I orphaned all of my topics. I'm trying to get it back so that my topics are not orphaned and show in one page. 

My version of Moodle is 2.4. Version: 2012120300.06

Thanks for the help

Attachment moodle1.jpg
Attachment moodle2.jpg
In reply to Brad White

Re: Orphaned Activities with Collapsed Topics

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

Dear Brad,

Thank you for the information.  Given the screen shot, I assume that lectures 74 and 75 were in sections 76 and 77 respectively.  And that you are unable to get more than 75 sections now?  So, given the possibility that you are on a shared system and that the default max sections is '52' - see screen shot attached - then I'm guessing that coincidentally at the same time that you made the change a developer / sysadmin changed the max-sections value within the code.  In this case, then the change needs to be put back such that you can have the sections up to 77 and in doing so, the resources / activities will be back in their correct section.

However!! Collapsed Topics was never designed (all versions including forthcoming M2.5 version) to work with more than 52 sections and hence you will get some really odd results with the toggle persistence getting it wrong.  And possibly other odd issues that cannot be pinned down.  So, please can you tell me how you were able to select > 52 sections in the first place?

Cheers,

Gareth

Attachment max_sections.png
In reply to Gareth J Barnard

Re: Orphaned Activities with Collapsed Topics

by Brad White -

Thanks for the info. We never changed the code to have more topics. We actually have 87 topics in total. I was just showing you where we are having the problem. 

Our problem occurs in other formats as well. We went back to just a basic Topics format and the problem is there as well. We don't want orphaned topics anywhere. The Number of Sections drop-down was initially set I believe at either 0 or 1 but we were messing with it because we need to fix it. 

As for your confusion with Lecture 74 and 75 were sections 76 and 77, that is just because we have moved the most recent lectures (86 and 87) to the very top. 

Does this help in any way? I honestly didn't change any of the formatting options except collapsed topics colors including the hover color code and the background hover color code. It's possible that I accidentally hit a reset layout button unintended.

Does this help? 

In reply to Brad White

Re: Orphaned Activities with Collapsed Topics

by Brad White -

Hey never-mind,

We have solved our problem by using the plus and minus keys at the bottom of our page. I know I may have confused you to how we have so many topics but we have fixed our problem. 

Thanks for all of your help though.

In reply to Brad White

Re: Orphaned Activities with Collapsed Topics

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

Dear Brad,

No worries.  The fifty two section limit with Collapsed Topics still applies until I can work out a way of dealing with more.  Looking at 'Home /Site administration /Courses /Course default settings' it appears that the default is 52 and therefore your installation must be different.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Orphaned Activities with Collapsed Topics

by Brad White -

Hey Gareth,

I seem to have found something that is consistently causing me problems with orphaned activities. I have already solved my problem above as I mentioned but I happen to have noticed that I re-created my problem before when I was changing the color scheme of the toggle colors in Collapsed Topics.

 

Let me explain more. My initial problem on this thread was that my lectures were becoming orphaned and I wasn't sure why. I initially was just changing the colors when my problem occurred. I have now confirmed why exactly. I use Photoshop to find color harmonies and what I did exactly was copy the color code (html) and paste it into the color code for Collapsed Topics. The second time that I did this, my lectures became orphaned again. Therefore, I believe one of two things. Either this is an error that is caused by code or I myself have incorrectly changed the color code (I mean that to make a simple edit like this, I don't know if I have to go into Maintenance Mode or some other Moodle option).

 

Either way, I have since replicated this problem and wanted to bring it to your attention because I feel that this is an error of some sort. I don't know if others will have this problem or not. 

 

The one possible reason why this may happen is because we add more lecture topics by using the plus and minus symbols at the bottom of our course to add lectures. This is how we got up to 87 topics. Whether or not that is a problem, we are not aware of it. 

 

Anyway, this isn't a problem we are having, I just wanted to let you know more precisely what our problem is and bring it to your attention. 

-Brad

In reply to Brad White

Re: Orphaned Activities with Collapsed Topics

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

Dear Brad,

Thank you smile

Are the Photoshop harmonies just hex rgb codes like '#0088CC' etc?

Currently there will be unexpected behaviour when the number of sections is greater than 52.  I need to look into this.

Can only you edit the number of sections for the course?

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Orphaned Activities with Collapsed Topics

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

Dear Brad,

There appears to be a bug both in my code and Moodle core such that there is no guard code on the increase sections icon that checks that the maximum sections have been reached.  Therefore you find that you are able to add sections beyond that established by the administrator, however, when you edit the settings, the new number of sections is too great for the number of sections combo-box and it reverts to '0'.  You then save and realise that the number of sections is '0' go back and set it to the maximum.  However, this is less than what you had originally intended so you end up with orphaned activities etc. at the bottom.

I'll need to report this.  The bug is at the bottom of the 'print_multiple_section_page' method in '/course/format/renderer.php' (and any other course format renderer that copied the code and overrode it) in Moodle 2.3, 2.4 and 2.5.

Cheers,

Gareth

In reply to Gareth J Barnard

Re: Orphaned Activities with Collapsed Topics

by Brad White -

Yes, the color code we use is rgb color code as you have it yes. We are aware of the 52 section limit as we have been doing our own research lately and we are also aware, (now that is), that it can cause unexpected behaviour. Because our site is live for a number of users, we will be looking into changing our number of sections 87 to lower than 52 in the near future or we will simply fix our course. 

Thank you guys for all of your support. I am very pleased to see quick responses and lots of support. I know that our 87 lecutres/sections may be confusing but it's what we wanted for our curriculum and we made it work. I am extremely pleased with your support into making a patch for it. 

Let me know if you need any other information from me. 

-Brad W. 

In reply to Brad White

Re: Orphaned Activities with Collapsed Topics

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

Dear Brad,

No problem.  I've now sorted MDL-39764 with the help of Marina Glancy.

I'm still not completely certain how to fix the >52 sections issue with Collapsed Topics.  And, there is only me working on it!  So, if you have any possible solutions then that would be appreciated smile

Cheers,

Gareth