moodle-format_flexsections icon indicating copy to clipboard operation
moodle-format_flexsections copied to clipboard

Moodle 4 stable: persistent Section-IDs missing (like in 3.x-versions)

Open VOOM108 opened this issue 2 years ago • 8 comments

One great thing and for us one of the most important aspects of flex-sections-format was that it had persistent and globally unique IDs for sections, making deeplinks to sections hassle-free. While section=section-1 will always point to the first section in the course, even after moving or deleting sections, sectionid=1234 in 3.x was persistent.

Please return persistent IDs - otherwise there is no way we can ever update to Moodle 4 with our main platform. On a client-platform with Moodle 4 we would already need to find a whole new concept of building courses :|

VOOM108 avatar Nov 03 '22 15:11 VOOM108

hi @VOOM108 , I'll see what I can do. I actually changed from sectionid to section to be consistent with how "Topics format" works (if you select the option to display one section per page).

The sectionid links still work if you have such links saved anywhere

marinaglancy avatar Nov 05 '22 18:11 marinaglancy

That would be great, to continue to have both, a link to whatever is in section 1 with section=1 and a persistent link to a specific section with sectionid=#### :)

VOOM108 avatar Nov 05 '22 18:11 VOOM108

they both currently work. When course format creates a URL it uses for example "/course/view.php?id=11&section=2" if you inspect the html and find the id of the section you can type URL "/course/view.php?id=11&sectionid=232" and it will show the same page.

So what do you suggest to do here?

marinaglancy avatar Nov 05 '22 20:11 marinaglancy

If that is the case, simply an easier way to find the right ID - so the editing teachers who are not so tech-savvy will be able to find it. The way it was before - that it was visible in the URL in the address bar when entering the section - would suffice.

Edit: where exactly would I find the ID? I can't find it.... Edit2: found it - in the class of the sectionname.... :)

Any way to not have to find sth. in the HTML would be appreciated.

VOOM108 avatar Nov 05 '22 20:11 VOOM108

I can't think of any easy way to show it myself. I thought of a tooltip on the linked sectionname only when editing, but that is easier thought than done. I will need to make a screencast for our teachers anyway, where I demonstrate the full concept of building courses. I suppose they might have to be able inspect the sectionname and find the ID there, if I show it in the screencast. Still, if we do come up with an idea that is easy to implement, it would be great.

My main concerns: not being able to use our concept, and not being able to update Moodle with existing courses using the sectionid, are solved, if it stays this way that the links will keep working :)

VOOM108 avatar Nov 05 '22 21:11 VOOM108

Actually, I am just thinking about solving this with jQuery: Taking the data-id="##" and show the content in a sectionname title="" only when editing...

VOOM108 avatar Nov 06 '22 00:11 VOOM108

Here it is:

require(['jquery'], function($) { $('.format-flexsections.editing h3.sectionname').each(function() { var dataID = $(this).attr('data-id'); $(this).prop('title', "sectionid="+dataID); }); });

VOOM108 avatar Nov 06 '22 00:11 VOOM108

I just found out, that when editing the summary of a section, the URL shows the persistent ID like so:

/course/editsection.php?id=13

Here 13 is the sectionid, my jQuery thus is not necessary, esp. since the point where the ID usually needs to be entered is when editing the course-summary. I will keep the jQuery anyway to cover more usecases... :)

VOOM108 avatar Nov 06 '22 13:11 VOOM108