token_enrolment_logo

Token Enrolment demo

The Token Enrolment plugin for Moodle lets you issue short codes (“tokens”) that let a set number of users enrol themselves into a particular course. This can be an enrolment page for that course, or integrated into a registration system so that people are automatically enrolled into the correct course when they sign up.

Tokens can have start and end enrolment dates, enrolment duration, and learners can be notified before their enrolment expires; inactive users can be automatically unenrolled.

A token manager can check how many tokens were issued, set how many “seats” are available per token, prefix tokens in particular ways to make them more manageable.

Screen Shot 2015-11-30 at 9.21.06 PM

You could use this role to generate and issue tokens for organisations who use your system for their professional learning needs, issuing as many seats as they have learners (payment is not managed using this plugin).

Have a go

You are on the WordPress 2 Moodle demo site, so for simplicity we’re using that. There’s a system to register a dummy user onto our Moodle demo server (in most cases you’ll probably have your own registration system or page).¬†You’ll need to be registered to see the link, so use this quick form below to register a dummy account.[dummy-user]

Launch the demo site

Open the Sustainable Work Practices course. You’ll be asked to enter an enrolment token. Try one from the list below (will be refreshed periodically). If you enter it wrong, or all the seats for that token are taken, you’ll be notified. Just try a different one!

6VazCHHfb
agAmGSfHn
amSWsO7Zr
BJQdp3tLD
cJrnsFcxb
DLLMwnmpu
eJ0nKBsJC
GdfoAtTBh
gfMfYznsV
Gy8EuxtP8
JfR5x7QM5
joXpM4U79
MBAS8naFX
nGRtgzjuX
ocx0PgLBN
PGFZUpZg7
PucgEtRZ9
q7xm5Rvs7
s9wCtSzQE
TSYjHFYGA
VEddPz6MZ
VqPnByMXZ
Xmanf2nb2
xNhyBMKSr

Custom code

If you’re a developer, you might like to implement a form that lets your existing users enter a token (such code could be used in a html block or custom registration page). Here’s some code to get you started:

<form action="/enrol/token/passthrough.php" method="POST" name="tokenEnrol">
    <input maxlength="10" name="token" type="text" />
    <input type="submit" value="Enrol Me" />
</form>

<script type="text/javascript">
function getParameterByName(a){a=a.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");a=(new RegExp("[\\?&]"+a+"=([^&#]*)")).exec(location.search);return null==a?"":decodeURIComponent(a[1].replace(/\+/g," "))
}

var e=getParameterByName("tokenerr");

switch(e){case "":e=null;break;case "1":e="Sorry, you have used too many tokens in a short period. Please try again later.";break;case "2":e="Sorry, that token is not valid for enrolment.";break;case "3":e="Sorry, that token cannot be no longer be used for enrolments.";break;case "4":e="Sorry, that token has expired and can no longer be used for enrolments.";break;case "5":e="Sorry, a system error occurred whilst enroling with your token.";break;default:e="Sorry, you can't enrol enrol in that course using a token."}

null!==e&&document.write('<div class="error">'+e+'</div>');
</script>

Where to get it?

The plugin is available on our GitHub page.