{{! This file is part of Moodle - http://moodle.org/ Moodle is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Moodle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Moodle. If not, see . }} {{! @template core_badges/issued_badge Display an issued badge. Context variables required for this template: * coursefullname - Course name (only available if it's a course badge). * sitefullname - Site name (only available if it's a site badge). * badgeimage - Badge image. * expireddate - Date (in the past) when the badge expired. If expiredate is defined, this field will be empty [optional]. * expireddateformatted - Formatted expired date [optional]. * expiredate - Date (in the future) when the badge will expire. If expireddate is defined, this field will be empty [optional]. * badgename - Badge name. * badgedescription - Badge description. * badgeissuedon - Date where the badge was issued on by the user [optional]. * recipientname - User awarded with the badge [optional]. * recipientnotification.message - Message to be displayed if there is some issue with the recipient [optional]. * criteria - HTML code with the criteria to display. * issuedby - Badge issuer. * issuedbyemailobfuscated - Badge issuer email link obfuscated. * hasotherfields - Wheter the badge has other fields or not. * language - Badge language [optional]. * version - Badge version [optional]. * imageauthorname - Badge image author name [optional]. * imageauthoremail - Badge image author email [optional]. * imageauthorurl - Badge image author URL [optional]. * imagecaption - Badge image caption [optional]. * endorsement - Badge endorsement data, with id, badgeid, issuername... [optional]. * hasrelatedbadges - Whether the badge has related badges or not. * relatedbadges - Array of related badges (if hasrelatedbadges is set to true). * hasalignments - Whether the badge has alignments or not. * alignments - Array of alignments (if hasalignments is set to true). * hostedurl - The URL where the badge is hosted [optional]. Example context (json): { "coursefullname": "Learn Moodle 3.11 Basics", "badgeimage": "https://moodlesite/pluginfile/badges/123.jpg", "expiredate": 1656972000, "badgename": "Lean Moodle 3.11 Basics helper", "badgedescription":"This badge is awarded to people who have provided outstanding support to other participants in the MOOC", "badgeissuedon": 1625491897, "recipientname": "Judit Cortes", "recipientnotification": { "message": "This user cannot be verified as a recipient of this badge." }, "criteria": "Complete ALL of the listed requirements.", "issuedby": "Moodle HQ", "issuedbyemailobfuscated": "Moodle HQ", "hasotherfields": true, "language": "English", "version": "1.0beta", "imageauthorname": "Judit Blanque", "imageauthoremail": "judit@moodle.invalid", "imageauthorurl": "http://juditblanque.cat", "imagecaption": "This is a nice picture from my cat", "endorsement": { "id": "2", "badgeid": "13", "issuername": "Endorsement", "issuerurl": "http://endorsement.cat", "issueremail": "endorsement@moodle.invalid", "claimid": "http://claim.cat", "claimcomment": "This is an endorsement comment.", "dateissued": "1625491680" }, "hasrelatedbadges": true, "relatedbadges": [ { "id": "12", "name": "Lean Moodle 3.11 Basics participant", "version": "", "language": "en", "type": "2", "url": "http://xxxxx/badges/overview.php?id=12" } ], "hasalignments": true, "alignments": [ { "id": "3", "badgeid": "13", "targetname": "Skill 1", "targeturl": "http://skill1.cat", "targetdescription": "This is the description for \"Skill 1\"", "targetframework": "Framework name", "targetcode": "S001" }, { "id": "2", "badgeid": "13", "targetname": "Alignment1", "targeturl": "http://alignment1.cat", "targetdescription": "This is the description for alignament1", "targetframework": "Framework name", "targetcode": "A1001" } ], "hostedurl": "http://externalbackpack/badge?id=ABC" } }}
{{imagecaption}} {{#expireddateformatted}} {{# pix }} i/expired, core, {{# str }} expireddate, badges, {{expireddateformatted}} {{/ str }}{{/ pix }} {{/expireddateformatted}} {{#downloadurl}}
{{/downloadurl}} {{#addtobackpackurl}}
{{/addtobackpackurl}}

{{badgename}}

{{#recipientname}}
{{#recipientnotification}} {{> core/notification_warning}} {{/recipientnotification}} {{#str}}awardedto, core_badges, {{recipientname}}{{/str}}
{{/recipientname}}
{{#badgeissuedon}} {{#str}} issuedon, core_badges, {{#userdate}}{{badgeissuedon}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}} {{/str}}
{{/badgeissuedon}} {{#expiredate}} {{#str}} expiresin, core_badges, {{#userdate}}{{expiredate}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}} {{/str}}
{{/expiredate}} {{#expireddate}} {{#str}} expiredin, core_badges, {{#userdate}}{{expireddate}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}} {{/str}} {{/expireddate}}
{{#issuedby}}
{{#str}} issuedby, core_badges, {{#issuedbyemailobfuscated}} {{{issuedbyemailobfuscated}}} {{/issuedbyemailobfuscated}} {{^issuedbyemailobfuscated}} {{issuedby}} {{/issuedbyemailobfuscated}} {{/str}}
{{/issuedby}} {{#hostedurl}} {{/hostedurl}} {{#coursefullname}}
{{#str}} course, core_badges, {{coursefullname}} {{/str}}
{{/coursefullname}}
{{#badgetag}}

{{> core_tag/taglist}}

{{/badgetag}}

{{{badgedescription}}}

{{#str}}bcriteria, core_badges{{/str}}

{{{criteria}}}
{{#hasotherfields}}
{{#version}}
{{#str}}version, core_badges{{/str}}
{{version}}
{{/version}} {{#language}}
{{#str}}language, core_badges{{/str}}
{{language}}
{{/language}} {{#imageauthorname}}
{{#str}}imageauthorname, core_badges{{/str}}
{{imageauthorname}}
{{/imageauthorname}} {{#imageauthoremail}}
{{#str}}imageauthoremail, core_badges{{/str}}
{{{imageauthoremail}}}
{{/imageauthoremail}} {{#imageauthorurl}}
{{#str}}imageauthorurl, core_badges{{/str}}
{{imageauthorurl}}
{{/imageauthorurl}} {{#imagecaption}}
{{#str}}imagecaption, core_badges{{/str}}
{{imagecaption}}
{{/imagecaption}}
{{#endorsement}}

{{#str}}endorsement, core_badges{{/str}}

{{#str}}issuername, core_badges{{/str}}
{{issuername}}
{{#str}}issueremail, core_badges{{/str}}
{{{issueremail}}}
{{#str}}issuerurl, core_badges{{/str}}
{{issuerurl}}
{{#str}}dateawarded, core_badges{{/str}}
{{#userdate}}{{dateissued}}, {{#str}} strftimedatetime, langconfig {{/str}}{{/userdate}}
{{#str}}claimid, core_badges{{/str}}
{{claimid}}
{{#str}}claimcomment, core_badges{{/str}}
{{claimcomment}}
{{/endorsement}} {{#hasrelatedbadges}}

{{#str}}relatedbages, core_badges{{/str}}

{{/hasrelatedbadges}} {{#hasalignments}}

{{#str}}alignment, core_badges{{/str}}

    {{/hasalignments}} {{#alignments}}
  • {{targetname}}
  • {{/alignments}} {{#hasalignments}}
{{/hasalignments}}
{{/hasotherfields}}