Your Moodle version

Blocks: Badge Awarder

block_badgeawarder
Maintained by Picture of Karen Holland Karen Holland
This block allows teachers to quickly and simply award badges in a given course by processing a CSV file upload.
728
3

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.

Screenshots

Screenshot
Screenshot
Screenshot

Contributors

Picture of Karen Holland
Karen Holland (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of David Mudrák
    Tue, May 20, 2014, 6:07 AM
    Hi Karen. Many thanks for sharing this plugin with the Moodle community.

    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.
  • Picture of Karen Holland
    Wed, May 28, 2014, 1:22 AM
    Hi David

    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.
  • Picture of David Mudrák
    Wed, May 28, 2014, 6:01 PM
    Hi Karen. Thanks for fixing all the raised issues. I re-checked the block functionality and the code and I am happy to say you are cleared to land now. Runway free, welcome to the Plugins directory!
  • Picture of Janne Mattikas
    Fri, Feb 13, 2015, 9:16 PM
    Hi

    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 smile

    Janne
Please login to post comments