Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Contains class for displaying a collection.
-
 
19
 *
-
 
20
 * @package   core_badges
-
 
21
 * @copyright 2019 Damyon Wiese
-
 
22
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
23
 */
-
 
24
 
16
 
Línea 25... Línea 17...
25
namespace core_badges\external;
17
namespace core_badges\external;
Línea 26... Línea 18...
26
 
18
 
27
defined('MOODLE_INTERNAL') || die();
19
defined('MOODLE_INTERNAL') || die();
Línea 28... Línea 20...
28
 
20
 
29
use core\external\exporter;
21
use core\external\exporter;
30
use stdClass;
22
use stdClass;
31
 
23
 
32
/**
24
/**
33
 * Class for displaying a badge competency.
25
 * Class for displaying a badge collection.
34
 *
26
 *
Línea 44... Línea 36...
44
     * @param stdClass $data The remote data.
36
     * @param stdClass $data The remote data.
45
     * @param string $apiversion The backpack version used to communicate remotely.
37
     * @param string $apiversion The backpack version used to communicate remotely.
46
     * @return stdClass
38
     * @return stdClass
47
     */
39
     */
48
    public static function map_external_data($data, $apiversion) {
40
    public static function map_external_data($data, $apiversion) {
49
        if ($apiversion == OPEN_BADGES_V1) {
-
 
50
            $result = new stdClass();
-
 
51
            $result->entityType = 'BackpackCollection';
-
 
52
            $result->entityId = $data->groupId;
-
 
53
            $result->name = $data->name;
-
 
54
            $result->description = $data->description;
-
 
55
            $result->assertions = [];
-
 
56
            return $result;
-
 
57
        }
-
 
58
        return $data;
41
        return $data;
59
    }
42
    }
Línea 60... Línea 43...
60
 
43
 
61
    /**
44
    /**