Skip to content

Commit

Permalink
Merge pull request #29 from IDSIA/dev
Browse files Browse the repository at this point in the history
Version 1.6.3
  • Loading branch information
cbonesana authored Apr 5, 2023
2 parents a52545a + 9ad48c2 commit dbf8714
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 24 deletions.
2 changes: 1 addition & 1 deletion AdapQuestBackend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>adapquest</artifactId>
<groupId>ch.idsia.adaptive</groupId>
<version>1.6.2</version>
<version>1.6.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions AdapQuestBackend/src/main/resources/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions AdapQuestBackend/src/main/resources/static/js/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []

Expand Down Expand Up @@ -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 => {
Expand Down
2 changes: 1 addition & 1 deletion AdapQuestBackend/src/main/resources/templates/assist.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h3 th:text="'Q' + ${question.id}"></h3>
<div id="chart-distribution"></div>
</div>

<script th:src="@{~/js/charts.js}"></script>
<script th:src="@{/js/charts.js}"></script>
</div>

<div th:replace="fragments/layout :: footer"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1>AdapQuest Experiments</h1>
<form method="post" action="" enctype="multipart/form-data">
<div class="input-group mb-3">
<div class="">
<a class="btn btn-primary" th:href="@{~/experiments/template}" role="button">
<a class="btn btn-primary" th:href="@{/experiments/template}" role="button">
<i class="bi bi-download"></i>
&nbsp;
Template
Expand Down Expand Up @@ -58,13 +58,13 @@ <h1>AdapQuest Experiments</h1>
<td th:text="${experiment.getName()}"></td>
<td th:text="${#temporals.format(experiment.getCreation(), 'yyyy-MM-dd HH:mm')}"></td>
<td>
<a th:href="|@{~/experiments/experiment/}${experiment.getName()}|"><i
<a th:href="|@{/experiments/experiment/}${experiment.getName()}|"><i
class="bi bi-download"></i></a>
</td>
<td th:text="${#temporals.format(experiment.getCompletion(), 'yyyy-MM-dd HH:mm')}"></td>
<td>
<a th:if="${experiment.getCompleted()}"
th:href="|@{~/experiments/result/}${experiment.getResult()}|">
th:href="|@{/experiments/result/}${experiment.getResult()}|">
<i class="bi bi-download">

</i></a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="layout">
<link rel="shortcut icon" th:href="@{~/img/favicon.ico}" type="image/ico"/>
<link rel="stylesheet" th:href="@{~/css/style.css}"/>
<link rel="shortcut icon" th:href="@{/img/favicon.ico}" type="image/ico"/>
<link rel="stylesheet" th:href="@{/css/style.css}"/>

<link rel="stylesheet" th:href="@{~/webjars/bootstrap/4.5.3/css/bootstrap.min.css}"/>
<link rel="stylesheet" th:href="@{~/webjars/bootstrap-icons/1.7.0/font/bootstrap-icons.css}">
<link rel="text/javascript" th:href="@{~/webjars/jquery/3.6.0/jquery.min.js}"/>
<link rel="stylesheet" th:href="@{/webjars/bootstrap/4.5.3/css/bootstrap.min.css}"/>
<link rel="stylesheet" th:href="@{/webjars/bootstrap-icons/1.7.0/font/bootstrap-icons.css}">
<link rel="text/javascript" th:href="@{/webjars/jquery/3.6.0/jquery.min.js}"/>

<script th:fragment="paths" th:inline="javascript" type="text/javascript">
const context = /*[[@{~/}]]*/ '';
const context = /*[[@{/}]]*/ '';
const token = /*[[${token}]]*/ '';

console.debug('context: ' + context)
Expand All @@ -28,7 +28,7 @@
<div th:fragment="header">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top" th:fragment="navbar">
<div class="container">
<a class="navbar-brand" href="#" th:href="@{~/}">AdapQuest</a>
<a class="navbar-brand" href="#" th:href="@{/}">AdapQuest</a>
<button aria-controls="navbarColor01" aria-expanded="false" aria-label="Toggle navigation"
class="navbar-toggler"
data-target="#navbarColor01" data-toggle="collapse" type="button">
Expand Down
6 changes: 3 additions & 3 deletions AdapQuestBackend/src/main/resources/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
<div class="card-body">
<h5 class="card-title">Demo</h5>
<p class="card-text">Complete surveys using the adaptive engine as a final user.</p>
<a th:href="@{~/demo/}" class="btn btn-primary">Go to Demo</a>
<a th:href="@{/demo/}" class="btn btn-primary">Go to Demo</a>
</div>
</div>

<div class="card text-center" th:if="${assistant}" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Assistant</h5>
<p class="card-text">Use the adaptive engine as a guide to complete a survey.</p>
<a th:href="@{~/assistant/}" class="btn btn-primary">Go to Assistant</a>
<a th:href="@{/assistant/}" class="btn btn-primary">Go to Assistant</a>
</div>
</div>

<div class="card text-center" th:if="${experiments}" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Experiments</h5>
<p class="card-text">Use the adaptive engine to perform batch experiments.</p>
<a th:href="@{~/experiments/}" class="btn btn-primary">Go to Experiments</a>
<a th:href="@{/experiments/}" class="btn btn-primary">Go to Experiments</a>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion AdapQuestBackend/src/main/resources/templates/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</li>
</ul>
</div>
<script th:src="@{~/js/charts.js}"></script>
<script th:src="@{/js/charts.js}"></script>
</div>

<div th:replace="fragments/layout :: footer"></div>
Expand Down
2 changes: 1 addition & 1 deletion AdapQuestBackend/src/main/resources/templates/survey.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ <h3 th:text="${question.name}"></h3>
<div id="chart-distribution"></div>
</div>

<script th:src="@{~/js/charts.js}"></script>
<script th:src="@{/js/charts.js}"></script>
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion AdapQuestExchange/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>adapquest</artifactId>
<groupId>ch.idsia.adaptive</groupId>
<version>1.6.2</version>
<version>1.6.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion AdapQuestExperiments/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>adapquest</artifactId>
<groupId>ch.idsia.adaptive</groupId>
<version>1.6.2</version>
<version>1.6.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>ch.idsia.adaptive</groupId>
<artifactId>adapquest</artifactId>
<packaging>pom</packaging>
<version>1.6.2</version>
<version>1.6.3</version>
<modules>
<module>AdapQuestBackend</module>
<module>AdapQuestExchange</module>
Expand Down

0 comments on commit dbf8714

Please sign in to comment.