Blocks: Enrolment Timer

block_enrolmenttimer
Maintained by Picture of Learning WorksLearning Works, Jeremy self portraitJeremy FitzPatrick, Picture of Mathew May 🇳🇿Mathew May 🇳🇿, Picture of Zander PotgieterZander Potgieter
Block to show the user their remaining time enrolled in a course with live countdown and lots of settings to customise the display of this timer.
435 sites
434 downloads
52 fans
Current versions available: 2

Enrolment Timer Block

Build Status

This block provides the functionality to display the remaining time a user has in their enrolment period - including a live JavaScript countdown timer. There are many settings to choose from to customise the way this is displayed to the user; in text, with numbers, customisable units and so on.

Emailing functionality is also included, You can enable a setting for students to be notified by email when their enrolment is expiring in a set amount of days (Default 10). Email notifications can also be enabled to congratulate a student on passing the course. This email is sent after the student receives a required grade in the course_total grade.

The plugin has been developed with limited styling to enable the best possible base for theme overrides to align the design with your existing Moodle theme.

Developed by LearningWorks Ltd


Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Picture of Learning Works
Learning Works (Lead maintainer)
Jeremy self portrait
Jeremy FitzPatrick
Picture of Mathew May 🇳🇿
Mathew May 🇳🇿
Picture of Zander Potgieter
Zander Potgieter: Maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Picture of Josiah Carberry
    Tue, Apr 18, 2017, 2:02 PM
    I have enabled email to students reminding them that enrollment is coming to an end. Admins are also getting an email every single day reminding them of this fact. Can this be reconfigured so as to get only one email, at the value of "Days to alert on" before the end of the enrollment period?
  • Picture of Learning Works
    Thu, Apr 20, 2017, 11:58 AM
    Hi Josiah,

    We have changed the logic so that the plugin will email anyone with an enrollment end date where the end date minus days to alert occurs between the current date and the next cron run. This means a user should only be mailed once per course.
    Regards, Mathew.
  • Picture of James Nicolson
    Sat, Jun 3, 2017, 1:41 AM
    Hi

    I have just installed the plugin but noticed that it is throwing a console error. The plugin still seems to work as expected but because of this error it starts to impact other plugins that are also dependent on javascript. The error that is being generated is

    Uncaught Error: Mismatched anonymous define() module: function ($){var options=[],arrayKeys=[],timestamp=0,forceTwoDigits=false;$(document).ready(function(){function getDisplayedOptions(){var children=$('.block_enrolmenttimer .active .timer-wrapper').find('.timerNum');for(var i=children.length-1;i>=0;i--){var arrayKey=$(children[i]).attr('data-id');arrayKeys.push(arrayKey)}}
    function populateWithData(){for(var i=arrayKeys.length-1;i>=0;i--){var option=$('.block_enrolmenttimer .active .text-desc .'+arrayKeys[i]).text();options[arrayKeys[i]]=option}}
    function makeTimestamp(){for(var i=arrayKeys.length-1;i>=0;i--)switch(arrayKeys[i]){case'seconds':timestamp+=parseInt(options[arrayKeys[i]],10);break;case'minutes':timestamp+=parseInt(options[arrayKeys[i]],10)*60;break;case'hours':timestamp+=parseInt(options[arrayKeys[i]],10)*3600;break;case'days':timestamp+=parseInt(options[arrayKeys[i]],10)*86400;break;case'weeks':timestamp+=parseInt(options[arrayKeys[i]],10)*604800;break;case'months':timestamp+=parseInt(options[arrayKeys[i]],10)*2592e3;break;case'years':timestamp+=parseInt(options[arrayKeys[i]],10)*31536e3;break}}
    function updateMainCounter(counter,time){var html='';if(forceTwoDigits===true&&time.toString().length==1){html+='0';html+=''+time.toString()+''}else for(var i=0;i'+time.toString().charAt(i)+'';$('.block_enrolmenttimer .active .timer-wrapper .timerNum[data-id="'+counter+'"]').html(html);$('.block_enrolmenttimer .active .text-desc .'+counter).html(time)}
    function updateLiveCounter(){timestamp--;var time=timestamp,tokens=['years','months','weeks','days','hours','minutes','seconds'],units=['31536000','2592000','604800','86400','3600','60','1'];for(var i=0;i=units[i]){var count=Math.floor(time/units[i]);updateMainCounter(tokens[i],count);time=time-(count*units[i])}else updateMainCounter(tokens[i],0)};if($('.block_enrolmenttimer .active').length>0){getDisplayedOptions();populateWithData();makeTimestamp();window.setInterval(function(){updateLiveCounter()},1e3)};if($('.block_enrolmenttimer .timer-wrapper[data-id=force2]').length>0)forceTwoDigits=true})}
    http://requirejs.org/docs/errors.html#mismatch
    at B (require.min.js:12)
    at J (require.min.js:27)
    at Object.g [as require] (require.min.js:27)
    at requirejs (require.min.js:27)
    at footer:1

    Should I create a ticket on the repo for this? Is this something that has been noticed by others?

    I am using the latest version 3.3.0 2017051200. Issue in both firefox and chrome.
  • Picture of Learning Works
    Tue, Jun 6, 2017, 7:11 AM
    Hi James,

    What version of Moodle did you install the plugin on? We will look into this error and try to find a solution.

    Regards,
    Mathew
  • Picture of Learning Works
    Fri, Jun 9, 2017, 10:00 AM
    Hi James,

    The Javascript issue you were encountering should be fixed in the latest version smile

    Regards,
    Mathew
  • Picture of Hiro I
    Mon, Sep 18, 2017, 11:37 PM
    I have some questions about how flexible Enrolment Timer be set in different courses.

    While setting up Alert Email Notifications in Enrolment Timer settings, is it possible to set a different number of days (‘Days to alert on’) in different courses? The setting seems only one specific number of a day for all the courses.

    Also when we enable ‘Enable Time Warning Email’ setting, Is there way to control which courses will receive this particular email? What if we want only send a message to a few courses but not all?

    Regards,
    Hiro
  • Ricardo Caiado
    Sat, Mar 17, 2018, 10:33 PM
    Hi,

    Any update to Moodle 3.4?

    Ricardo
  • Picture of Deependra Singh
    Thu, Jun 14, 2018, 2:20 PM
    Hi,
    Any update for Moodle 3.5 or with privacy api intregated?

    Deependra
  • Picture of Mathew May 🇳🇿
    Mon, Jun 18, 2018, 7:09 AM
    Hi Deependra,

    We are still investigating how to best implement the privacy API within the block, until that time there will not be an release for 3.5.
    We appreciate your understanding.

    Mathew
  • Hi Aaron,

    Your plugin is great. However, is there a way to make it work with the course end date?
  • Picture of Mathew May 🇳🇿
    Tue, Jul 17, 2018, 4:36 AM
    Hi Antonio,

    There are no current plans to include that functionality yet. We are however currently implementing the privacy api so it is 3.5+ compliant. We are open to pull requests for functionality if you wish to see it in the block.

    Mathew
  • Picture of Jamie Zelenak-Hyre
    Thu, Apr 4, 2019, 1:24 AM
    Hi Mathew, any update on this plug-in for 3.5+? We love your plug-in.
    ~Jamie
  • Picture of Zander Potgieter
    Fri, Sep 20, 2019, 9:16 AM
    Hi Jamie & others,

    The plugin have been updated to support Moode 3.5+ versions - including the Privacy API.

    Thank you for your support.

    Thanks,
    Zander
  • Picture of cerita melayu
    Sat, Sep 21, 2019, 10:15 AM
    how do i install the block timer because when i add block no block timer appears
  • Picture of Zander Potgieter
    Sat, Sep 21, 2019, 12:35 PM
    Hi Cerita,

    Please ensure you’re logged in as a student to see the timer appear.

    There’s also a plugin setting that determine if anything is shown when there is no end time set which may affect it - it’s called ”Hide block (No End Date Set)”.

    Hope that helps! smile

    Thanks,
    Zander
Please login to post comments