Skip to content

Survey configuration

Claudio Bonesana edited this page May 27, 2021 · 11 revisions

Adaptive engine

The adaptive engine applied to a survey can be explained with the following pseudo-code:

# given a survey s
s := survey()
# and a user u
u := user()

while not s.stop():
    q = s.next_question()
    a = u.answer(q)
    s.check(a)

What the tool models is the s := survey() part of the code. The u := user() is supposed to be a human or an algorithm that can generate answers to given question.

The survey need 3 functions:

  • a stop() condition that will halt the survey when met;
  • a check(a: answer) function to register the answer received; and
  • a next_question() function that will find the optimal next question.

What we can configure in the Survey object is practically everything that controls these three functions.

Survey configuration

The configuration of the survey can be done in multiple ways:

  • via database by pre-filling the remote database with everything needed;
  • via code by using, in Java, the Exchange library with the Remote API Key; or
  • by putting a JSON for each survey in a folder called /data in the work directory of the backend.

While the first two ways are explained within the code Javadoc, here we will explain how to build a compatible JSON file.

As reference, consider the content of the data folder in the backend module. Remember that the structure of the JSON is exactly what you would achieve by dumping the structure of object build using the Exchange Library.

Basic structure

We have 4 mandatory field to fill and one optional:

  • "survey": this contains all the configuration, parameters, thresholds, and descriptions relative to the survey.
  • "skills": this is a list of all the nodes in the models that the adaptive engine will optimize for.
  • "questions": this is a list of all the questions available.
  • "model": this field is a description of the CreMA model used by the adaptive engine.
  • (opt.) "modelData": if the "model" filed is set to null, this field will be used. This is a model written in UAI form. The string to put there can also be produced using the CreMA library.

Survey field

Skills field

Questions field

Model field

ModelData Field

Clone this wiki locally