Skip to content
Snippets Groups Projects
Commit ceaace57 authored by jojohoch's avatar jojohoch
Browse files

Revert "[player] Change metadata according to the Verona Inferfaces Spec."

This reverts commit f90bcc5b
Target installation seems not to support this Verona Api version yet
parent 2952c060
No related branches found
No related tags found
No related merge requests found
{ {
"name": "verona-modules-aspect", "name": "verona-modules-aspect",
"config": { "config": {
"player_version": "1.28.0", "player_version": "1.28.0-beta",
"editor_version": "1.35.0", "editor_version": "1.35.0-beta",
"unit_definition_version": "3.8.0" "unit_definition_version": "3.8.0"
}, },
"scripts": { "scripts": {
......
...@@ -87,37 +87,15 @@ export interface VopContinueCommand { ...@@ -87,37 +87,15 @@ export interface VopContinueCommand {
sessionId: string; sessionId: string;
} }
export interface VopReadyNotification { export interface VopReadyNotification extends VopMetaData {
type: 'vopReadyNotification'; type: 'vopReadyNotification';
metadata: VopMetaData;
} }
export interface VopMetaData { export interface VopMetaData {
$schema: string, apiVersion: string;
id: string; notSupportedApiFeatures?: string;
type: string; supportedUnitDefinitionTypes?: string;
version: string; supportedUnitStateDataTypes?: 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[];
} }
export interface VopStateChangedNotification { export interface VopStateChangedNotification {
......
import { TestBed } from '@angular/core/testing'; import { TestBed } from '@angular/core/testing';
import { VeronaPostService } from './verona-post.service';
import { fromEvent } from 'rxjs'; import { fromEvent } from 'rxjs';
import { import {
VopReadyNotification, VopStateChangedNotification, VopUnitNavigationRequestedNotification, VopReadyNotification, VopStateChangedNotification, VopUnitNavigationRequestedNotification,
VopWindowFocusChangedNotification VopWindowFocusChangedNotification
} from 'player/modules/verona/models/verona'; } from 'player/modules/verona/models/verona';
import { VeronaPostService } from './verona-post.service';
describe('VeronaPostService', () => { describe('VeronaPostService', () => {
let service: VeronaPostService; let service: VeronaPostService;
...@@ -24,7 +24,7 @@ describe('VeronaPostService', () => { ...@@ -24,7 +24,7 @@ describe('VeronaPostService', () => {
const expectedStateChangedNotification: VopStateChangedNotification = { const expectedStateChangedNotification: VopStateChangedNotification = {
type: 'vopStateChangedNotification', type: 'vopStateChangedNotification',
sessionId: 'test', sessionId: 'test',
timeStamp: Date.now() timeStamp: Date.now()
}; };
const eventSubscription = fromEvent(window.parent, 'message') const eventSubscription = fromEvent(window.parent, 'message')
.subscribe(event => { .subscribe(event => {
...@@ -39,45 +39,9 @@ describe('VeronaPostService', () => { ...@@ -39,45 +39,9 @@ describe('VeronaPostService', () => {
}); });
it('should post a VopReadyNotification', done => { 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 = { const expectedReadyNotification: VopReadyNotification = {
type: 'vopReadyNotification', type: 'vopReadyNotification',
metadata apiVersion: 'test'
}; };
const eventSubscription = fromEvent(window.parent, 'message') const eventSubscription = fromEvent(window.parent, 'message')
.subscribe(event => { .subscribe(event => {
...@@ -85,8 +49,8 @@ describe('VeronaPostService', () => { ...@@ -85,8 +49,8 @@ describe('VeronaPostService', () => {
.toEqual(expectedReadyNotification); .toEqual(expectedReadyNotification);
eventSubscription.unsubscribe(); eventSubscription.unsubscribe();
done(); done();
}); } );
service.sendVopReadyNotification(metadata); service.sendVopReadyNotification({ apiVersion: 'test' });
}); });
it('should post a VopUnitNavigationRequestedNotification', done => { it('should post a VopUnitNavigationRequestedNotification', done => {
...@@ -101,10 +65,11 @@ describe('VeronaPostService', () => { ...@@ -101,10 +65,11 @@ describe('VeronaPostService', () => {
.toEqual(expectedUnitNavigationRequestedNotification); .toEqual(expectedUnitNavigationRequestedNotification);
eventSubscription.unsubscribe(); eventSubscription.unsubscribe();
done(); done();
}); } );
service.sendVopUnitNavigationRequestedNotification('next'); service.sendVopUnitNavigationRequestedNotification('next');
}); });
it('should post a VopUnitNavigationRequestedNotification', done => { it('should post a VopUnitNavigationRequestedNotification', done => {
const expectedWindowFocusChangedNotification: VopWindowFocusChangedNotification = { const expectedWindowFocusChangedNotification: VopWindowFocusChangedNotification = {
type: 'vopWindowFocusChangedNotification', type: 'vopWindowFocusChangedNotification',
...@@ -119,7 +84,7 @@ describe('VeronaPostService', () => { ...@@ -119,7 +84,7 @@ describe('VeronaPostService', () => {
expect(Object.prototype.hasOwnProperty.call(data, 'timeStamp')).toBeTruthy(); expect(Object.prototype.hasOwnProperty.call(data, 'timeStamp')).toBeTruthy();
eventSubscription.unsubscribe(); eventSubscription.unsubscribe();
done(); done();
}); } );
service.sendVopWindowFocusChangedNotification(true); service.sendVopWindowFocusChangedNotification(true);
}); });
}); });
...@@ -77,7 +77,7 @@ export class VeronaPostService { ...@@ -77,7 +77,7 @@ export class VeronaPostService {
LogService.debug('player: sendVopReadyNotification', playerMetadata); LogService.debug('player: sendVopReadyNotification', playerMetadata);
this.send({ this.send({
type: 'vopReadyNotification', type: 'vopReadyNotification',
metadata: playerMetadata ...playerMetadata
}); });
} else { } else {
LogService.warn('player: no playerMetadata defined'); LogService.warn('player: no playerMetadata defined');
......
...@@ -3,41 +3,44 @@ ...@@ -3,41 +3,44 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Verona Player Aspect</title> <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": [ "@context": "https://w3id.org/iqb/verona-modules",
{ "@type": "player",
"lang": "de", "@id": "iqb-player-aspect",
"value": "IQB-Player (Aspect)" "name": {
} "de": "IQB-Player (Aspect)",
], "en": "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": { "maintainer": {
"name": [ "name": {
{ "de": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen",
"lang": "de", "en": "IQB - Institute for Educational Quality Improvement"
"value": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen" },
}
],
"url": "https://www.iqb.hu-berlin.de", "url": "https://www.iqb.hu-berlin.de",
"email": "iqb-tbadev@hu-berlin.de" "email": "iqb-tbadev@hu-berlin.de"
}, },
"code": { "description": {
"repositoryType": "git", "de": "TODO",
"licenseType": "MIT", "en": "TODO"
"licenseUrl": "https://opensource.org/licenses/MIT",
"repositoryUrl": "https://github.com/iqb-berlin/verona-modules-aspect"
}, },
"type": "player",
"id": "iqb-player-aspect",
"version": "version-placeholder", "version": "version-placeholder",
"specVersion": "4.0" "apiVersion": "3.0.0",
"repository": {
"type": "git",
"url": "https://github.com/iqb-berlin/verona-modules-apect"
},
"notSupportedFeatures": []
} }
</script> </script>
<link rel="stylesheet" href="player.css"> <link rel="stylesheet" href="player.css">
......
...@@ -6,19 +6,14 @@ ...@@ -6,19 +6,14 @@
<script id="meta_data" type="application/ld+json"> <script id="meta_data" type="application/ld+json">
{ {
"$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json", "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json",
"name": [ "type": "player",
{ "id": "verona-player-aspect",
"lang": "de", "version": "placeholder",
"value": "IQB-Player (Aspect)" "specVersion": "4.0.0",
} "name": [{
], "lang": "de",
"description": [ "value": "Verona-Player (Aspect)"
{ }],
"lang": "de",
"value": "Kann in Verbindung mit dem IQB-Editor (Aspect) im IQB-Studio oder im IQB-Testcenter genutzt werden."
}
],
"notSupportedFeatures": [],
"maintainer": { "maintainer": {
"name": [ "name": [
{ {
...@@ -29,16 +24,16 @@ ...@@ -29,16 +24,16 @@
"url": "https://www.iqb.hu-berlin.de", "url": "https://www.iqb.hu-berlin.de",
"email": "iqb-tbadev@hu-berlin.de" "email": "iqb-tbadev@hu-berlin.de"
}, },
"code": { "description": [
"repositoryType": "git", {
"licenseType": "MIT", "lang": "de",
"licenseUrl": "https://opensource.org/licenses/MIT", "value": "TODO"
"repositoryUrl": "https://github.com/iqb-berlin/verona-modules-aspect" }
}, ],
"type": "player", "repository": {
"id": "iqb-player-aspect", "type": "git",
"version": "version-placeholder", "url": "https://github.com/iqb-berlin/verona-modules-apect"
"specVersion": "4.0" }
} }
</script> </script>
<base href="/"> <base href="/">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment