Interactive UI for processing the mock foundation exam of the ISAQB. Interactive UI for doing quizzes.
The application requires internet access on startup, because the application loads all tasks directly from the repository on Github.
There are three types of distributions:
-
as startable JAR file
-
as Docker image
-
as distribution with embedded Java runtime
If you have a Java runtime installed (required Java21+), you could download the JAR and start it as any startable JAR:
java -Dfile.encoding=UTF-8 --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -jar onlinetrainer-{VERSION}.jar
Here you have to specify the file encoding, as the application produces UTF-8 characters.
Additionally you should "open" the Java module system.
You could start the application by starting the docker image:
docker run -p 8080:8080 janmaterne/onlinetrainer:latest
Here you have to publish port - maybe with changing it -p 80:8080
.
After starting the container you could access the application via the specified port on http://localhost:8080 or respectively http://localhost:80 or http://localhost.
After extracting the distribution archive you’ll find a start script run.bat
(Windows) or run.sh
(Linux, MacOS) in the root directory.
With this script you could start the application which will open port 8080
for incoming requests from the browser.
So opening http://localhost:8080/ should work.
The application is configured via standard springboot yaml config file.
The default file is at the default location src/main/resources/application.yaml
.
That file is documented so you should be able to dive in.
On startup you could overwrite these settings in the usual springboot manner, e.g. changing the file of the cache database:
java … -jar onlinetrainer-${version}.jar --spring.datasource.url=jdbc:h2:./h2-cache.file
or via environment variable
set SPRING_DATASOURCE_URL=jdbc:h2:./h2-cache.file
java ... -jar onlinetrainer-${version}.jar
Also you could place a custom application.yaml
in the current location. The values are merged with the defaults in the application.
The easiest way is providing an application.yaml
in the working directory.
When using a different location you have to specify that location:
java … -jar --spring.config.additional-location=<URL>
URL
could be a classpath:
or file:
location.
(When using --spring.config.location
instead …additional-location
Spring will only use these settings
instead of merging them.)
With Docker the type of configuration does not change. But you have to 'modify' the container in the way you need:
docker run --rm -p 8080:8080 janmaterne/onlinetrainer:latest --key=value
docker run --rm -p 8080:8080 -e KEY=value janmaterne/onlinetrainer:latest
docker run --rm -p 8080:8080 -v c:/absolute/path/to/application.yaml:/app/application.yaml janmaterne/onlinetrainer:latest
You have topics referencing tasks and you have quizzes referencing tasks. Tasks are loaded from resources.
There are multiple format for defining the tasks:
This is the original format as used by the ISAQB.
AsciiDoc based but with a standard format: parts defining the task per language and an part for (English) explanation.
While the latter is simple AsciiDoc the former has a more complex format.
Have a look at the test resouces like src/test/resources/ParserTest/question-04.adoc
.
Derived from the model there is also a yaml format (src/test/resources/ParserTest/question-04.yaml
).
The third format is text based. It starts with a header containing of key: value
pairs and the language task definition. Each language starts with LANG
(with LANG = DE or EN). A split line (---
) separates the
question text, possible options and the explanation. A "possible option" is selected, if the line starts with an x
.
All explanations are merged as there is only one language supported.
The fourth format is a small version of the text format and uses defaults and limitations: task id is calculated from its content, type is always 'K' and it supports only DE-language.
Interaktives UI für das Üben der Mockprüfung des iSAQB Foundation Level. Interaktives UI für die Durchführung von Quizzes.
Die Anwendung benötigt Internetzugang zum Startzeitpunkt, da die Anwendung dann alle Fragen direkt aus dem Repository bei Github herunterlädt.
Es gibt drei Arten der Distribution
-
als startbares JAR
-
als Docker Image
-
als Distribution mit mitgebrachter Java Laufzeit
Das Docker Image kann von DockerHub bezogen werden während die anderen Artefakte als Releases auf GitHub erhätlich sind.
Wenn eine Java Laufzeit installiert ist (es wird mindestens ein Java 21 benötigt), kann einfach das JAR heruntergeladen und wie gewohnt gestartet werden:
java -Dfile.encoding=UTF-8 --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED -jar mockexam-{VERSION}.jar
Dabei muss das Encoding gesetzt werden, da die Anwendung UTF-8 Zeichen erzeugt.
Auch sollte das Java Modulsystem befriedigt werden.
Man kann die Anwendung durch per Docker Image starten:
docker run -p 8080:8080 janmaterne/onlinetrainer:latest
Hier muss der Port veröffentlicht werden - eventuell mit Änderung desselben: -p 80:8080
.
Nach dem Start des Containers kann die Anwendung über den spezifizierten Port erreicht werden: http://localhost:8080 bzw. http://localhost:80 bzw. http://localhost
Nachdem die Distribution heruntergeladen wurde, kann man ein Startskript run.bat
(Windows) bzw. run.sh
(Linux, MacOS) im Wurzelverzeichnis finden.
Über dieses Skript kann die Anwendung gestartet werden, welche den Port 8080
öffnet, um Anfragen eines Browsers zu beantworten.
Ein Öffnen von http://localhost:8080/ sollte daher reichen.
Die Anwendung wird über die Standard-SpringBoot-Mechanismen konfiguriert.
Die Default-Konfiguration liegt in src/main/resources/application.yaml
.
Diese Datei ist dokumentiert, so dass dass Sie sich zurechtfinden sollten.
Die Konfigurationswerte können beim Start über die gewohnten Wege überschrieben werden, z.B. um die Cache-Datenbank zu ändern:
java … -jar onlinetrainer-${version}.jar --spring.datasource.url=jdbc:h2:./h2-cache.file
oder über Umgebungsvariablen
set SPRING_DATASOURCE_URL=jdbc:h2:./h2-cache.file
java ... -jar onlinetrainer-${version}.jar
Man kann auch eine eigene application.yaml
im aktuellen Verzeichnis bereitstellen, deren Werte dann germergt werden.
Wenn ein anderer Pfad als application.yaml
im aktuellen Arbeitszeichnis verwendet wird, muss dieser angegeben werden:
java … -jar --spring.config.additional-location=<URL>
URL
kann dabei eine classpath:
oder file:
Lokation sein.
(Wenn --spring.config.location
anstelle …additional-location
verwendet wird, wird Spring nur diese Angaben verwenden anstelle sie zu mergen.)
Mit Docker ändern sich die Mechanismen nicht. Man muss nur entsprechend den Container starten:
docker run --rm -p 8080:8080 janmaterne/onlinetrainer:latest --key=value
docker run --rm -p 8080:8080 -e KEY=value janmaterne/onlinetrainer:latest
docker run --rm -p 8080:8080 -v c:/absolute/path/to/application.yaml:/app/application.yaml janmaterne/onlinetrainer:latest
Es gibt Topics, die Tasks referenzieren und es gibt Quizzes, die Tasks referenzieren. Tasks werden von Resourcen geladen.
Dabei gibt es mehrere Formate, Tasks zu definieren:
Dieses ist das Originalformat, wie es von der ISAQB verwendet wird.
Es ist AsciiDoc-basierend, setzt aber ein bestimmtes Format voraus:
Die ersten Teile definieren die Tasks (ein Teil pro Sprache) und ein letzter eine (englischsprachige) Erläuterung.
Während die Erläuterung einfaches AsciiDoc ist, haben die ersten ein komplexeres Format.
Vergleiche hierzug die Testresource src/test/resources/ParserTest/question-04.adoc
.
Abgeleitet von den Domänenklassen gibt es auch ein YAML-Format (src/test/resources/ParserTest/question-04.yaml
).
Das dritte Format is textbasierend. Es startet mit einem Header bestehend aus schlüssel: wert
Paaren und den
sprachspezifischen Definitionen. Jede Definition beginnt mit LANG
(mit LANG = DE oder EN).
Eine Trennzeile (---
) teilt zwischen dem Fragetext, den möglichen Antworten und den Erläuterungen.
Eine "mögliche Antwort" gilt als "wahr", wenn die Zeile mit einem x
beginnt.
Alle Erläuterungstexte werden gemergt, da nur eine Sprache unterstützt wird.
Das vierte Format is eine kleinere Version des Textformates und verwendet Defaults und Einschränkungen: die Task-ID wird aus dem Inhalt berechnet, der Typ ist immer "K" und es wird nur DE unterstützt.