When you change the number of topics down in a course they don't get deleted

Re: When you change the number of topics down in a course they don't get deleted

by William Lu -
Number of replies: 14
Picture of Particularly helpful Moodlers

Our teachers are encountering this problem.

As Mary suggested years ago, our institute requires all courses to use :"make your Moodle course page look more like a webpage". It has been our 'Standard course template' for 2 years now.

This term, our Moodle is upgraded to V3, when a teacher changed the number of section, their content were deleted WITHOUT warning!

To reproduce this:

  1. Type something into a 'Edit Topic' > Summary of TopicX > Summary field
  2. Save changes
  3. Reduce section number by click on the '-' icon, or 'Edit course settings" > Number of sections
  4. Content deleted without warning!

To workaround:

Add anything....Resource or Activity...into the section, then, works as we used to, the section changed to 'Orphaned activities'.

Is it a bug? Anyone reported already?

If it is a feature of Moodle3, then better comes with a warning.



In reply to William Lu

Re: When you change the number of topics down in a course they don't get deleted

by Susan Mangan -

We just found this too!!  Ack.  A lot of our teachers have lengthy summaries which are now deleted they choose to reduce the sections.  For example, we have compressed terms during the summer where instructors need to shift their course content.  I'm just starting my search for whether or not this is an 'undocumented feature' or a bug.

In reply to Susan Mangan

Re: When you change the number of topics down in a course they don't get deleted

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Ah - I see what you mean! You mean, if you just have a topic section with something typed into the summary - then it gets deleted. Well, I understand that as Moodle probably thinks there is nothing in that section since there are no activities. I don't know how long this has been like that though. Maybe always?

In reply to Mary Cooch

Re: When you change the number of topics down in a course they don't get deleted

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

I believe it has always been like that Mary - activities/resources get put in an Orphaned activities section, Summaries get lost. Its one of the reasons I always encouraged staff to use labels for anything other than a very brief sentence or two smile

In reply to Richard Oelmann

Re: When you change the number of topics down in a course they don't get deleted

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

Pragmatically, if you delete something, then you 'delete' something.  So on the flip side, if you want to keep the summary, where would it go?  What action does the software have to take as a result of the action?  Should it be converted to an orphaned label?

If you're worried about this in your courses then use a label at the top of the section instead of a summary, then if the section gets deleted then at least the label will be an orphan and still exist.

In reply to Gareth J Barnard

Re: When you change the number of topics down in a course they don't get deleted

by Susan Mangan -

Yes, I most definitely think the section should be considered orphaned if there is text in the Summary, and only text in the Summary.  That is 'content'. 

I agree with you 100% - if you delete something you 'delete' something.  However, 'reducing the number of sections' that are visible has always been a 'non-destructive' function in Moodle.

If one chooses to reduce the number of sections visible and the software does not delete activities and resources, but rather leaves these activities and resources in an 'orphaned' section, why would it then delete the content that has been entered into a Summary?  Who makes that decision?  I feel that if an instructor spends time writing a summary for a section and creating links, and does whatever else they do when mucking about with the HTML editor...  that should be considered content and not be deleted if other resources are not deleted. 

With regard to whether or not this behavior makes sense or not, it doesn't matter.  It's the expected behavior and the consistent behavior that is most important I think.  If other resources and activities are not 'deleted' then I would expect any other content that resides in that section to also not be deleted.  I understand the chances of having just content in a Summary and changing the display at the same time is likely slim but not unheard of.  I know of teachers in our university that use just Summaries with images, links, etc.

With regard to using labels, I will definitely start informing our 600+ faculty to now use labels and not use the Summary if this is not considered a bug so they don't inadvertently lose content.

 

 

 

 

 

Average of ratings: Cool (1)
In reply to Mary Cooch

Re: When you change the number of topics down in a course they don't get deleted

by Susan Mangan -

No, this behavior is definitely new.  Somewhere in between 2.8 and 3.0 I think.

In reply to Susan Mangan

Re: When you change the number of topics down in a course they don't get deleted

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

I have tested the cases described in 2.8 and 3.0.

If you have a label (or other activity) added to a section, and you then reduce the number of sections such that they are less than the section in question, the section remains intact and displayed as "orphaned". It can be restored intact by changing the number of sections back to the original number.

In 2.8, if you have a section with no content and a defined summary, and you reduce the number of sections in a course, the section record is retained in the database. If you then go back and increase the number of sections back to its original setting, the section is again visible with the summary intact.

In 3.0, if you have a section with no content and a defined summary, when you reduce the number of sections in the course, the course section record is deleted from the database, and restoring the number of sections cannot bring back the summary.

I have not determined if that was "by design" or a "regression error".

mike

In reply to Mike Churchward

Re: When you change the number of topics down in a course they don't get deleted

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Oddly enough, if you change the course format to a format that doesn't have sections (like Social), the sections are not deleted. If you restore back to "Topics", the sections come back.

I have looked through the code, and deleting the empty sections was introduced in 2.9. Looking for the issues now...

In reply to Mike Churchward

Re: When you change the number of topics down in a course they don't get deleted

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Okay. I found where this was changed.

The deletion code was added to 2.9 here - https://github.com/moodle/moodle/commit/bb01883867f3c85ebaa094615ddfadb8c5f1f518

The commit comment uses MDL-10405 as the issue for doing so.

The original issue was to add a new feature that allowed teachers to delete a section if they wished. It appears the automatically deleting non-empty sections came into the solution here - https://tracker.moodle.org/browse/MDL-10405?focusedCommentId=334056&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-334056

I really think that nobody considered the possibility of a "Summary" being considered content, and hence didn't treat it as one of the non-empty rules. You may be able to create a new tracker item asking this to be reinstated.

mike

Average of ratings: Cool (1)
In reply to Mike Churchward

Re: When you change the number of topics down in a course they don't get deleted

by Susan Mangan -

My thoughts exactly.  Thank you for finding this Mike!  I will create a tracker item to see if there is enough interest in having this functionality restored.

https://tracker.moodle.org/browse/MDL-54557

In reply to Susan Mangan

Re: When you change the number of topics down in a course they don't get deleted

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

FYI - MDL-54557 has now been fixed and integrated into core code. It will be part of the next release.

mike

In reply to Mike Churchward

Re: When you change the number of topics down in a course they don't get deleted

by Donna Hrynkiw -

Further to Mike's testing.

> In 3.0, if you have a section with no content and a defined summary, when you reduce the number of sections in the course, the course section record is deleted from the database, and restoring the number of sections cannot bring back the summary.

Our results are slightly different.

If you have a section with no content and a defined summary in the middle of a course (i.e. not at the very bottom), reducing the number of sections to less than the section in question causes the section to disappear from view (it's not listed as 'orphaned'.) However increasing the number of sections will cause it to reappear.

Only sections with no content and a defined summary which appear at the very bottom of the course are actually deleted. Multiple sections will be deleted if they all fit that criteria.

Moodle v3.0.3


Hrynkiw

Kwantlen Polytechnic

In reply to Donna Hrynkiw

Re: When you change the number of topics down in a course they don't get deleted

by Susan Mangan -

Good sleuthing Donna!  I thought you had retired already!  Hope all is well smile  I'm jealous of your helpful Moodler badge - I haven't gotten one since 2014 but I haven't been able to be on the forums as much either sad

In reply to Donna Hrynkiw

Re: When you change the number of topics down in a course they don't get deleted

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers

Looking at the code I referenced, what you are describing makes sense. If you reduce the number of sections, the code starts at the oldest last section and works backwards, deleting "empty" sections until it hits one that isn't empty. When it hits one that isn't empty, it stops moving through them and exits.