diff --git a/package.json b/package.json index de05707e42663a57a02c0e982f3f4487d4bd5425..23fb5964aa84368b250701bcc5be051b0dac55fb 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "verona-modules-aspect", "config": { - "player_version": "1.28.0", - "editor_version": "1.35.0", + "player_version": "1.28.0-beta", + "editor_version": "1.35.0-beta", "unit_definition_version": "3.8.0" }, "scripts": { diff --git a/projects/player/modules/verona/models/verona.ts b/projects/player/modules/verona/models/verona.ts index 69d9cae24a13df32a48772cecc9c56460be235ed..0b704ad15b414269f226a1eed541eeb252bbbb2f 100644 --- a/projects/player/modules/verona/models/verona.ts +++ b/projects/player/modules/verona/models/verona.ts @@ -87,37 +87,15 @@ export interface VopContinueCommand { sessionId: string; } -export interface VopReadyNotification { +export interface VopReadyNotification extends VopMetaData { type: 'vopReadyNotification'; - metadata: VopMetaData; } export interface VopMetaData { - $schema: string, - id: string; - type: string; - version: string; - specVersion: 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[]; + apiVersion: string; + notSupportedApiFeatures?: string; + supportedUnitDefinitionTypes?: string; + supportedUnitStateDataTypes?: 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 0ae796e1a0f08075902a6674ccafcd11e716c2e8..64488e4556557107b30d46ca467be87d2121d5d3 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,45 +39,9 @@ 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: '4.0' - }; const expectedReadyNotification: VopReadyNotification = { type: 'vopReadyNotification', - metadata + apiVersion: 'test' }; const eventSubscription = fromEvent(window.parent, 'message') .subscribe(event => { @@ -85,8 +49,8 @@ describe('VeronaPostService', () => { .toEqual(expectedReadyNotification); eventSubscription.unsubscribe(); done(); - }); - service.sendVopReadyNotification(metadata); + } ); + service.sendVopReadyNotification({ apiVersion: 'test' }); }); it('should post a VopUnitNavigationRequestedNotification', done => { @@ -101,10 +65,11 @@ describe('VeronaPostService', () => { .toEqual(expectedUnitNavigationRequestedNotification); eventSubscription.unsubscribe(); done(); - }); + } ); service.sendVopUnitNavigationRequestedNotification('next'); }); + it('should post a VopUnitNavigationRequestedNotification', done => { const expectedWindowFocusChangedNotification: VopWindowFocusChangedNotification = { type: 'vopWindowFocusChangedNotification', @@ -119,7 +84,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 2a39aa27a3dc8588e95169969975e157e6e6ddd7..81ab085b8d492e6c2f4fc4a6afdc4128ba31caab 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', - metadata: playerMetadata + ...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 8f5e5a98590b409474fb7b3a42c757fefdd0d775..7a095b5b529c564d96dafd89e758900ba494baac 100644 --- a/projects/player/src/html_wrapper/index.html +++ b/projects/player/src/html_wrapper/index.html @@ -3,41 +3,44 @@ <head> <meta charset="UTF-8"> <title>Verona Player Aspect</title> - <script type="application/ld+json" id="meta_data"> + <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" > { - "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": [], + "@context": "https://w3id.org/iqb/verona-modules", + "@type": "player", + "@id": "iqb-player-aspect", + "name": { + "de": "IQB-Player (Aspect)", + "en": "IQB player (Aspect)" + }, "maintainer": { - "name": [ - { - "lang": "de", - "value": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen" - } - ], + "name": { + "de": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen", + "en": "IQB - Institute for Educational Quality Improvement" + }, "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" + "description": { + "de": "TODO", + "en": "TODO" }, - "type": "player", - "id": "iqb-player-aspect", "version": "version-placeholder", - "specVersion": "4.0" + "apiVersion": "3.0.0", + "repository": { + "type": "git", + "url": "https://github.com/iqb-berlin/verona-modules-apect" + }, + "notSupportedFeatures": [] } </script> <link rel="stylesheet" href="player.css"> diff --git a/projects/player/src/index.html b/projects/player/src/index.html index 1632fb8fa9f2f1bace0fa70f7f605d1e4cb5fb9a..69983918670e0aa6e41e519d064fa362ced3f7f0 100644 --- a/projects/player/src/index.html +++ b/projects/player/src/index.html @@ -6,19 +6,14 @@ <script id="meta_data" type="application/ld+json"> { "$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": [], + "type": "player", + "id": "verona-player-aspect", + "version": "placeholder", + "specVersion": "4.0.0", + "name": [{ + "lang": "de", + "value": "Verona-Player (Aspect)" + }], "maintainer": { "name": [ { @@ -29,16 +24,16 @@ "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": "4.0" + "description": [ + { + "lang": "de", + "value": "TODO" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/iqb-berlin/verona-modules-apect" + } } </script> <base href="/">