1 This files describes API changes in /badges/*,
2 information provided here is intended especially for developers.
5 * $CFG->badges_site_backpack setting has been completely removed because it's not required anymore. From now, the primary
6 site backpack will be the first one in the "Manage backpacks" list (so, the one with lower sortorder value).
7 * Final deprecation for:
8 - BADGE_BACKPACKURL constant has been removed.
9 - badges/backpack.js file has been removed.
10 * The following methods have been deprecated:
11 - badges_check_backpack_accessibility()
12 - badges_setup_backpack_js()
13 - badges_local_backpack_js()
16 * Users can now specify a backpack that differs from the site backpack. In order to do this, connection details need to
17 be set in 'Manage backpacks' with OR without auth details.
18 * Introduced new functions in backpack_api
19 ** 'import_badge_assertion' to facilitate cross domain badge imports.
20 ** 'update_assertion' updates a previously defined/created assertion.
21 * New badge lib functions introduced
22 ** badges_save_external_backpack() - This method handles inserts/updates to the site wide backpacks' configuration details.
23 ** badges_save_backpack_credentials() - This method handles inserts/updates any authentication details to connect to the backpacks created. This can either be site OR user backpack authentication details
24 ** badges_get_user_backpack() - Gets a specific user's backpack. Defaults to current user's backpack if none provided.
25 ** badges_get_site_primary_backpack() - Get the primary backpack set for the site as defined in $CFG->badges_site_backpack
26 * badges_open_badges_backpack_api() - Now accepts a backpackid(badge_external_backpack id) to check whether the version of the provided backpack.
27 This was introduced because now there is a difference between a site and user backpack. If null, defaults to site_backpack.
28 * badges_get_site_backpack() - Accepts an additional $userid param if we want to get a specific user's backpack. Defaults to 0 if we are trying to get the site/admin level backpack
29 * badges_external_get_mapping() - Accepts an additional argument to indicate which value it wants returned. Defaults to 'externalid' which contains the OBv2 badge URL
32 * BADGE_BACKPACKAPIURL and BADGE_BACKPACKWEBURL are deprecated and should not be used.
33 * OBv2 has been set to the default value when the obversion is not defined.
36 * BADGE_BACKPACKURL is deprecated and should not be used.
37 * Incorrect term "badge competencies" has been refactored to "alignments" everywhere.
41 * The WebService core_badges_get_user_badges now returns more information for each badge: notification, nextcron, email, version, language, imageauthorname, imageauthoremail, imageauthorurl, imagecaption, endorsement, competencies and relatedbadges.
45 * get_completed_criteria_sql() - This method was added to award_criteria class and must be overriden
46 in all criteria classes. This method returns an array consisting of SQL JOIN statement, WHERE conditions,
47 and any parameters that might be required. The results are used in lib/badgeslib.php in review_all_criteria()
48 to reduce to the minimum the number of users to review and award badges.
49 * New optional parameter $filtered in review() allows to indicate that some expensive checks can be skipped
50 if the list of users has been initially filtered based on met criteria.
51 * New optional parameter $archive in delete() in badge class in badgeslib.php
52 allows to indicate that a badge should be archived instead of fully deleted.
53 If this parameter is set to FALSE, a badge will all its information, criteria,
54 and awards will be removed from the database.
55 * BADGE_BACKPACKURL constant has been moved from badges/lib/backpacklib.php to lib/badgeslib.php, and URI scheme
56 name ('http://') has been removed.