mirror of
https://github.com/moodle/moodle.git
synced 2025-02-27 21:43:23 +01:00
The badges feature allows to integrate Mozilla "Open Badges" to issue, assign, manage and display digital badges in Moodle. This feature supports: -- badge creation and issuing based on criteria -- badge baking and verification service -- direct pushing of internal badges to external backpack -- interanl and external badge display in Moodle -- Moodle block to display latest badges
29 lines
755 B
JavaScript
29 lines
755 B
JavaScript
/**
|
|
* Push badges to backpack.
|
|
*/
|
|
function addtobackpack(event, args) {
|
|
OpenBadges.issue([args.assertion], function(errors, successes) { });
|
|
}
|
|
|
|
/**
|
|
* Check if website is externally accessible from the backpack.
|
|
*/
|
|
function check_site_access() {
|
|
var add = Y.one('#check_connection');
|
|
var callback = {
|
|
success: function(o) {
|
|
var data = Y.JSON.parse(o.responseText);
|
|
if (data.code == 'http-unreachable') {
|
|
add.setHTML(data.response);
|
|
add.removeClass('hide');
|
|
}
|
|
},
|
|
failure: function(o) { }
|
|
};
|
|
|
|
YUI().use('yui2-connection', function (Y) {
|
|
Y.YUI2.util.Connect.asyncRequest('GET', 'ajax.php', callback, null);
|
|
});
|
|
|
|
return false;
|
|
} |