Moodle
  1. Moodle
  2. MDL-34917

Jump to section navigation for 'One section per page' setting in course formats.

    Details

    • Testing Instructions:
      Hide
      1. With a topics based course, edit the settings ('Formatting options' -> 'Course layout') to have 'One section per page'.
      2. Click on the topic header to go to that section.
      3. Observe a new jump to menu in place of the single 'Return to main course page' link. The 'Jump to' menu has all of the shown sections in the course and a 'Main course page' option.
      4. Click on any section bar 'Main course page' to navigate non-sequentially to that section. Confirm that the section is navigated to.
      5. Click on 'Main course page' to navigate to the main course page. Confirm that the main course page is navigated to.
      6. Repeat for a weeks based course.
      Show
      With a topics based course, edit the settings ('Formatting options' -> 'Course layout') to have 'One section per page'. Click on the topic header to go to that section. Observe a new jump to menu in place of the single 'Return to main course page' link. The 'Jump to' menu has all of the shown sections in the course and a 'Main course page' option. Click on any section bar 'Main course page' to navigate non-sequentially to that section. Confirm that the section is navigated to. Click on 'Main course page' to navigate to the main course page. Confirm that the main course page is navigated to. Repeat for a weeks based course.
    • Affected Branches:
      MOODLE_23_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip-MDL-34917_master
    • Rank:
      43448

      Description

      On 'Reflections on the new Course "Layout" for 2.3+' (http://moodle.org/mod/forum/discuss.php?d=208789), Itamar Tzadok stated how he had in effect reinstated the 'Jump to' section menu that was available in previous versions. It was received with enthusiasm and a desire for it to return.

      I have been able to adapt '/course/format/renderer.php' to utilise the code that was originally in '/course/format/topics/format.php' in Moodle 2.2 to provide a Moodle 2.3 version.

      1. jt_mcp.png
        12 kB
      2. jt_nch.png
        9 kB
      3. osp_jt_rtcp.png
        12 kB
      4. osp_jt.png
        14 kB
      5. osp_t_jt.png
        12 kB

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment - - edited

          Is this desirable or would it be better to jump to a section from the navigation menu?

          Dan: I'll leave this with you.

          Show
          Michael de Raadt added a comment - - edited Is this desirable or would it be better to jump to a section from the navigation menu? Dan: I'll leave this with you.
          Hide
          Dan Poltawski added a comment -

          Thanks for the patch Gareth!

          Martin, what do you think?

          Show
          Dan Poltawski added a comment - Thanks for the patch Gareth! Martin, what do you think?
          Hide
          Martin Dougiamas added a comment -

          Thanks Gareth.

          I don't like the clutter of having it tacked under the "return to course page". Can we integrate those two and put "Course page" at the top of the menu, and putting the menu in the location where that link is now?

          Show
          Martin Dougiamas added a comment - Thanks Gareth. I don't like the clutter of having it tacked under the "return to course page". Can we integrate those two and put "Course page" at the top of the menu, and putting the menu in the location where that link is now?
          Hide
          Martin Dougiamas added a comment -

          Also note this still doesn't solve the missing "Jump to" menu and zoom boxes when the course is not in "one section per page" layout.

          Show
          Martin Dougiamas added a comment - Also note this still doesn't solve the missing "Jump to" menu and zoom boxes when the course is not in "one section per page" layout.
          Hide
          Gareth J Barnard added a comment -

          Updated screen shot 'osp_jt_rtcp.png' demonstrating 'Return to course page' at the top of the 'Jump to...' menu.

          Show
          Gareth J Barnard added a comment - Updated screen shot 'osp_jt_rtcp.png' demonstrating 'Return to course page' at the top of the 'Jump to...' menu.
          Hide
          Gareth J Barnard added a comment - - edited

          Dear Martin, Dan and Michael,

          Code updated to remove the clutter by having the 'Return to main course page' at the top of the menu.

          I see your point about not solving 'the missing "Jump to" menu and zoom boxes when the course is not in "one section per page" layout' but thought that it was not required because 'show section x' functionality had been removed because it confused users. However as MDL-34829 has meant that the section links will work for custom menus when not in that mode, could the next progression be having section names as links to their 'section page' when in 'Show all sections on one page' mode? But then again this could confuse some users as then we would have the situation where a single section is displayed when many are expected - back to the 'show section x' scenario - Catch 22.

          Regards,

          Gareth

          Show
          Gareth J Barnard added a comment - - edited Dear Martin, Dan and Michael, Code updated to remove the clutter by having the 'Return to main course page' at the top of the menu. I see your point about not solving 'the missing "Jump to" menu and zoom boxes when the course is not in "one section per page" layout' but thought that it was not required because 'show section x' functionality had been removed because it confused users. However as MDL-34829 has meant that the section links will work for custom menus when not in that mode, could the next progression be having section names as links to their 'section page' when in 'Show all sections on one page' mode? But then again this could confuse some users as then we would have the situation where a single section is displayed when many are expected - back to the 'show section x' scenario - Catch 22. Regards, Gareth
          Hide
          Gareth J Barnard added a comment -

          As a footnote: In terms of desired functionality I'm just offering what was requested in the discussion on the course format's forum as linked to in the description, as it appeared to be something desirable.

          Show
          Gareth J Barnard added a comment - As a footnote: In terms of desired functionality I'm just offering what was requested in the discussion on the course format's forum as linked to in the description, as it appeared to be something desirable.
          Hide
          Derek Chirnside added a comment -

          Where is this at now? I'm not sure I can exactly follow all the comments above.

          To restate: @Michael. I do not think navigation menu is not a real solution as regularly you are in a position where you have to scroll every time you want to change section. An alternative SOD if you like.

          @Martin: "I don't like the clutter of having it tacked under the "return to course page". Can we integrate those two and put "Course page" at the top of the menu" +1

          On balance, I think that this is a good simple solution: a jump to at the top of the section (ie NOT at the bottom where the return to home is now), and include in it the Index page/home link. The question is (given Gareth's last comment) can we get something into 3.4 with no catch 22??

          @Gareth, Thanks!!

          -Derek

          Show
          Derek Chirnside added a comment - Where is this at now? I'm not sure I can exactly follow all the comments above. To restate: @Michael. I do not think navigation menu is not a real solution as regularly you are in a position where you have to scroll every time you want to change section. An alternative SOD if you like. @Martin: "I don't like the clutter of having it tacked under the "return to course page". Can we integrate those two and put "Course page" at the top of the menu" +1 On balance, I think that this is a good simple solution: a jump to at the top of the section (ie NOT at the bottom where the return to home is now), and include in it the Index page/home link. The question is (given Gareth's last comment) can we get something into 3.4 with no catch 22?? @Gareth, Thanks!! -Derek
          Hide
          Martin Dougiamas added a comment -

          Picky changes I would make to the menu:

          • remove "Jump to..." label and instead use it to replace the "Choose..." as the first item in the menu (not selectable). There's no need for both.
          • change "Return to main course page" to "Main course page".

          As for putting it at the top ... I think it makes some sense for quicker flipping but I'm unsure if that's going to look good with real section headings left and right. And really if you ARE flipping then the next/previous section links are quite likely what you want to be doing, right? And before you ask, no, I don't like the idea of replacing the actual titles with "Next" and "Previous".

          Another consideration is that people theming for 2.3 will have to redo things for 2.4.

          On balance I'd leave the menu at the bottom ...

          Dan can review this patch for inclusion into 2.3.x and 2.4 when he gets back from holidays next week.

          Show
          Martin Dougiamas added a comment - Picky changes I would make to the menu: remove "Jump to..." label and instead use it to replace the "Choose..." as the first item in the menu (not selectable). There's no need for both. change "Return to main course page" to "Main course page". As for putting it at the top ... I think it makes some sense for quicker flipping but I'm unsure if that's going to look good with real section headings left and right. And really if you ARE flipping then the next/previous section links are quite likely what you want to be doing, right? And before you ask, no, I don't like the idea of replacing the actual titles with "Next" and "Previous". Another consideration is that people theming for 2.3 will have to redo things for 2.4. On balance I'd leave the menu at the bottom ... Dan can review this patch for inclusion into 2.3.x and 2.4 when he gets back from holidays next week.
          Hide
          Gareth J Barnard added a comment - - edited

          Dear Martin,

          I have implemented the changes you wanted, please see:

          https://github.com/gjb2048/moodle/commit/35dcd765ee0786971021c6e9cf10ca10c4e931bb

          Full patch differences on (if other commits show, that's because I've not updated my fork from the source, unless you can filter by author too?):

          https://github.com/gjb2048/moodle/compare/moodle:MOODLE_23_STABLE...gjb2048:MOODLE_23_STABLE_MDL-34917

          I've changed 'moodle.php' from 'returntomaincoursepage' to 'maincoursepage' as a search revealed that only '/course/format/renderer.php' was using it. I'm not sure how to change all of the language packs.

          Cheers,

          Gareth

          P.S.

          Somehow I managed to commit my '.gitmodules' to my repository. I've been able to remove it but do not know (or can find an easy way) of removing the two specific add / remove commits, please help, thanks.

          Show
          Gareth J Barnard added a comment - - edited Dear Martin, I have implemented the changes you wanted, please see: https://github.com/gjb2048/moodle/commit/35dcd765ee0786971021c6e9cf10ca10c4e931bb Full patch differences on (if other commits show, that's because I've not updated my fork from the source, unless you can filter by author too?): https://github.com/gjb2048/moodle/compare/moodle:MOODLE_23_STABLE...gjb2048:MOODLE_23_STABLE_MDL-34917 I've changed 'moodle.php' from 'returntomaincoursepage' to 'maincoursepage' as a search revealed that only '/course/format/renderer.php' was using it. I'm not sure how to change all of the language packs. Cheers, Gareth P.S. Somehow I managed to commit my '.gitmodules' to my repository. I've been able to remove it but do not know (or can find an easy way) of removing the two specific add / remove commits, please help, thanks.
          Hide
          Gareth J Barnard added a comment -

          Updated screen shot with 'Main course page' - 'jt_mcp.png'.

          Question: Should the current section be listed in the drop down?

          Show
          Gareth J Barnard added a comment - Updated screen shot with 'Main course page' - 'jt_mcp.png'. Question: Should the current section be listed in the drop down?
          Hide
          Gareth J Barnard added a comment -

          I decided that it would be rational not to display the current section in the drop down, therefore commit added...

          https://github.com/gjb2048/moodle/commit/3e4ccf438814ac01f28013e5f5d81dcbbd696bee

          to patch...

          https://github.com/gjb2048/moodle/compare/moodle:MOODLE_23_STABLE...gjb2048:MOODLE_23_STABLE_MDL-34917

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - I decided that it would be rational not to display the current section in the drop down, therefore commit added... https://github.com/gjb2048/moodle/commit/3e4ccf438814ac01f28013e5f5d81dcbbd696bee to patch... https://github.com/gjb2048/moodle/compare/moodle:MOODLE_23_STABLE...gjb2048:MOODLE_23_STABLE_MDL-34917 Cheers, Gareth
          Hide
          Martin Dougiamas added a comment -

          Thanks Gareth!

          Actually now I'm looking at your last screenshot.... Why not remove 'Choose...' totally, and just have a full list of sections with the current one selected, plus "Main course page" at the very top. (I would keep the current one in the list so you can see context easily. You won't be able to reselect it anyway).

          And you need to include something for accessibility, so that a JAWS user, say, can easily work out what this little form is for. Not really sure what's best to do there ....

          Show
          Martin Dougiamas added a comment - Thanks Gareth! Actually now I'm looking at your last screenshot.... Why not remove 'Choose...' totally, and just have a full list of sections with the current one selected, plus "Main course page" at the very top. (I would keep the current one in the list so you can see context easily. You won't be able to reselect it anyway). And you need to include something for accessibility, so that a JAWS user, say, can easily work out what this little form is for. Not really sure what's best to do there ....
          Hide
          Gareth J Barnard added a comment -

          Dear Martin,

          Done! Please see 'jt_nch.png' and https://github.com/gjb2048/moodle/commit/817a387fb9fce42eb3dd804b0e279f3ae433ce8f

          To be honest I don't know how to do the changes for JAWS users yet. Who is the best person to contact for help and to test? Will the core code help as I'm using a 'single_select' class from '/lib/outputcomponents.php'?

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Martin, Done! Please see 'jt_nch.png' and https://github.com/gjb2048/moodle/commit/817a387fb9fce42eb3dd804b0e279f3ae433ce8f To be honest I don't know how to do the changes for JAWS users yet. Who is the best person to contact for help and to test? Will the core code help as I'm using a 'single_select' class from '/lib/outputcomponents.php'? Cheers, Gareth
          Hide
          Gareth J Barnard added a comment -

          Dear Martin and indeed all interested,

          I've been thinking about the change above and have produced a screen cast demonstrating the two different ways of the code working - http://youtu.be/gFlUy_wZn00 - thoughts?

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Martin and indeed all interested, I've been thinking about the change above and have produced a screen cast demonstrating the two different ways of the code working - http://youtu.be/gFlUy_wZn00 - thoughts? Cheers, Gareth
          Hide
          Derek Chirnside added a comment -

          @Martin, referring to your earlier comment.
          "On balance I'd leave the menu at the bottom ..."
          You seem to be choosing aestetics over useability. Putting the dropdown below means we are back to scrolling. Most people will have more than a screenful of stuff in a section, so we are back to scrolling.

          @Gareth: Martin said: "m unsure if that's going to look good with real section headings left and right" Is there any other option for between section navigation at the top to look a little better? eg replacing the heading in the middle?

          For example, trying other ideas, really outside the box: hard bottom left of section zero, using the same truncation setting that is in use in the navigation menu? I'm trying not to loose my focus here: no scrolling for simple between section navigation.

          -Derek

          Show
          Derek Chirnside added a comment - @Martin, referring to your earlier comment. "On balance I'd leave the menu at the bottom ..." You seem to be choosing aestetics over useability. Putting the dropdown below means we are back to scrolling. Most people will have more than a screenful of stuff in a section, so we are back to scrolling. @Gareth: Martin said: "m unsure if that's going to look good with real section headings left and right" Is there any other option for between section navigation at the top to look a little better? eg replacing the heading in the middle? For example, trying other ideas, really outside the box: hard bottom left of section zero, using the same truncation setting that is in use in the navigation menu? I'm trying not to loose my focus here: no scrolling for simple between section navigation. -Derek
          Hide
          Gareth J Barnard added a comment -

          @Derek,

          I disagree, aesthetically as it stands the format now looks like the layout of a page in a book, so familiar with a wizzy navigation at the bottom. Replacing the heading at the top is not a solution, it will just annoy users who are transitioning from a paper to an electronic based environment as it gives them a less frame of reference upon which to relate. I don't think you can ever avoid the 'Scroll of death' as it just creeps in there to remind us we have overloaded the user with too much information in a section. The finite smallest element in any system should be easy to understand and take in. Currently that element in Moodle is the 'section'. If to solve this 'sub sections' were introduced then we would be all talking about the 'Zoom of death'.

          I have also trimmed down the original implementation to what Martin has asked so I consider that the statement "m unsure if that's going to look good with real section headings left and right" no longer holds water in the current implementation.

          I think it's time to stop faffing around and get something out there that works and on the whole looks good. If everybody hates it, then it can be removed very easily, but if everybody loves it then 'job done' and we can go down the pub and discuss new wacky ideas to be implemented next.

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - @Derek, I disagree, aesthetically as it stands the format now looks like the layout of a page in a book, so familiar with a wizzy navigation at the bottom. Replacing the heading at the top is not a solution, it will just annoy users who are transitioning from a paper to an electronic based environment as it gives them a less frame of reference upon which to relate. I don't think you can ever avoid the 'Scroll of death' as it just creeps in there to remind us we have overloaded the user with too much information in a section. The finite smallest element in any system should be easy to understand and take in. Currently that element in Moodle is the 'section'. If to solve this 'sub sections' were introduced then we would be all talking about the 'Zoom of death'. I have also trimmed down the original implementation to what Martin has asked so I consider that the statement "m unsure if that's going to look good with real section headings left and right" no longer holds water in the current implementation. I think it's time to stop faffing around and get something out there that works and on the whole looks good. If everybody hates it, then it can be removed very easily, but if everybody loves it then 'job done' and we can go down the pub and discuss new wacky ideas to be implemented next. Cheers, Gareth
          Hide
          Derek Chirnside added a comment -

          Gareth, I'm not sure what you are disagreeing with.
          At present, I'm less happy with section to section navigation at the bottom, since we have scrolling to get to it. As I said in the forum, this came from some user testing last month, where usrs did not like scrolling down the nav bar.

          To restate: is there an option to put it at the top in some other place, some other configuration, even if aestetically it may not be as nice as at the bottom?

          The answer is of course yes. Whether there is something that looks aesthetically pleasing enough for you and Martin I don't know (eg my suggestion of using section zero). I know anything (almost) at the top suits me. I'd rather annoy users for a brief moment (as you describe) til they get used to the dropdown, rather than annoy them always with scrolling.

          -Derek

          Show
          Derek Chirnside added a comment - Gareth, I'm not sure what you are disagreeing with. At present, I'm less happy with section to section navigation at the bottom, since we have scrolling to get to it. As I said in the forum, this came from some user testing last month, where usrs did not like scrolling down the nav bar. To restate: is there an option to put it at the top in some other place, some other configuration, even if aestetically it may not be as nice as at the bottom? The answer is of course yes. Whether there is something that looks aesthetically pleasing enough for you and Martin I don't know (eg my suggestion of using section zero). I know anything (almost) at the top suits me. I'd rather annoy users for a brief moment (as you describe) til they get used to the dropdown, rather than annoy them always with scrolling. -Derek
          Hide
          Martin Dougiamas added a comment -

          Derek

          1) Why is there scrolling to get to it at the bottom? How long are your sections?

          2) How often do you think users are going to need random access to sections rather than using the next/prev links? And if you do see them jumping around a lot, is that perhaps an indication that you should put all the sections on one page anyway?

          Show
          Martin Dougiamas added a comment - Derek 1) Why is there scrolling to get to it at the bottom? How long are your sections? 2) How often do you think users are going to need random access to sections rather than using the next/prev links? And if you do see them jumping around a lot, is that perhaps an indication that you should put all the sections on one page anyway?
          Hide
          Derek Chirnside added a comment -

          Thanks Martin.

          Q1: How long are the sections? I try to encourage teachers to keep them short, but typically they could include label with a few intro items, maybe some links to a couple of videos, maybe some resources, an activity (forum for a post . .). 1-2 screenfuls maybe? I can get more data, but most sections do end up being more than a screen especially if you have a few visual elements in there as well, like embedded video, maps, pictures.

          Q2: Point taken. Some courses are linear, do A > B > C > Assess, done. But many courses I see provide a little more choice in learning trajectory.

          One common setup is this: sections A1, A2, A3, B1, B2, B3. Do all the A's first, in any order.

          Another common style is something like this: Intro, Weekly tasks/journal, Groupwork, Topics 1 > Topic X, References, Assessment, Administration, Where to now?? So if you are working in section X and want to pop over to a journal to post . . If you have posted in your journal and want to move on to next week's work . . this is where non-linear section <> section navigation comes in.

          The fact is if you put all the stuff on one page, you really don't get an easy to work with page unless it is a very simple course anyway, and then just use one section? You have just hit on the flaw in the new layout: there is no way to have "All sections on one page" when you have a single section layout, except in edit mode. I can live with this OK though, sad though it is.

          ie in the uses I am looking at, there is a degree of linearity, but a lot of non-linear as well. Which is why I'm interested in reducing scrolling in the section <> section navigation.

          -Derek

          Show
          Derek Chirnside added a comment - Thanks Martin. Q1: How long are the sections? I try to encourage teachers to keep them short, but typically they could include label with a few intro items, maybe some links to a couple of videos, maybe some resources, an activity (forum for a post . .). 1-2 screenfuls maybe? I can get more data, but most sections do end up being more than a screen especially if you have a few visual elements in there as well, like embedded video, maps, pictures. Q2: Point taken. Some courses are linear, do A > B > C > Assess, done. But many courses I see provide a little more choice in learning trajectory. One common setup is this: sections A1, A2, A3, B1, B2, B3. Do all the A's first, in any order. Another common style is something like this: Intro, Weekly tasks/journal, Groupwork, Topics 1 > Topic X, References, Assessment, Administration, Where to now?? So if you are working in section X and want to pop over to a journal to post . . If you have posted in your journal and want to move on to next week's work . . this is where non-linear section <> section navigation comes in. The fact is if you put all the stuff on one page, you really don't get an easy to work with page unless it is a very simple course anyway, and then just use one section? You have just hit on the flaw in the new layout: there is no way to have "All sections on one page" when you have a single section layout, except in edit mode. I can live with this OK though, sad though it is. ie in the uses I am looking at, there is a degree of linearity, but a lot of non-linear as well. Which is why I'm interested in reducing scrolling in the section <> section navigation. -Derek
          Hide
          Marina Glancy added a comment -

          Linking this to MDL-35218 for course formats refactoring

          Show
          Marina Glancy added a comment - Linking this to MDL-35218 for course formats refactoring
          Hide
          Derek Chirnside added a comment -

          Martin, after today I have on eother comment about this.
          You ask: "How often do you think users are going to need random access to sections rather than using the next/prev links?"

          Who are the users? If you mean course design that is totally linear and and the users are students who just move from one page to the next to read content, then the current setup is enough.

          But I was working with a tutor. He had students at a range of places in the course. He did need to do significant section <> section navigation. Then there was the question of doing some fixes to the course. Again a lot of random section <> section navigation.

          -Derek

          Show
          Derek Chirnside added a comment - Martin, after today I have on eother comment about this. You ask: "How often do you think users are going to need random access to sections rather than using the next/prev links?" Who are the users? If you mean course design that is totally linear and and the users are students who just move from one page to the next to read content, then the current setup is enough. But I was working with a tutor. He had students at a range of places in the course. He did need to do significant section <> section navigation. Then there was the question of doing some fixes to the course. Again a lot of random section <> section navigation. -Derek
          Hide
          Dan Poltawski added a comment -

          Assigning this one to Marina, because shes taking on these course format related changes.

          Show
          Dan Poltawski added a comment - Assigning this one to Marina, because shes taking on these course format related changes.
          Hide
          Gareth J Barnard added a comment -

          Dear Marina Glancy

          If I provided a master pull branch with all the changes, would that help get this into core?

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Marina Glancy If I provided a master pull branch with all the changes, would that help get this into core? Cheers, Gareth
          Hide
          Gareth J Barnard added a comment -

          Dear Marina Glancy,

          I've taken over the issue as I've provided a master branch for the improvement. Please give me a slap if this was not appropriate. Perhaps you would be so kind as to peer review?

          There are more changes in 'renderer.php' than the improvement requires as I've eliminated all 'code checker' warnings.

          I'm leaving the Moodle 2.3 branch as a reference to the original improvement but not to be integrated.

          Kind regards,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Marina Glancy , I've taken over the issue as I've provided a master branch for the improvement. Please give me a slap if this was not appropriate. Perhaps you would be so kind as to peer review? There are more changes in 'renderer.php' than the improvement requires as I've eliminated all 'code checker' warnings. I'm leaving the Moodle 2.3 branch as a reference to the original improvement but not to be integrated. Kind regards, Gareth
          Hide
          Marina Glancy added a comment -

          Hi Gareth,

          Your patch obviously fixes the issue but the biggest question here - do we really want to implement this in core? IMHO it does not make sense for weeks course format in the most cases - why would user want to quick jump to another random week? Next/prev and main page should be enough. For topics format it is also doubtful.

          We should ask other developers here but I think that this issue should be closed as 'Not a bug'. The admin can always overwrite format_topics_renderer::print_single_section_page() in their theme and implement any quick jump there.

          Marina

          Show
          Marina Glancy added a comment - Hi Gareth, Your patch obviously fixes the issue but the biggest question here - do we really want to implement this in core? IMHO it does not make sense for weeks course format in the most cases - why would user want to quick jump to another random week? Next/prev and main page should be enough. For topics format it is also doubtful. We should ask other developers here but I think that this issue should be closed as 'Not a bug'. The admin can always overwrite format_topics_renderer::print_single_section_page() in their theme and implement any quick jump there. Marina
          Hide
          Gareth J Barnard added a comment -

          Dear Marina,

          Fair point, but if you would kindly read through the comments and the original forum post, there are users asking for it as a better solution to that already in place. Plus, I have spent considerable time making changes at Martin D's request. So, could this be voted upon both by the developers and the users to attain a fair multi-faceted perspective on it's need? I've found and been surprised by users desires as a developer as they see things in a different light.

          It was apparent from the forum discussion that the next / prev was not enough and users did not wish to go to the navigation block (especially if docked). If you have a twenty section course and you wish to move to from four to eighteen, then this is the quickest means of doing so. It does not remove any functionality, it adds to it, surely flexibility to support a range of navigational preferences is a good thing .

          Kind regards,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Marina, Fair point, but if you would kindly read through the comments and the original forum post, there are users asking for it as a better solution to that already in place. Plus, I have spent considerable time making changes at Martin D's request. So, could this be voted upon both by the developers and the users to attain a fair multi-faceted perspective on it's need? I've found and been surprised by users desires as a developer as they see things in a different light. It was apparent from the forum discussion that the next / prev was not enough and users did not wish to go to the navigation block (especially if docked). If you have a twenty section course and you wish to move to from four to eighteen, then this is the quickest means of doing so. It does not remove any functionality, it adds to it, surely flexibility to support a range of navigational preferences is a good thing . Kind regards, Gareth
          Hide
          Martin Dougiamas added a comment -

          I still support this for core topics and weeks formats. I've seen a few people replacing our navigation block and we are ourselves possible adding a feature to temporarily hide all blocks (for small screen use) so this would be welcome, I think.

          Marina, could you peer review the code itself and make sure it's OK?

          Show
          Martin Dougiamas added a comment - I still support this for core topics and weeks formats. I've seen a few people replacing our navigation block and we are ourselves possible adding a feature to temporarily hide all blocks (for small screen use) so this would be welcome, I think. Marina, could you peer review the code itself and make sure it's OK?
          Hide
          Marina Glancy added a comment -

          Master patch looks good to me.
          There is no branch for 2.4 at all and 2.3 diff is not really working good (probably something needs rebasing).

          Show
          Marina Glancy added a comment - Master patch looks good to me. There is no branch for 2.4 at all and 2.3 diff is not really working good (probably something needs rebasing).
          Hide
          Gareth J Barnard added a comment - - edited

          Dear Marina Glancy,

          Thank you for reviewing the code.

          As stated above "I'm leaving the Moodle 2.3 branch as a reference to the original improvement but not to be integrated." so did not need to be reviewed as this is an improvement and the rules state that improvements can only be on the master branch. At the time of initial creation some six months ago I did not know this and Moodle 2.4 had not been created.

          Therefore to avoid future confusion I have removed the reference. I cannot seem to remove the 'affects' to M2.3 though.

          Resubmitting for peer review.

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - - edited Dear Marina Glancy , Thank you for reviewing the code. As stated above "I'm leaving the Moodle 2.3 branch as a reference to the original improvement but not to be integrated." so did not need to be reviewed as this is an improvement and the rules state that improvements can only be on the master branch. At the time of initial creation some six months ago I did not know this and Moodle 2.4 had not been created. Therefore to avoid future confusion I have removed the reference. I cannot seem to remove the 'affects' to M2.3 though. Resubmitting for peer review. Cheers, Gareth
          Hide
          Gareth J Barnard added a comment -

          Dear Michael de Raadt,

          As Marina Glancy has already reviewed the code and passed the master patch does this issue need reviewing again? As I've removed the problem branch because this is an improvement.

          Thanks,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Michael de Raadt , As Marina Glancy has already reviewed the code and passed the master patch does this issue need reviewing again? As I've removed the problem branch because this is an improvement. Thanks, Gareth
          Hide
          Marina Glancy added a comment -

          Gareth,
          I took a closer look. Your code may be improved a little.

          Small suggestion for readability. Instead of

          $showsection = (has_capability('moodle/course:viewhiddensections', $context)
                or $thissection->visible or !$course->hiddensections);
          

          you can say

          $showsection = $thissection->uservisible or !$course->hiddensections;
          

          Also it's preferable to use url_select and not single_select and form $sectionmenu as

          $sectionmenu[course_get_url($course, $section)] = get_section_name($course, $section);
          

          This way you won't hardcode how to form view url for particular section.

          Regards,
          Marina

          Show
          Marina Glancy added a comment - Gareth, I took a closer look. Your code may be improved a little. Small suggestion for readability. Instead of $showsection = (has_capability('moodle/course:viewhiddensections', $context) or $thissection->visible or !$course->hiddensections); you can say $showsection = $thissection->uservisible or !$course->hiddensections; Also it's preferable to use url_select and not single_select and form $sectionmenu as $sectionmenu[course_get_url($course, $section)] = get_section_name($course, $section); This way you won't hardcode how to form view url for particular section. Regards, Marina
          Hide
          Gareth J Barnard added a comment -

          Dear @marina,

          Thank you so much for your suggested improvements . I'm still learning the Moodle API.

          I'll crack on with them tomorrow as late at night in England.

          Thanks again,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear @marina, Thank you so much for your suggested improvements . I'm still learning the Moodle API. I'll crack on with them tomorrow as late at night in England. Thanks again, Gareth
          Hide
          Derek Chirnside added a comment -

          I know this is late, but is it possible to have the best of both worlds, 'jump to' there for topics but not weeks?

          -Derek, who has only quickly skimmed the recent flurry of comments here and may be wasting your time.

          Show
          Derek Chirnside added a comment - I know this is late, but is it possible to have the best of both worlds, 'jump to' there for topics but not weeks? -Derek, who has only quickly skimmed the recent flurry of comments here and may be wasting your time.
          Hide
          Gareth J Barnard added a comment -

          Dear Derek Chirnside,

          My first reaction is to go out to the middle of a field and scream.

          My second reaction is that there needs to be consistency, so having it in the base format renderer by default means that all course formats will use the code unless they override it. And hence lots of admins / support personnel will not get questions of 'why does this course do that but I can't in the other course'. However as it can be overridden then a particular installation / format can choose to do so consciously and therefore take responsibility for educating it's users.

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Derek Chirnside , My first reaction is to go out to the middle of a field and scream. My second reaction is that there needs to be consistency, so having it in the base format renderer by default means that all course formats will use the code unless they override it. And hence lots of admins / support personnel will not get questions of 'why does this course do that but I can't in the other course'. However as it can be overridden then a particular installation / format can choose to do so consciously and therefore take responsibility for educating it's users. Cheers, Gareth
          Hide
          Gareth J Barnard added a comment -

          Dear Marina Glancy,

          All changes completed as requested. Branch rebased and squashed. Please would you kindly peer review.

          Thanks,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Marina Glancy , All changes completed as requested. Branch rebased and squashed. Please would you kindly peer review. Thanks, Gareth
          Hide
          Gareth J Barnard added a comment -

          Dear Marina Glancy,

          Please could you peer review the changes.

          Thank you,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Marina Glancy , Please could you peer review the changes. Thank you, Gareth
          Hide
          Derek Chirnside added a comment -

          @gareth, very rare actually, I don't see things the way you do here.
          What is consistency? Is it the only high value? What about appropriateness.
          If you look at topics view it may be appropriate to have GOTO
          If you liik at weeks view it may be appropriate to have NEXT/PREVIOUS
          I may be wrong, but these things are sufficiently different in my mind that it is not a problem to have appropriate functionality for each view. I don't see that as being 'inconsistent'. I could get philiosopical here and say 'consistency is impossible', that's the that's the nature of the universe.
          I hope I have not mis interpreted your comment.

          At present, my suggestion still stands. Topics and Weeks to have navigation appropriate to the context.

          -Derek

          Show
          Derek Chirnside added a comment - @gareth, very rare actually, I don't see things the way you do here. What is consistency? Is it the only high value? What about appropriateness. If you look at topics view it may be appropriate to have GOTO If you liik at weeks view it may be appropriate to have NEXT/PREVIOUS I may be wrong, but these things are sufficiently different in my mind that it is not a problem to have appropriate functionality for each view. I don't see that as being 'inconsistent'. I could get philiosopical here and say 'consistency is impossible', that's the that's the nature of the universe. I hope I have not mis interpreted your comment. At present, my suggestion still stands. Topics and Weeks to have navigation appropriate to the context. -Derek
          Hide
          Gareth J Barnard added a comment - - edited

          Dear Derek Chirnside,

          By consistent I mean consistent in terms of functionality. The drop down will be the same for both topics and weeks (and indeed any other format that does not override it). The contents of the drop down will vary with format, so the topics will have sections and the weeks will have dates. Both format's still have the next / previous functionality. Inconsistent user interfaces chop and change all over the place and only tend to annoy and confuse the user.

          In terms of 'appropriateness' it adds another navigational dimension to the user interface to expand the set of users interface interaction preference thus providing a greater accessibility to those who previously did not get on with just the next / previous or moving to the navigation block.

          I cannot judge what a user will wish to use. I do however know that providing multiple means of interaction will support the needs of users from different sets. It's like with a word processor providing a graphical user interface as well as cursor control and short cuts. If all of the different means are seamlessly integrated in a consistent and elegant manner with no conflict of operation then users will be able to cherry pick the desired form of interaction which equals user satisfaction across a greater range of learners.

          Having taught in a school for 11-18 year old girls I learnt about providing a range of resources to facilitate engagement in learning of all the learners rather than concentrating on the kinesetic or verbal. For example, I customised the My Moodle page such that students could choose the colour scheme they wanted for their learning experience.

          Therefore, user satisfaction is based upon choice and not an enforced way of working through restriction.

          I hope I'm making sense, kind regards,

          Gareth

          Show
          Gareth J Barnard added a comment - - edited Dear Derek Chirnside , By consistent I mean consistent in terms of functionality. The drop down will be the same for both topics and weeks (and indeed any other format that does not override it). The contents of the drop down will vary with format, so the topics will have sections and the weeks will have dates. Both format's still have the next / previous functionality. Inconsistent user interfaces chop and change all over the place and only tend to annoy and confuse the user. In terms of 'appropriateness' it adds another navigational dimension to the user interface to expand the set of users interface interaction preference thus providing a greater accessibility to those who previously did not get on with just the next / previous or moving to the navigation block. I cannot judge what a user will wish to use. I do however know that providing multiple means of interaction will support the needs of users from different sets. It's like with a word processor providing a graphical user interface as well as cursor control and short cuts. If all of the different means are seamlessly integrated in a consistent and elegant manner with no conflict of operation then users will be able to cherry pick the desired form of interaction which equals user satisfaction across a greater range of learners. Having taught in a school for 11-18 year old girls I learnt about providing a range of resources to facilitate engagement in learning of all the learners rather than concentrating on the kinesetic or verbal. For example, I customised the My Moodle page such that students could choose the colour scheme they wanted for their learning experience. Therefore, user satisfaction is based upon choice and not an enforced way of working through restriction. I hope I'm making sense, kind regards, Gareth
          Hide
          Gareth J Barnard added a comment -

          Dear Marina Glancy and Michael de Raadt,

          Is there anything I can do to help get this in before the 29th March deadline?

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Marina Glancy and Michael de Raadt , Is there anything I can do to help get this in before the 29th March deadline? Cheers, Gareth
          Hide
          Marina Glancy added a comment -

          Hi Gareth,
          looks good to me. I would make code a little simplier:

          diff --git a/course/format/renderer.php b/course/format/renderer.php
          index 372f820..2276b4f 100644
          --- a/course/format/renderer.php
          +++ b/course/format/renderer.php
          @@ -575,26 +575,20 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
                   global $CFG;
                   $o = '';
                   $sectionmenu = array();
          -        $url = course_get_url($course);
          -        $url = str_replace($CFG->wwwroot, '', $url);
          -        $url = str_replace('&amp;', '&', $url);
          -        $sectionmenu[$url] = get_string('maincoursepage');
          +        $sectionmenu[course_get_url($course)->out(false)] = get_string('maincoursepage');
                   $modinfo = get_fast_modinfo($course);
                   $section = 1;
                   while ($section <= $course->numsections) {
                       $thissection = $modinfo->get_section_info($section);
                       $showsection = $thissection->uservisible or !$course->hiddensections;
          -            if (($showsection) && ($section != $displaysection)) {
          -                $url = course_get_url($course, $section);
          -                $url = str_replace($CFG->wwwroot, '', $url);
          -                $url = str_replace('&amp;', '&', $url);
          -                $sectionmenu[$url] = get_section_name($course, $section);
          +            if (($showsection) && ($section != $displaysection) && ($url = course_get_url($course, $section))) {
          +                $sectionmenu[$url->out(false)] = get_section_name($course, $section);
                       }
                       $section++;
                   }
           
          -        $select = new url_select($sectionmenu);
          -        $select->class = 'jumpmenu';
          +        $select = new url_select($sectionmenu, '', array('' => get_string('jumpto')));
          +        $select->class = 'select';
                   $select->formid = 'sectionmenu';
                   $o .= $this->output->render($select);
           
          

          but it's up to you.
          Can you submit it for integration yourself?

          Show
          Marina Glancy added a comment - Hi Gareth, looks good to me. I would make code a little simplier: diff --git a/course/format/renderer.php b/course/format/renderer.php index 372f820..2276b4f 100644 --- a/course/format/renderer.php +++ b/course/format/renderer.php @@ -575,26 +575,20 @@ abstract class format_section_renderer_base extends plugin_renderer_base { global $CFG; $o = ''; $sectionmenu = array(); - $url = course_get_url($course); - $url = str_replace($CFG->wwwroot, '', $url); - $url = str_replace('&amp;', '&', $url); - $sectionmenu[$url] = get_string('maincoursepage'); + $sectionmenu[course_get_url($course)->out( false )] = get_string('maincoursepage'); $modinfo = get_fast_modinfo($course); $section = 1; while ($section <= $course->numsections) { $thissection = $modinfo->get_section_info($section); $showsection = $thissection->uservisible or !$course->hiddensections; - if (($showsection) && ($section != $displaysection)) { - $url = course_get_url($course, $section); - $url = str_replace($CFG->wwwroot, '', $url); - $url = str_replace('&amp;', '&', $url); - $sectionmenu[$url] = get_section_name($course, $section); + if (($showsection) && ($section != $displaysection) && ($url = course_get_url($course, $section))) { + $sectionmenu[$url->out( false )] = get_section_name($course, $section); } $section++; } - $select = new url_select($sectionmenu); - $select->class = 'jumpmenu'; + $select = new url_select($sectionmenu, '', array('' => get_string('jumpto'))); + $select->class = 'select'; $select->formid = 'sectionmenu'; $o .= $ this ->output->render($select); but it's up to you. Can you submit it for integration yourself?
          Hide
          Gareth J Barnard added a comment -

          Dear Marina Glancy,

          Thanks, I've made almost all the changes bar 'jumpmenu' as it is a real css class used in standard and contributed themes + course formats. I had not twigged that the '$url' was a class instance and therefore could have methods as it was bugging me that the code was a little messy and not 'OO'.

          As per new 'code checker' rules in single commits for trackers I have reverted the comment clean up I performed bar just around the area I worked on.

          I am unable to submit for integration so have requested peer review such that it stays on your radar.

          Thanks again,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Marina Glancy , Thanks, I've made almost all the changes bar 'jumpmenu' as it is a real css class used in standard and contributed themes + course formats. I had not twigged that the '$url' was a class instance and therefore could have methods as it was bugging me that the code was a little messy and not 'OO'. As per new 'code checker' rules in single commits for trackers I have reverted the comment clean up I performed bar just around the area I worked on. I am unable to submit for integration so have requested peer review such that it stays on your radar. Thanks again, Gareth
          Hide
          Mary Evans added a comment -

          Gareth,

          If this is ready for Integration I can click the submit for integration button to set this in motion, otherwise you will miss the slot for this week.

          Show
          Mary Evans added a comment - Gareth, If this is ready for Integration I can click the submit for integration button to set this in motion, otherwise you will miss the slot for this week.
          Hide
          Gareth J Barnard added a comment -

          Dear Mary Evans,

          It is and that would be brilliant, thank you

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Mary Evans , It is and that would be brilliant, thank you Gareth
          Hide
          Mary Evans added a comment -

          Done!

          Show
          Mary Evans added a comment - Done!
          Hide
          Mary Evans added a comment -

          @Gareth: I assume it is rebased to match the current master branch?

          Show
          Mary Evans added a comment - @Gareth: I assume it is rebased to match the current master branch?
          Hide
          Gareth J Barnard added a comment -

          Dear Mary Evans,

          Thank you Mary - Branch is rebased and ready to rock and roll.

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Mary Evans , Thank you Mary - Branch is rebased and ready to rock and roll. Cheers, Gareth
          Hide
          Damyon Wiese added a comment -

          Thanks Gareth this works as advertised and has been integrated to master only.

          Show
          Damyon Wiese added a comment - Thanks Gareth this works as advertised and has been integrated to master only.
          Hide
          Rossiani Wijaya added a comment -

          This is working as expected.

          Tested for Master only.

          Test passed.

          Show
          Rossiani Wijaya added a comment - This is working as expected. Tested for Master only. Test passed.
          Hide
          Damyon Wiese added a comment -

          Thanks for your hard work. This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).

          Show
          Damyon Wiese added a comment - Thanks for your hard work. This issue has been integrated upstream and is now available via git (and in some hours, via mirrors and downloads).
          Hide
          Gareth J Barnard added a comment -

          Dear Helen Foster,

          I noticed that you wanted documentation for this. As this is a Moodle 2.5 improvement, where do I add it please? I cannot find a http://docs.moodle.org/25/en/Main_page.

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Helen Foster , I noticed that you wanted documentation for this. As this is a Moodle 2.5 improvement, where do I add it please? I cannot find a http://docs.moodle.org/25/en/Main_page . Cheers, Gareth
          Hide
          Helen Foster added a comment -

          Gareth, you are a star (or 'sun' as they say in Spanish)! Thanks for your willingness to provide documentation for this improvement.

          I'm currently going through the list of issues fixed in 2.5 and adding labels as necessary. Issues labelled docs_required will be looked at when the new 2.5 wiki is created, hopefully sometime in the week beginning 15 April 2013. Your help then would be much appreciated!

          Show
          Helen Foster added a comment - Gareth, you are a star (or 'sun' as they say in Spanish)! Thanks for your willingness to provide documentation for this improvement. I'm currently going through the list of issues fixed in 2.5 and adding labels as necessary. Issues labelled docs_required will be looked at when the new 2.5 wiki is created, hopefully sometime in the week beginning 15 April 2013. Your help then would be much appreciated!
          Hide
          Mary Cooch added a comment -

          (You are ahead of the field, Gareth!) Removing QA test required label as a test has been written here MDLQA-5251 for inclusion in the next cycle of testing.

          Show
          Mary Cooch added a comment - (You are ahead of the field, Gareth!) Removing QA test required label as a test has been written here MDLQA-5251 for inclusion in the next cycle of testing.
          Hide
          Gareth J Barnard added a comment -

          Dear Helen Foster and Mary Cooch,

          Is there now a wiki link for M2.5 that I can help with for this?

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear Helen Foster and Mary Cooch , Is there now a wiki link for M2.5 that I can help with for this? Cheers, Gareth
          Hide
          Helen Foster added a comment -

          Hi Gareth, how about here: http://docs.moodle.org/25/en/Course_formats

          Thanks a lot for your help.

          Show
          Helen Foster added a comment - Hi Gareth, how about here: http://docs.moodle.org/25/en/Course_formats Thanks a lot for your help.
          Hide
          Gareth J Barnard added a comment -

          Dear @tsala,

          Thanks you

          Reminds me to update the Collapsed Topics video too!

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - Dear @tsala, Thanks you Reminds me to update the Collapsed Topics video too! Cheers, Gareth
          Hide
          Gareth J Barnard added a comment - - edited

          Dear Helen Foster,

          Documentation updated on http://docs.moodle.org/25/en/Course_formats leaving reference to famous Australian tennis players

          Image is public domain from http://pixabay.com/en/active-activity-athletics-ball-15637/.

          Cheers,

          Gareth

          Show
          Gareth J Barnard added a comment - - edited Dear Helen Foster , Documentation updated on http://docs.moodle.org/25/en/Course_formats leaving reference to famous Australian tennis players Image is public domain from http://pixabay.com/en/active-activity-athletics-ball-15637/ . Cheers, Gareth
          Hide
          Mary Cooch added a comment -

          thanks Gareth for the update and the screenshot

          Show
          Mary Cooch added a comment - thanks Gareth for the update and the screenshot
          Hide
          Helen Foster added a comment -

          Removing docs_required label. Nice screenshot - thanks Gareth

          Show
          Helen Foster added a comment - Removing docs_required label. Nice screenshot - thanks Gareth

            People

            • Votes:
              6 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: