diff --git a/docs/release-notes-player.md b/docs/release-notes-player.md index e03ef34be4ba0483cd54b8f168a5f4189824638c..fd6de2ab9bad6047b894a683ba040db8806b4165 100644 --- a/docs/release-notes-player.md +++ b/docs/release-notes-player.md @@ -4,6 +4,7 @@ Player ### Neue Funktionen - Das Präfix "aspect" im Dateinamen wird durch "iqb" ersetzt. Der aktuelle Editor heißt "iqb-editor-aspect-1.32.0" +- Ändert die Metadaten entsprechend der Verona Interfaces Specification zu Version 5.0 ### Verbesserungen - Player stellt keine eigene Meldung mehr dar, wenn er vom Host die Meldung erhält, diff --git a/projects/player/modules/verona/models/verona.ts b/projects/player/modules/verona/models/verona.ts index 0b704ad15b414269f226a1eed541eeb252bbbb2f..e6bac6e288a5e3231ae6ace2a4ee249d5af58749 100644 --- a/projects/player/modules/verona/models/verona.ts +++ b/projects/player/modules/verona/models/verona.ts @@ -87,15 +87,38 @@ export interface VopContinueCommand { sessionId: string; } -export interface VopReadyNotification extends VopMetaData { +export interface VopReadyNotification { type: 'vopReadyNotification'; + metadata: VopMetaData; } export interface VopMetaData { - apiVersion: string; - notSupportedApiFeatures?: string; - supportedUnitDefinitionTypes?: string; - supportedUnitStateDataTypes?: string; + $schema: string, + id: string; + type: string; + version: string; + specVersion: string; + metadataVersion: string + name: { + lang: string; + value: string; + }[]; + description: { + lang: string; + value: string; + }[]; + maintainer: { + name: Record<string, string>[]; + email: string; + url: string; + } + code: { + repositoryType: string; + licenseType: string; + licenseUrl: string; + repositoryUrl: string; + } + notSupportedFeatures: string[]; } export interface VopStateChangedNotification { diff --git a/projects/player/modules/verona/services/verona-post.service.spec.ts b/projects/player/modules/verona/services/verona-post.service.spec.ts index 64488e4556557107b30d46ca467be87d2121d5d3..98677f0648432696f240887a8a0e96d07e362873 100644 --- a/projects/player/modules/verona/services/verona-post.service.spec.ts +++ b/projects/player/modules/verona/services/verona-post.service.spec.ts @@ -1,10 +1,10 @@ import { TestBed } from '@angular/core/testing'; -import { VeronaPostService } from './verona-post.service'; import { fromEvent } from 'rxjs'; import { VopReadyNotification, VopStateChangedNotification, VopUnitNavigationRequestedNotification, VopWindowFocusChangedNotification } from 'player/modules/verona/models/verona'; +import { VeronaPostService } from './verona-post.service'; describe('VeronaPostService', () => { let service: VeronaPostService; @@ -24,7 +24,7 @@ describe('VeronaPostService', () => { const expectedStateChangedNotification: VopStateChangedNotification = { type: 'vopStateChangedNotification', sessionId: 'test', - timeStamp: Date.now() + timeStamp: Date.now() }; const eventSubscription = fromEvent(window.parent, 'message') .subscribe(event => { @@ -39,9 +39,46 @@ describe('VeronaPostService', () => { }); it('should post a VopReadyNotification', done => { + const metadata = { + $schema: 'https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json', + name: [ + { + lang: 'de', + value: 'IQB-Player (Aspect)' + } + ], + description: [ + { + lang: 'de', + value: 'Kann in Verbindung mit dem IQB-Editor (Aspect) im IQB-Studio oder im IQB-Testcenter genutzt werden.' + } + ], + notSupportedFeatures: [], + maintainer: { + name: [ + { + lang: 'de', + value: 'IQB - Institut zur Qualitätsentwicklung im Bildungswesen' + } + ], + url: 'https://www.iqb.hu-berlin.de', + email: 'iqb-tbadev@hu-berlin.de' + }, + code: { + repositoryType: 'git', + licenseType: 'MIT', + licenseUrl: 'https://opensource.org/licenses/MIT', + repositoryUrl: 'https://github.com/iqb-berlin/verona-modules-aspect' + }, + type: 'player', + id: 'iqb-player-aspect', + version: 'version-placeholder', + specVersion: '5.0', + metadataVersion: '2.0' + }; const expectedReadyNotification: VopReadyNotification = { type: 'vopReadyNotification', - apiVersion: 'test' + metadata }; const eventSubscription = fromEvent(window.parent, 'message') .subscribe(event => { @@ -49,8 +86,8 @@ describe('VeronaPostService', () => { .toEqual(expectedReadyNotification); eventSubscription.unsubscribe(); done(); - } ); - service.sendVopReadyNotification({ apiVersion: 'test' }); + }); + service.sendVopReadyNotification(metadata); }); it('should post a VopUnitNavigationRequestedNotification', done => { @@ -65,11 +102,10 @@ describe('VeronaPostService', () => { .toEqual(expectedUnitNavigationRequestedNotification); eventSubscription.unsubscribe(); done(); - } ); + }); service.sendVopUnitNavigationRequestedNotification('next'); }); - it('should post a VopUnitNavigationRequestedNotification', done => { const expectedWindowFocusChangedNotification: VopWindowFocusChangedNotification = { type: 'vopWindowFocusChangedNotification', @@ -84,7 +120,7 @@ describe('VeronaPostService', () => { expect(Object.prototype.hasOwnProperty.call(data, 'timeStamp')).toBeTruthy(); eventSubscription.unsubscribe(); done(); - } ); + }); service.sendVopWindowFocusChangedNotification(true); }); }); diff --git a/projects/player/modules/verona/services/verona-post.service.ts b/projects/player/modules/verona/services/verona-post.service.ts index 81ab085b8d492e6c2f4fc4a6afdc4128ba31caab..2a39aa27a3dc8588e95169969975e157e6e6ddd7 100644 --- a/projects/player/modules/verona/services/verona-post.service.ts +++ b/projects/player/modules/verona/services/verona-post.service.ts @@ -77,7 +77,7 @@ export class VeronaPostService { LogService.debug('player: sendVopReadyNotification', playerMetadata); this.send({ type: 'vopReadyNotification', - ...playerMetadata + metadata: playerMetadata }); } else { LogService.warn('player: no playerMetadata defined'); diff --git a/projects/player/src/html_wrapper/index.html b/projects/player/src/html_wrapper/index.html index 7a095b5b529c564d96dafd89e758900ba494baac..f458e37d2dbc9e8d8f47ca6c58a9838893692157 100644 --- a/projects/player/src/html_wrapper/index.html +++ b/projects/player/src/html_wrapper/index.html @@ -3,44 +3,43 @@ <head> <meta charset="UTF-8"> <title>Verona Player Aspect</title> - <meta name="application-name" content="iqb-player-aspect" - data-version="0.1.0" - data-repository-url="https://github.com/iqb-berlin/verona-modules-apect" - data-api-version="3.0.0" - data-not-supported-api-features="" - data-supported-unit-definition-types="iqb-aspect-definition@1.0.0" - data-supported-unit-state-data-types="iqb-standard@1.0" - data-supported-browsers='{"Firefox": 69, "Chrome": 72, "Edge": 79}' - /> - - <script type="application/ld+json" id="meta_data" > + <script type="application/ld+json" id="meta_data"> { - "@context": "https://w3id.org/iqb/verona-modules", - "@type": "player", - "@id": "iqb-player-aspect", - "name": { - "de": "IQB-Player (Aspect)", - "en": "IQB player (Aspect)" - }, + "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json", + "name": [ + { + "lang": "de", + "value": "IQB-Player (Aspect)" + } + ], + "description": [ + { + "lang": "de", + "value": "Kann in Verbindung mit dem IQB-Editor (Aspect) im IQB-Studio oder im IQB-Testcenter genutzt werden." + } + ], + "notSupportedFeatures": ["log-policy"], "maintainer": { - "name": { - "de": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen", - "en": "IQB - Institute for Educational Quality Improvement" - }, + "name": [ + { + "lang": "de", + "value": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen" + } + ], "url": "https://www.iqb.hu-berlin.de", "email": "iqb-tbadev@hu-berlin.de" }, - "description": { - "de": "TODO", - "en": "TODO" + "code": { + "repositoryType": "git", + "licenseType": "MIT", + "licenseUrl": "https://opensource.org/licenses/MIT", + "repositoryUrl": "https://github.com/iqb-berlin/verona-modules-aspect" }, + "type": "player", + "id": "iqb-player-aspect", "version": "version-placeholder", - "apiVersion": "3.0.0", - "repository": { - "type": "git", - "url": "https://github.com/iqb-berlin/verona-modules-apect" - }, - "notSupportedFeatures": [] + "specVersion": "5.0", + "metadataVersion": "2.0" } </script> <link rel="stylesheet" href="player.css"> diff --git a/projects/player/src/index.html b/projects/player/src/index.html index 9f511a95fc5949cd65fc1418998bc5d0c62c74d3..b96340f93b89e11d54cd0a74ffc2821824aa8861 100644 --- a/projects/player/src/index.html +++ b/projects/player/src/index.html @@ -6,14 +6,19 @@ <script id="meta_data" type="application/ld+json"> { "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json", - "type": "player", - "id": "iqb-player-aspect", - "version": "placeholder", - "specVersion": "4.0.0", - "name": [{ - "lang": "de", - "value": "Verona-Player (Aspect)" - }], + "name": [ + { + "lang": "de", + "value": "IQB-Player (Aspect)" + } + ], + "description": [ + { + "lang": "de", + "value": "Kann in Verbindung mit dem IQB-Editor (Aspect) im IQB-Studio oder im IQB-Testcenter genutzt werden." + } + ], + "notSupportedFeatures": ["log-policy"], "maintainer": { "name": [ { @@ -24,16 +29,17 @@ "url": "https://www.iqb.hu-berlin.de", "email": "iqb-tbadev@hu-berlin.de" }, - "description": [ - { - "lang": "de", - "value": "TODO" - } - ], - "repository": { - "type": "git", - "url": "https://github.com/iqb-berlin/verona-modules-apect" - } + "code": { + "repositoryType": "git", + "licenseType": "MIT", + "licenseUrl": "https://opensource.org/licenses/MIT", + "repositoryUrl": "https://github.com/iqb-berlin/verona-modules-aspect" + }, + "type": "player", + "id": "iqb-player-aspect", + "version": "version-placeholder", + "specVersion": "5.0", + "metadataVersion": "2.0" } </script> <base href="/">