Permalinks to course sections

Permalinks to course sections

by Przemek Kaszubski -
Number of replies: 10
Picture of Particularly helpful Moodlers Picture of Testers

Dear All,

I believe there is a strong need to finally add the option to link permanently to course sections. Each course section has its own unique ID, clearly visible in the URL when editing it (cf. e.g:  Edit > <you_site_URL>/course/editsection.php?id=18724&sr ).

I have just added a comment to this tracker item: https://tracker.moodle.org/browse/MDL-62323 "Preserve links to sections" , after earlier reading this 2018 discussion

I'm reproducing that comment below. Perhaps some Moodlers will want to comment and/or upvote that tracker issue.

* * *

It is possible to use permalinks to sections but ONLY when in the editing mode:

I tested using the "Show all sections on one page" layout of the Topics format

A link such as /course/view.php?id=292#sectionid-18724-title

can lead me to the right heading and part of the page:

<h3 id="sectionid-18724-title" class="sectionname">

Here's a screenshot:




UNFORTUNATELY, when Editing is turned off , that unique ID identifier for the section disappears   , and the H3 element becomes: <h3 class="section-title"> only.

If the section ID was retained , we would gain the possibility of linking to the section regardless of its placement in the course's numbered section list - at least for "All sections on one page" scenarios.

There is a more global need to add something like "permalinks" to course sections that would work with any (core) course format.

Average of ratings: -
In reply to Przemek Kaszubski

Re: Permalinks to course sections

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers
Moodle 4.2 will feature permanent links to course sections:

https://tracker.moodle.org/browse/MDL-76418
"Have a way to get the permalink to a course section (and probably also to a section number)"

The method described in the tracker works manually also with lower Moodle versions (3.11.*, 4.0.*) (though links might not work with all course formats).
In reply to Przemek Kaszubski

Re: Permalinks to course sections

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
Your post, Przemek, made me question whether Gareth's Collapsed Topics can utilize section numbers. I discovered that "yes," it seems to work. I can provide a URL like so, http://localhost:8888/moodle4/course/view.php?id=16&section=3, and it will take the student into "targeted" view (one-topic view) with the section showing. This is something new to me, and I still need to explore and experiment. I am interested in seeing how Moodle 4.2 compares. (Of course, Collapsed Topics is a plugin.)
In reply to Rick Jerz

Re: Permalinks to course sections

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers
Yes, Collapsed Topics does a good job there smile , but I agree this is a developing area for us to monitor smile . Cheers, Przemek
In reply to Przemek Kaszubski

Re: Permalinks to course sections

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers
BTW , links like /course/view.php?id=16&section=3 are NOT permalinks, of course. If you move the section, its number in the course structure changes.
That's why for permalinks the option with the unique ID attribute like "sectionid-###-title" was utilised.

However, it appears not to be robust enough in comparison to the existing "section"-based addresses - in Collapsed Topics at least - from what I have seen. In the core Topics, Moodle 4.0.7, with one-section-per-page setting, the permalink will default to the main course page without opening the one targeted section (and sometimes - I think - not scrolling down at once to the target right section title). But then, probably best implementation of the permalinks will be from Moodle 4.2 up.
In reply to Przemek Kaszubski

Re: Permalinks to course sections

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers
In reply to Przemek Kaszubski

Re: Permalinks to course sections

by Stephan Robotta -
Picture of Core developers Picture of Plugin developers
Hi,

Thank you, Przemek, for your input and the comment in MDL-76418. The issue doesn't seem trivial to me and I don't really have an idea what should happen instead. If a section consists of one activity, this could be opened automatically. However, if there are more activities in a section, then this is not an ideal solution.
The section=XX link is not sufficient because that changes when sections are moved around. MDL-75542 suffers from the same issue.
However I also think that for most cases the section link is sufficient once the course layout is setup and the trainer doesn't move sections anymore.
In reply to Stephan Robotta

Re: Permalinks to course sections

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers

Thanks, Stephan. It's useful, even if slightly disappointing, to know MDL-75542 is also affected.

Regarding: " However I also think that for most cases the section link is sufficient once the course layout is setup and the trainer doesn't move sections anymore." - Such is the current reality, I believe, and I hope the documentation for Moodle 4.2 will somehow account for that (slight, I agree) inconvenience. Just checked the QA site, and found that (for Topics and the one-section-per-page view mode at least) the new permalink solution does attempt to auto-position the course page view at the title of the targeted section, past the full, uncollapsed General section. That's heartening.

Course sections, and their limitations, always make me recall this (rather unfortunate IMO) initial design decision described by Marina Glancy here: https://tracker.moodle.org/browse/MDL-38762?focusedCommentId=211263&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-211263 .


In reply to Przemek Kaszubski

Re: Permalinks to course sections

by Philipp Memmel -
Picture of Core developers Picture of Particularly helpful Moodlers

Hi,

not 100% sure if it's related to this discussion, but I feel it somehow is: You maybe also want to have a look at MDL-75542. There, I added a new parameter "expandsection" (for example "/course/view.php?id=12345&expandsection=3") to the course view page to forcibly expand a section so you can use an anchor to an activity to jump right where you want you be. The patch also contains an API extension to the course formats, so course formats from now on have the opportunity to use this parameter and implement what should happen in their format if this is being specified, for example expand the section. For topics and weeks this already is being implemented in MDL-75542, all other course formats just need to use it. Feel free to raise issues in their trackers, if they do not support this yet smile

Also be aware that this feature will only be available from Moodle 4.2 onwards.

Average of ratings: Useful (1)
In reply to Przemek Kaszubski

Re: Permalinks to course sections

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers
I can see what you are saying, Przemek. However, it might be robust enough depending upon how it is used.  Thanks.