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

[editor] Change metadata according to the Verona Interfaces Spec.

- Send metadata as voeReadyNotification to host
parent 22f9859e
No related branches found
No related tags found
No related merge requests found
Pipeline #43951 passed
...@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; ...@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { fromEvent, Observable, Subject } from 'rxjs'; import { fromEvent, Observable, Subject } from 'rxjs';
import { Unit } from 'common/models/unit'; import { Unit } from 'common/models/unit';
import { AnswerScheme } from 'common/models/elements/element'; import { AnswerScheme } from 'common/models/elements/element';
import packageJSON from '../../../../../package.json';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
...@@ -51,11 +50,10 @@ export class VeronaAPIService { ...@@ -51,11 +50,10 @@ export class VeronaAPIService {
} }
sendVoeReadyNotification(): void { sendVoeReadyNotification(): void {
const metadata: string | null | undefined = document.getElementById('verona-metadata')?.textContent;
this.send({ this.send({
type: 'voeReadyNotification', type: 'voeReadyNotification',
apiVersion: '1.1.0', metadata: metadata ? JSON.parse(metadata) : {}
notSupportedApiFeatures: '',
supportedUnitDefinitionTypes: packageJSON.config.unit_definition_version
}); });
} }
......
...@@ -3,40 +3,55 @@ ...@@ -3,40 +3,55 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Verona Editor Aspect</title> <title>Verona Editor Aspect</title>
<script id="verona-metadata" type="application/ld+json">
<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">
{ {
"@context": "https://w3id.org/iqb/verona-modules", "$schema": "https://raw.githubusercontent.com/verona-interfaces/metadata/master/verona-module-metadata.json",
"@type": "editor", "id": "iqb-editor-aspect",
"@id": "iqb-editor-aspect", "version": "version-placeholder",
"name": { "specVersion": "4.0",
"de": "IQB-Editor (Aspect)", "metadataVersion": "2.0",
"en": "IQB editor (Aspect)" "type": "editor",
}, "name": [
"maintainer": { {
"name": { "lang": "en",
"de": "IQB - Institut zur Qualitätsentwicklung im Bildungswesen", "value": "IQB Editor (Aspect)"
"en": "IQB - Institute for Educational Quality Improvement" },
{
"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", "url": "https://www.iqb.hu-berlin.de",
"email": "iqb-tbadev@hu-berlin.de" "email": "iqb-tbadev@hu-berlin.de"
}, },
"description": { "code": {
"de": "TODO", "repositoryType": "git",
"en": "TODO" "licenseType": "MIT",
}, "licenseUrl": "https://opensource.org/licenses/MIT",
"version": "version-placeholder", "repositoryUrl": "https://github.com/iqb-berlin/verona-modules-apect"
"apiVersion": "2.0", }
"repository": {
"type": "git",
"url": "https://github.com/iqb-berlin/verona-modules-apect"
},
"notSupportedFeatures": []
} }
</script> </script>
<link rel="stylesheet" href="editor.css"> <link rel="stylesheet" href="editor.css">
......
...@@ -3,6 +3,57 @@ ...@@ -3,6 +3,57 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Editor Aspect</title> <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="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico"> <link rel="icon" type="image/x-icon" href="favicon.ico">
......
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