. /** * Serve assertion JSON by unique hash of issued badge * * @package core * @subpackage badges * @copyright 2012 onwards Totara Learning Solutions Ltd {@link http://www.totaralms.com/} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later * @author Yuliya Bozhko */ require_once(dirname(dirname(__FILE__)) . '/config.php'); require_once($CFG->libdir . '/badgeslib.php'); if (empty($CFG->enablebadges)) { print_error('badgesdisabled', 'badges'); } $hash = required_param('b', PARAM_ALPHANUM); $badge = badges_get_issued_badge_info($hash); header('Content-type: application/json; charset=utf-8'); echo json_encode($badge);