Navigation buttons

Blocks ::: block_navbuttons
Maintained by DavoDavo Smith
Add customisable navigation buttons (next/prev/etc.) to the bottom of each activity page (Moodle 1.9/2.0+)
Latest release:
722 sites
223 downloads
44 fans
Current versions available: 4

badge.svg

Navigation buttons (for Moodle 1.9 / 2.0+)
This block adds customisable navigation buttons (first/previous/next/etc.) to the bottom of each activity/resource page in a course.

It is based on an idea from Penny Mondani: http://pennymondani.com
Thanks also to the US company that sponsored the development, who wish to remain anonymous.

Installation:

  1. Download the file and unzip it somewhere convenient.
  2. On your server, in the 'blocks' folder, create a subfolder called 'navbuttons'
  3. Upload all the files inside the 'davosmith-moodle-navbuttons-???????' folder to this new 'navbuttons' folder on your server.
  4. Log in to your Moodle site as an administrator and click on the 'Notifications' option in the Admin settings block.
  5. If you are running a version of Moodle earlier than 3.10, you need to make a small change to one Moodle core file to make this work (the change is different between Moodle 1.9 & Moodle 2.0 - see the included README.txt for details).
  6. Add the block to a course (turn editing on, select 'Navigation Buttons' from the 'Blocks - Add' menu)
  7. Customise the button appearance by clicking on 'Edit the Navigation Button settings' in the newly created block.
  8. Check the message at the bottom of the screen (under the 'Save changes' button) - it should read "Navbuttons self-test: required core modifications have been completed successfully". If not, then go back to step 5 above and check carefully.

Note: The block is only visible to users who are able to edit courses modules. Deleting the block will remove the navigation buttons (they can also be disabled through the settings).

For a quick demo, there is a screencast available here:

Screenshots

Screenshot #0

Contributors

Davo
Davo Smith (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Chye Siaw
    Fri, 28 Sept 2018, 5:42 PM
    Hi, whenever we update our moodle, this plugin does not seem to carry over to the new version. As a result we have to re-add the navbutton block to every course each time we update moodle.

    Is there something we should be doing instead? How do we make the navbutton blocks for each course carry over to the new moodle?

    Also, is there a way to change the default icons on navbuttons? We tried replacing the png files in moodle/blocks/navbuttons/pix but it doesn't do anything. As we need to add the block to each course, then add our own icons for each block, this seems to be taking more effort than it should have. Is there an easier way to do it?
  • Davo
    Fri, 28 Sept 2018, 5:51 PM
    Hi Chye Siaw,

    I can think of no reason why the block would need adding to every course when upgrading - certainly my local test copy of Moodle has been upgraded a great many times without ever needing to do this.

    Replacing the blocks/navbuttons/pix/* files is the correct way to change the default icons - if that doesn't change anything, then you need to clear your site or browser cache to see the difference.

    Ideally if I was rewriting this plugin now, I'd introduce a better way of handling configuration across multiple courses, but it was written a long time ago and I'm unlikely to overhaul it anytime soon.
  • darwin palma
    Tue, 20 Nov 2018, 1:10 AM
    Hello, is there any way to set by default the block at every course in the site?
  • Davo
    Tue, 20 Nov 2018, 1:11 AM
    Darwin - sorry that is not currently possible.
  • Abdul Ghaffar
    Mon, 1 Apr 2019, 9:21 PM
    Hi, we are using navbuttons release = '2.2+ (Build: 2017100900)' in our project. We need to be VPAT and ADA compliant however below is an issue that needs to be resolved:
    Issue: Form control label is missing text (Next activity button) < label class = "lblNavigationButton branchbuttoncontainer" style= "z-index: 2147483646; position: relative;" >< input type = "submit" n ame = "navbutton" value = "Next activity: Is Everyone Drinking?" style = "" > label >
    Recommendation: Add the text for the form element within the label-tag or WAI-ARIA 'aria-label' or 'aria-labelledby' attribute that is already present.

    I think above code is being generated from file '"moodle/blocks/navbuttons/footer.php"'
    Please advise.
  • Davo
    Thu, 4 Apr 2019, 2:43 AM
    Hi Abdul,

    Just to confirm - the buttons are output by the make_navbutton() function in footer.php. If you want to add extra output on your site, then that is the function you'll need to edit, in order to add the label you want.

    Davo
  • Abdul Ghaffar
    Fri, 18 Oct 2019, 12:24 PM
    Hi Davo,
    I have upgraded my Moodle from 3.3.3 to 3.7.2 . And also updated navbuttons from '2.2+ (Build: 2017100900)' to $plugin->version = 2018042100;
    $plugin->release = '3.4+ (Build: 2017100900)';

    In file moodle/blocks/navbuttons/activityready.php, there is a method

    /**
    * @param $cm
    * @return bool
    */
    function navbuttons_mod_questionnaire_showbuttons($cm) {
    global $USER, $DB;
    return $DB->record_exists('questionnaire_attempts', array(
    'qid' => $cm->instance,
    'userid' => $USER->id
    ));
    }

    As per my knowledge, 'questionnaire_attempts' table has been removed, have a look at https://moodle.org/mod/forum/discuss.php?d=392394 . I am getting exception due to this.
  • Davo
    Fri, 18 Oct 2019, 3:00 PM
    Hi Abdul,

    I've just pushed a fix to github that should address that problem (it will simply show the buttons always, rather than waiting until you have submitted an attempt).

    As an alternative, you could simply change the settings for the navbuttons (on the global settings page, not the per-course settings), so that they are set to 'Always show' or 'Show when complete' for questionnaires, instead of 'when questionnaire submitted'.
  • Davo
    Mon, 18 Nov 2019, 4:26 PM
    Seems to be working with Moodle 3.8, without any changes (new version released with mod_questionnaire compatibility fix).
  • Dinis Medeiros
    Mon, 18 Nov 2019, 5:06 PM
    Thanks for the plugin.
    Why it's not in AMOS for translation? I'm PT-PT translator. Only in GitHub?
  • Davo
    Mon, 18 Nov 2019, 5:09 PM
    Dinis - because of the necessary small core change, Moodle HQ has recategorised the plugin as 'Other', rather than 'Block'. This breaks just about all of the automated systems associated with the plugins database (automatic filling-in of details from version.php, integration with AMOS, etc.)

    There is nothing I can do about it as long as the plugin is still in the 'Other' category (I had hoped to remove the core change when some new hooks were added a to the Moodle footer a couple of years back, but those hooks were implemented in a way that doesn't allow extra output to be inserted, so I'm still stuck with the core change).
  • Dinis Medeiros
    Mon, 18 Nov 2019, 5:32 PM
    Sorry about that. I will pull a request in GitHub. Thanks
  • marisol castro
    Thu, 30 Apr 2020, 8:32 AM
    I am running moodle 3.7+ and have installed the latest download of this plugin and followed each step in the readme file but the red message when I go to add the block will not disappear. I modified the /moodle/lib/outputrenders.php file with the code you provided but it is just not working for me. What am I missing?
  • Antonio Carrieri
    Wed, 20 May 2020, 6:03 PM
    Hello, great block plugin, would it be possible to show "next activity" button even if next activity is not yet accessible? i have SCORM packages as activities and even if student complete the SCORM activity, he doens't get the "next activity" button
  • Davo
    Wed, 20 May 2020, 7:07 PM
    Antonio - you could probably open up the file footer.php in the plugin and remove the lines: if (!$mod->uservisible) { continue; }

    That would mean that the next activity in the course is linked to, even if it is hidden or not available due to conditional restrictions, but that will lead to lots of error screens if the activity is still not available to the user after they've clicked on the link (so hiding an activity in the course would lead to everyone getting an error when reaching it, rather than just skipping over it to get to the next activity).

    An alternative might be more complex code that refreshes the buttons via javascript once the activity is complete, but that is beyond the scope of what I'd be able to do in my spare time (maybe could be tackled in work time, if you had a budget to pay for it).
Please login to post comments