Skip to content
Snippets Groups Projects
Unverified Commit 546bce63 authored by jojohoch's avatar jojohoch Committed by GitHub
Browse files

Merge pull request #434 from iqb-berlin/fature/update_verona_metadata

Feature/update verona metadata
parents 9d39785d 9612ca60
No related branches found
No related tags found
No related merge requests found
Pipeline #43952 passed
Showing
with 245 additions and 107 deletions
......@@ -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
......@@ -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
......
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
......
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.
......
import Page from './page-model';
fixture `Button Tests`
.page `../../dist/verona-editor-aspect.html`;
.page `../../dist/iqb-editor-aspect.html`;
const page = new Page();
......
......@@ -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) : {}
});
}
......
......@@ -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">
......
......@@ -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">
......
......@@ -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 {
......
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);
});
});
......@@ -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');
......
......@@ -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">
......
......@@ -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="/">
......
......@@ -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
......@@ -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
......@@ -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}`);
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