diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ef58b08c7b5b066ef29e88bf9d09f60176c28372..40664d19e7add78040d26dd01ea31ab7759fdd98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,6 +31,6 @@ deploy: - ./scripts/deploy.sh $TESTSTUDIO_USERNAME $TESTSTUDIO_PASSWORD artifacts: paths: - - dist/verona-editor-aspect-nightly.html - - dist/verona-player-aspect-nightly.html + - dist/iqb-editor-aspect-nightly.html + - dist/iqb-player-aspect-nightly.html expire_in: 1 week diff --git a/README.md b/README.md index 6a80bab40b75be93b61a594be792948dd953d0e2..77d9f52c4af871f0362c5ff677ddc552d35f2978 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ or >npm run start-player-local ### Build -This produces an HTML file in the `dist` folder, named `verona-{module}-aspect-{version}.html`. +This produces an HTML file in the `dist` folder, named `iqb-{module}-aspect-{version}.html`. >npm run build-editor diff --git a/docs/release-notes-editor.md b/docs/release-notes-editor.md index 4ae22d898caca541973c735503d493d600ce73b2..bff3f23149dcc5bdf66f4940171f4a5de482fc85 100644 --- a/docs/release-notes-editor.md +++ b/docs/release-notes-editor.md @@ -1,5 +1,10 @@ Editor ====== +## 1.39.0 +### Neue Funktionen +- Das Präfix "aspect" im Dateinamen wird durch "iqb" ersetzt. + Der aktuelle Editor heißt "iqb-editor-aspect-1.39.0" + ## 1.38.0 ### Fehlerbehebungen - Korrigiert das Setzen der Seitennavigation im Knopfelement diff --git a/docs/release-notes-player.md b/docs/release-notes-player.md index afe32f686101c6c991fbfb2d2053bbec89b7c305..fd6de2ab9bad6047b894a683ba040db8806b4165 100644 --- a/docs/release-notes-player.md +++ b/docs/release-notes-player.md @@ -1,6 +1,11 @@ Player ====== -## next +## 1.32.0 +### 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, dass die Navigation verweigert wird. Diese Meldung ist Aufgabe des Hosts. diff --git a/e2e-tests/editor/test.ts b/e2e-tests/editor/test.ts index 71a7ab41c760faa78153a93cb374067d6cd24042..ca69dfcfe8ed2515ff72387fe29da2269f1c0164 100644 --- a/e2e-tests/editor/test.ts +++ b/e2e-tests/editor/test.ts @@ -1,7 +1,7 @@ import Page from './page-model'; fixture `Button Tests` - .page `../../dist/verona-editor-aspect.html`; + .page `../../dist/iqb-editor-aspect.html`; const page = new Page(); diff --git a/projects/editor/src/app/services/verona-api.service.ts b/projects/editor/src/app/services/verona-api.service.ts index 0e8b7eb33b1cbe9fe577514c8fcb39e2c557704d..a71bdf7d45f216758afe9616602e05cd7d6e1a78 100644 --- a/projects/editor/src/app/services/verona-api.service.ts +++ b/projects/editor/src/app/services/verona-api.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { fromEvent, Observable, Subject } from 'rxjs'; import { Unit } from 'common/models/unit'; import { AnswerScheme } from 'common/models/elements/element'; -import packageJSON from '../../../../../package.json'; @Injectable({ providedIn: 'root' @@ -51,11 +50,10 @@ export class VeronaAPIService { } sendVoeReadyNotification(): void { + const metadata: string | null | undefined = document.getElementById('verona-metadata')?.textContent; this.send({ type: 'voeReadyNotification', - apiVersion: '1.1.0', - notSupportedApiFeatures: '', - supportedUnitDefinitionTypes: packageJSON.config.unit_definition_version + metadata: metadata ? JSON.parse(metadata) : {} }); } diff --git a/projects/editor/src/html_wrapper/index.html b/projects/editor/src/html_wrapper/index.html index 4f66fcd59e1f38cf5ea9f454fb62ea5530cc3e0f..cd5e2fe955d45288a3202a08b2dff63930df223e 100644 --- a/projects/editor/src/html_wrapper/index.html +++ b/projects/editor/src/html_wrapper/index.html @@ -3,40 +3,55 @@ <head> <meta charset="UTF-8"> <title>Verona Editor Aspect</title> - - <meta name="application-name" content="iqb-editor-aspect" - data-version="version-placeholder" - data-api-version="2.0.0" - data-repository-url="https://github.com/iqb-berlin/verona-modules-apect" - data-supported-unit-definition-types="iqb-aspect-definition@1.0.0"/> - <script type="application/ld+json"> + <script id="verona-metadata" type="application/ld+json"> { - "@context": "https://w3id.org/iqb/verona-modules", - "@type": "editor", - "@id": "iqb-editor-aspect", - "name": { - "de": "IQB-Editor (Aspect)", - "en": "IQB editor (Aspect)" - }, - "maintainer": { - "name": { - "de": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen", - "en": "IQB - Institute for Educational Quality Improvement" + "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json", + "id": "iqb-editor-aspect", + "version": "version-placeholder", + "specVersion": "4.0", + "metadataVersion": "2.0", + "type": "editor", + "name": [ + { + "lang": "en", + "value": "IQB Editor (Aspect)" + }, + { + "lang": "de", + "value": "IQB-Editor (Aspect)" + } + ], + "description": [ + { + "lang": "de", + "value": "Dieser Editor erstellt Aufgabendefinitionen in einem eigenen, JSON-Format. Anzeige- und Interaktionselemente können auf einer oder über mehreren Seiten frei oder in einem Grid positioniert werden." }, + { + "lang": "en", + "value": "This editor uses a JSON formatted unit definition. You can place elements for display or interaction purposes freely or in a grid on one or more pages." + } + ], + "notSupportedFeatures": ["log-policy"], + "maintainer": { + "name": [ + { + "lang": "en", + "value": "IQB - Institute for Educational Quality Improvement." + }, + { + "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" - }, - "version": "version-placeholder", - "apiVersion": "2.0", - "repository": { - "type": "git", - "url": "https://github.com/iqb-berlin/verona-modules-apect" - }, - "notSupportedFeatures": [] + "code": { + "repositoryType": "git", + "licenseType": "MIT", + "licenseUrl": "https://opensource.org/licenses/MIT", + "repositoryUrl": "https://github.com/iqb-berlin/verona-modules-apect" + } } </script> <link rel="stylesheet" href="editor.css"> diff --git a/projects/editor/src/index.html b/projects/editor/src/index.html index d17425311084dde6c06eb9c40fe0943d4acce2b1..74a07b5ce5e2a8254ddb1bd6e489b4a10837389c 100644 --- a/projects/editor/src/index.html +++ b/projects/editor/src/index.html @@ -3,6 +3,57 @@ <head> <meta charset="utf-8"> <title>Editor Aspect</title> + <script id="verona-metadata" type="application/ld+json"> + { + "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json", + "id": "iqb-editor-aspect", + "version": "version-placeholder", + "specVersion": "4.0", + "metadataVersion": "2.0", + "type": "editor", + "name": [ + { + "lang": "en", + "value": "IQB Editor (Aspect)" + }, + { + "lang": "de", + "value": "IQB-Editor (Aspect)" + } + ], + "description": [ + { + "lang": "de", + "value": "Dieser Editor erstellt Aufgabendefinitionen in einem eigenen, JSON-Format. Anzeige- und Interaktionselemente können auf einer oder über mehreren Seiten frei oder in einem Grid positioniert werden." + }, + { + "lang": "en", + "value": "This editor uses a JSON formatted unit definition. You can place elements for display or interaction purposes freely or in a grid on one or more pages." + } + ], + "notSupportedFeatures": ["log-policy"], + "maintainer": { + "name": [ + { + "lang": "en", + "value": "IQB - Institute for Educational Quality Improvement." + }, + { + "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-apect" + } + } + </script> <base href="/"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="icon" type="image/x-icon" href="favicon.ico"> 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 69983918670e0aa6e41e519d064fa362ced3f7f0..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": "verona-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="/"> diff --git a/scripts/build.sh b/scripts/build.sh index fc68249d1ee96b2d4f86261343732d43ad004de6..7812c05b47d709effb3fa482171cb4f85a314421 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -8,6 +8,6 @@ fi node node_modules/iqb-dev-components/src/js_css_packer.js dist $1 dist cp projects/$1/src/html_wrapper/index.html dist/index.html sed -i -e 's/version-placeholder/'${2}'/g' dist/index.html -node scripts/distpacker.js dist verona-$1-aspect-$2.html $1 -cp dist/verona-$1-aspect-$2.html dist/verona-$1-aspect-nightly.html -sed -i -e 's/'${2}'/9.9.9-rc/g' dist/verona-$1-aspect-nightly.html +node scripts/distpacker.js dist iqb-$1-aspect-$2.html $1 +cp dist/iqb-$1-aspect-$2.html dist/iqb-$1-aspect-nightly.html +sed -i -e 's/'${2}'/9.9.9-rc/g' dist/iqb-$1-aspect-nightly.html diff --git a/scripts/deploy.sh b/scripts/deploy.sh index ccc74590195610659aa0e36b9885635ba3175c0c..3b95ebb0628f53e7866e8ddaa3652bb0dc46fdd4 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -16,12 +16,12 @@ token=$(echo $login_return | jq ".token") curl -f -X POST \ -F "t=$token" \ -F "name=verona-module" \ - -F "verona-module=@./dist/verona-editor-aspect-nightly.html" \ + -F "verona-module=@./dist/iqb-editor-aspect-nightly.html" \ https://teststudio.iqb.hu-berlin.de/api/php_superadmin/uploadVeronaModule.php ## PLAYER curl -f -X POST \ -F "t=$token" \ -F "name=verona-module" \ - -F "verona-module=@./dist/verona-player-aspect-nightly.html" \ + -F "verona-module=@./dist/iqb-player-aspect-nightly.html" \ https://teststudio.iqb.hu-berlin.de/api/php_superadmin/uploadVeronaModule.php diff --git a/scripts/wrap_and_pack.js b/scripts/wrap_and_pack.js index 2f0a7d3f63439f8359b48b94d24796f9debd3996..77812a5af17c80f10c37a9d4cc29059d960c8272 100644 --- a/scripts/wrap_and_pack.js +++ b/scripts/wrap_and_pack.js @@ -14,5 +14,5 @@ const fileContent = fs.readFileSync(wrapperPath, 'utf8').toString() .replace(/version-placeholder/g, packageVersion); fs.writeFileSync('dist/index.html', fileContent, 'utf8'); -const targetFileName = `verona-${packageName}-aspect-${packageVersion}.html`; +const targetFileName = `iqb-${packageName}-aspect-${packageVersion}.html`; execSync(`node scripts/distpacker.js dist ${targetFileName} ${packageName}`);