Merge branch 'w23_MDL-39588_m25_ociinstall' of git://github.com/skodak/moodle into...
[moodle.git] / badges / backpack.js
blob68e736bee0881b7fa84ff8b5d516b9897d886447
1 /**
2  * Push badges to backpack.
3  */
4 function addtobackpack(event, args) {
5     OpenBadges.issue([args.assertion], function(errors, successes) { });
8 /**
9  * Check if website is externally accessible from the backpack.
10  */
11 function check_site_access() {
12     var add = Y.one('#check_connection');
14     var callback = {
15             method: "GET",
16             on: {
17                 success: function(id, o, args) {
18                             var data = Y.JSON.parse(o.responseText);
19                             if (data.code == 'http-unreachable') {
20                                 add.setHTML(data.response);
21                                 add.removeClass('hide');
22                             }
23                         },
24                 failure: function(o) { }
25             }
26         };
28     Y.use('io-base', function(Y) {
29         Y.io('ajax.php', callback);
30     });
32     return false;