Documentation:WordPress/Plugins/BadgeOS/Badge Triggers

From UBC Wiki

Commenting on a Post or Page

To trigger a badge for commenting on a post or page, enable comments on posts and pages on your site.
Go to: Dashboard>Appearance > Theme Options > Display Options to enable comments.

  1. Under Achievement Data, go to Earned by. From the drop-down, select Complete steps.
  2. Under Required Steps, click on Add New Steps
  3. A dropdown menu will appear under Required Steps.Select Comment on a Post Type. After you select the drop down, another drop down menu will appear, which allows you to select from:
    • Any Post Type - Badge will be awarded if badge earners comment on any posts, pages, Media or achievements. If you want badge earners to earn a badge only in specific post or pages, You can specify post ID . You can see this documentation to learn how to find out the post ID. You can also specify the numbers of comments required to earn the badge.
    • Pages- Badge will be awarded if badge earners comment on any pages. If you want badge earners to earn a badge only in specific pages, You can specify page ID . You can see this documentation to learn how to find out the page ID. You can also specify the numbers of comments required to earn the badge.
    • Media - Badge will be awarded if badge earners comment on any media. If you want badge earners to earn a badge only in specific media, You can specify media ID . You can see this documentation to learn how to find out the media ID. You can also specify the numbers of comments required to earn the badge.
    • Badges - Badge will be awarded if badge earners comment on any badges.
  4. Click Save All Steps
  5. From the menu on the right, click Publish.

Creating a New Page or Post

Please note that in order to make this trigger work, badge users has to be added to the site as an Editor, Author or Administrator. In order to add users to your CMS site, see How do I add a new user to my site?

  1. From the drop-down menu under Required Step, choose Publish a new page if you want to award a badge user when they post a new page. Choose Publish a new post if you want to award a badge user when they post a new post.
  2. If you want to issue badges for posts or pages published in a specific category, create the category and then select it from the "Any Categoy" drop-down list.
  3. If you want the badge to be issued after a specific number of new posts or pages, enter a number in the "times" box.
  4. Click Save All Steps
  5. From the menu on the right, click Publish.

Login to a Site

  1. From the drop-down menu under Required Step, choose [UBC]Login to the Website. Set the no. of required time of login.
  2. Press Save All Step.
  3. From the menu on the right, click Publish.
  4. In order for this trigger to work, you will have to create a login link for badge earners.
  5. Create your login URL. Your login URL for your website will be:https://cas.id.ubc.ca/ubc-cas/login?service=https%3A%2F%2Fsites.olt.ubc.ca%2Fwp-login.php%3Fredirect_to%3Dhttp%3A%2F%2FYour Site URL%2F?badgelogin=1. For example, if your website is dt1.sites.olt.ubc.ca, your login URL will be: https://cas.id.ubc.ca/ubc-cas/login?service=https%3A%2F%2Fsites.olt.ubc.ca%2Fwp-login.php%3Fredirect_to%3Dhttp%3A%2F%2Fdt1.sites.olt.ubc.ca%2F?badgelogin=1. You can find your website's URL form Dashboard.
    You can find out the URL of your website from Dashbaord.
  6. Add this link to a page or a post or a widget. When a badge earner click on this link, they will be able to earn the badge.

Completing a Quiz

In order to make this trigger work, you will have to create quizzes in LearnDash first. Read the instruction for creating quizzes in LearnDash

  1. Under Required Steps, select LearnDash Activity.
  2. After you selected LearnDash Activity, you can select the trigger. You can choose from:
    • Passed Quiz: When a badge earner pass any/or specific quiz, he/she will earn the badge.
    • Minimum % Grade on a Quiz: When a badge earner achieved the minimum % of Grade, he/she will earn the badge. You can set the minimum % of grade.
    • Fails Quiz: When a badge earner fails quiz, he/she will earn the badge.
  3. After you select the trigger, click on Save All Steps.
  4. From the menu on the right, click Publish.

There are also other triggers available such as: Completed Lesson, Completed Course and Completed course from a tag.

Example: Setting a Badge Quiz Trigger with a Minimum % Grade

Earning Any or a Specific Badge

Award a badge when users earn a badge

This feature is useful if you want to award a high-level badge. For example: If you earn 3 badges, you get a Community Badges.

  1. Under Required Steps, select Any Achievements of Type from the drop down menu.
  2. From the second drop down menu beside, select badges. Then type in the no. of badges it requires for badge earners to earn the badges.

Award a badge when users earn a specific badge

You can also create a step so that badge earner will earn a badge when they have a specific badge. For example, badge earner will earn Community Badges when they earn Subscriber and Contributor badges. In that case you can Go to Under Required

  1. Under Required Steps, select Specific Achievements of Type from the drop down menu.
  2. From the second drop down menu beside, select Badges. Then choose the badge that you will require badge earners to earn the badges.
  3. Click Save All Steps.