From 3cb885a70449f74dd7eea051400d19c24acc1583 Mon Sep 17 00:00:00 2001 From: Claudio Bonesana Date: Wed, 5 Apr 2023 09:21:10 +0200 Subject: [PATCH 1/5] Fixed issue #25. --- .../src/main/resources/static/js/charts.js | 4 ++-- .../src/main/resources/templates/assist.html | 2 +- .../src/main/resources/templates/experiments.html | 6 +++--- .../main/resources/templates/fragments/layout.html | 14 +++++++------- .../src/main/resources/templates/home.html | 6 +++--- .../src/main/resources/templates/results.html | 2 +- .../src/main/resources/templates/survey.html | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/AdapQuestBackend/src/main/resources/static/js/charts.js b/AdapQuestBackend/src/main/resources/static/js/charts.js index e16f72e..0f1540d 100644 --- a/AdapQuestBackend/src/main/resources/static/js/charts.js +++ b/AdapQuestBackend/src/main/resources/static/js/charts.js @@ -7,7 +7,7 @@ const width = 500 - margin.left - margin.right; const height = 400 - margin.top - margin.bottom; // following is the entropy lines chart -d3.json('/survey/states/' + token) +d3.json(context + 'survey/states/' + token) .then((data) => { const entropies = [] @@ -99,7 +99,7 @@ d3.json('/survey/states/' + token) }); // following is the distribution bar chart -d3.json('/survey/state/' + token) +d3.json(context + 'survey/state/' + token) .then(data => { const distributions = [] data.skills.forEach(s => { diff --git a/AdapQuestBackend/src/main/resources/templates/assist.html b/AdapQuestBackend/src/main/resources/templates/assist.html index f674d69..ffcfc61 100644 --- a/AdapQuestBackend/src/main/resources/templates/assist.html +++ b/AdapQuestBackend/src/main/resources/templates/assist.html @@ -65,7 +65,7 @@

- +
diff --git a/AdapQuestBackend/src/main/resources/templates/experiments.html b/AdapQuestBackend/src/main/resources/templates/experiments.html index 5b262b7..80a4f10 100644 --- a/AdapQuestBackend/src/main/resources/templates/experiments.html +++ b/AdapQuestBackend/src/main/resources/templates/experiments.html @@ -21,7 +21,7 @@

AdapQuest Experiments

- +   Template @@ -58,13 +58,13 @@

AdapQuest Experiments

-
+ th:href="|@{/experiments/result/}${experiment.getResult()}|"> diff --git a/AdapQuestBackend/src/main/resources/templates/fragments/layout.html b/AdapQuestBackend/src/main/resources/templates/fragments/layout.html index 398ef81..16f37e6 100644 --- a/AdapQuestBackend/src/main/resources/templates/fragments/layout.html +++ b/AdapQuestBackend/src/main/resources/templates/fragments/layout.html @@ -1,15 +1,15 @@ - - + + - - - + + + +
diff --git a/AdapQuestBackend/src/main/resources/templates/survey.html b/AdapQuestBackend/src/main/resources/templates/survey.html index acde524..aa5fe67 100644 --- a/AdapQuestBackend/src/main/resources/templates/survey.html +++ b/AdapQuestBackend/src/main/resources/templates/survey.html @@ -60,7 +60,7 @@

- + From 853e839648b363f1710ce88f669f6cf28001d0a4 Mon Sep 17 00:00:00 2001 From: Claudio Bonesana Date: Wed, 5 Apr 2023 09:33:35 +0200 Subject: [PATCH 2/5] Updated readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e885d49..2dbbbd4 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,9 @@ chose `Postgres 13.1` but any other SQL-based engine supported by *Hibernate* sh Refer to the [Wiki](https://github.com/IDSIA/adapquest/wiki) for more details on the `docker-compose` configuration. +> **Note:** to change the context path of the application it is possible to use the environment variable `SERVER_SERVLET_CONTEXT-PATH`. + + ## Keycloak integration It is possible to use Keycloak as identity provider instead of the simple APIkey internal mechanism. From b4c412e05b01fdf7660c66a584963279f803ef21 Mon Sep 17 00:00:00 2001 From: Claudio Bonesana Date: Wed, 5 Apr 2023 10:54:50 +0200 Subject: [PATCH 3/5] Added variable to questions' answers in case the model in JSON format does not have one assigned. --- .../adaptive/backend/services/InitializationService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AdapQuestBackend/src/main/java/ch/idsia/adaptive/backend/services/InitializationService.java b/AdapQuestBackend/src/main/java/ch/idsia/adaptive/backend/services/InitializationService.java index 80c7673..7f0b6ba 100644 --- a/AdapQuestBackend/src/main/java/ch/idsia/adaptive/backend/services/InitializationService.java +++ b/AdapQuestBackend/src/main/java/ch/idsia/adaptive/backend/services/InitializationService.java @@ -178,6 +178,11 @@ public static Survey parseSurveyStructure(ImportStructure structure) { .setYesOnly(q.yesOnly) .setMultipleSkills(q.multipleSkills) .addAnswersAvailable(q.answers.stream() + .peek(a -> { + if (a.variable < 0) { + a.setVariable(v.get(q.name)); + } + }) .map(a -> new QuestionAnswer() .setName(a.name) .setText(a.text) From b8b4a8222f7ce720afd04cadbd083be749545bc6 Mon Sep 17 00:00:00 2001 From: Claudio Bonesana Date: Wed, 5 Apr 2023 11:01:55 +0200 Subject: [PATCH 4/5] Changed width of answers in CSS because reasons. --- AdapQuestBackend/src/main/resources/static/css/style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AdapQuestBackend/src/main/resources/static/css/style.css b/AdapQuestBackend/src/main/resources/static/css/style.css index 0b81498..553de5f 100644 --- a/AdapQuestBackend/src/main/resources/static/css/style.css +++ b/AdapQuestBackend/src/main/resources/static/css/style.css @@ -75,8 +75,7 @@ svg { border-radius: .25rem; background-color: white; padding: 2pt 4pt; - min-width: 5em; - max-width: 42em; + width: 42em; flex-grow: 1; text-align: left; } From 9ad48c2d857028eb60935e88537a62993777ba84 Mon Sep 17 00:00:00 2001 From: Claudio Bonesana Date: Wed, 5 Apr 2023 11:03:40 +0200 Subject: [PATCH 5/5] Updated to 1.6.3. --- AdapQuestBackend/pom.xml | 2 +- AdapQuestExchange/pom.xml | 2 +- AdapQuestExperiments/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/AdapQuestBackend/pom.xml b/AdapQuestBackend/pom.xml index 6cdea7d..5dafbba 100644 --- a/AdapQuestBackend/pom.xml +++ b/AdapQuestBackend/pom.xml @@ -5,7 +5,7 @@ adapquest ch.idsia.adaptive - 1.6.2 + 1.6.3 4.0.0 diff --git a/AdapQuestExchange/pom.xml b/AdapQuestExchange/pom.xml index 89221db..cc936d7 100644 --- a/AdapQuestExchange/pom.xml +++ b/AdapQuestExchange/pom.xml @@ -5,7 +5,7 @@ adapquest ch.idsia.adaptive - 1.6.2 + 1.6.3 4.0.0 diff --git a/AdapQuestExperiments/pom.xml b/AdapQuestExperiments/pom.xml index 636518a..1839f3a 100644 --- a/AdapQuestExperiments/pom.xml +++ b/AdapQuestExperiments/pom.xml @@ -5,7 +5,7 @@ adapquest ch.idsia.adaptive - 1.6.2 + 1.6.3 4.0.0 diff --git a/pom.xml b/pom.xml index c7f4b5a..509fe51 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ ch.idsia.adaptive adapquest pom - 1.6.2 + 1.6.3 AdapQuestBackend AdapQuestExchange