Moodle Plugins directory: Badge Awarder | Moodle.org
Badge Awarder
This block has been created to enable quick and simple awarding of pre-existing badges in a given course by processing a CSV file upload. Both existing students and non-students can be awarded badges using this block. In the case of non-students, their details are used to generate new student accounts, they are then enrolled on the relevant course and are emailed their Moodle login details.
Usage
Install the block in the /blocks/ folder
Ensure the plugin folder is called "badgeawarder"
Navigate to Site Administration -> Notifications to start installation
Login as an Administrator or Teacher or an account with course editing privilege.
Navigate to the course you wish to award the badges for.
Turn editing on and add the Badge Awarder block within the new course.
You will then see the Badge Awarder block with its link, "Upload Badges CSV". Once clicked, this will bring you to the Badge CSV upload page.
The Badge CSV upload page uses the File Picker for you to select the relevant CSV file to upload, and also allows you to select the delimiter, encoding and number of rows to show on the Preview screen.
Click on the Preview button to submit the CSV file and view the pending user details, then click on the "Award badges" button and the CSV file will be fully processed.
CSV File format
The CSV file must include these field values in the CSV file's first line, and will be processed based on these specified columns. The badge information required is the course badge name, viewable under Course badges.
firstname,lastname,email,badge
Prerequisites
In order to award a badge by using the Badge Awarder block, the badge itself must have been set up already and enabled, and particularly, set with the single criteria of "Manual issue by role". If the badge itself is set to either of the other two options, Course completion or Activity completion, it will not be successfully awarded by the Badge Awarder block.
In order to enrol either existing students or non-students as part of their badge awarding, the relevant course itself must be enabled for manual enrolments.
The Badge Awarder block also expects to work with a sitewide unique user emails policy, which the CSV upload file must also follow.
Enrolment of non-students may be inadvisable for Moodle sites which serve as MNet service providers, due to user account identification and authentication limitations.
I see you have already fixed the badgeawarder/README.txt.txt file in your
Github repository (as reported by the validator), thanks for that. You may
consider uploading the updated ZIP with the fix. Please do no hesitate to
rename it back to README.md. We are going to allow .md as a valid extension
for README files here soon.
You may also consider fixing the @package doc tag so it holds the
"block_badgeawarder" value in all files.
The sample badges included with the block - are they your own ones? Or were
they obtained from some other source? If they were obtained from elsewhere,
then we need some information about their origin and their license for
checking the compatibility with GPL'ed code (probably in a separate file
within the samples folder). Note that GPL is pretty strict when it comes to
including other's work and distributing it in one package.
Let me recommend to develop your block with full DEBUG_DEVELOPER mode on and
debug messages displayed. The .= operator at the line 68 of
block_badgeawarder.php throws PHP notice (I know, trivial, but we are aiming
for none notices thrown ideally).
The documentation for your block should also mention that it is usable only in
courses with manual enrolment method available. Also, technically, on sites
that serve as MNet service providers, the user's email itself is not enough
for user accounts identification (as it is unique withing the given mnethostid
only). You may wish to mention that the block expects unique user emails
sitewide.
The idea of auto-creating and enrolling users into the course is interesting.
If it was me, I would personally prefer "do one thing and do it well"
principle. But I respect that as your design decision that is out of scope
this initial review.
Otherwise all looks good to me. Thanks for payin attention to following the
Moodle coding style. The only blocker for now is that uncertain situation with
the badges samples. Once that is clarified and other issues mentioned above
are fixed and new version is uploaded, I'll be happy to approve this plugin.
For now, I am going to mark this plugin as needing more work. Thanks for your
patience with the review and approval process.
I really appreciate your initial review of the badgeawarder plugin and my sincerest apologies for there being a few issues with it!
The idea of auto-creating users in addition to enrolling them into the course as well as awarding badges was part of a client requirement, but I've changed this by having the default mode set to "Award to existing users only".
I've updated the @package doc tag to "block_badgeawarder" value in all files as suggested.
I've removed the mistakenly included samplebadges folders as they were not intended to be in the plugin release code, they were for internal testing only and I'm not sure of their source.
I've also updated the readme documentation with the suggested issues.
Thanks again for your time and help with this plugin submission.
We tried Badge Awarder block and it works, but we would like to add Badge Awarder block to Moodle 2.6 main page aswell. Is it possible to do that?
Would appreciate any help
Janne
Does it work in Moodle 3.x?
Ricardo
Any update to Moodle 3.4?
Ricardo
I am using Moodle 2.6.
May I know whether the Badge Awarder block can work if the badge name is in Chinese?
I have tried but not success.
Katherine
Hence, your issue is probably somewhere in your badge configurations instead. Have you checked that :
The course (where the badge is) is enabled for manual enrolments
Badge status is enabled as "Available to users"
Criteria is "Awarded by ANY of: Manager, Non-editing teacher, Teacher, Lecturer"
The CSV file format is like the example I've explained in the documentation?
--------
firstname,lastname,email,badge
judy+3@example.com,Hobbs,Judy,徽章1
janice+4@example.com,Kline,Janice,徽章1
I'm using 3.6 and it appears that the 3 mode options don't appear when I upload a .csv so it defaults to Create New Users, but I definitely don't want to do this!
Do we know if this is a base version issue or if anyone else has experienced this?
Thanks,
Juli
There are two ways to set the 3 import mode options of "Award to new users only", "Award to all users, create non-existing users", "Award to existing users only".
The first way to set the default mode in the plugin global settings, at /admin/settings.php?section=blocksettingbadgeawarder.
The second way, which would be useful for you, is to initially set "Show Extended Options" to Yes in the plugin global settings. This is disabled by default. Once that is enabled, you may then set the import mode from the dropdown each time that you upload your CSV file of badges to award!
Question: Is this limited to Course Badges? Or does it work for Site Badges? Course Badges are explicitly mentioned in the documentation but Site Badges are not mentioned at all. We are primarily focused on Site Badges.
Thanks!
Many thanks for your plugin.
Could you build this plugin for Moodle v4.x?