0 votes
in SoSci Survey (English) by s306607 (130 points)

Basically I have designed an html page for 1 page of the survey. I have created an internal variable and called it in html's response/ input box but the system doesnt recognize it.

I am not sure if I made a mistake somewhere.

For internal variable I created a new question, selected internal variable, in its item/ body created variable with name IV01 but that comes across as variable description with variable being [01]. I am not sure if this is an index thing or not.

And if possible could you show an example of implementing this? i.e. what to write in internal variable in question, in php(Also php above html when draggin n dropping right?) and html.

I am calling script in html for animation and I am not sure If i should use internal variable there using like:

document.getElementById("AB01_01").value = "2";

1 Answer

0 votes
by SoSci Survey (339k points)

There are different applications of internal variables.

A) You can drag an "internal variables" question in the questionnaire page, and then address the variables via JavaScript, like the example that you postet. Make sure to run your script below of the question (or after the DOM was loaded).

If the page is reloaded, your script should first read the existing value from the hidden input, use it to initialize your script, and then modify the value eventually.

B) You can use prepare_input() to tell SoSci Survey to watch out for a form element with a given name. That is, you would create an internal variable AB01_01 in your liust of questions, then add some html form element such as <input name="AB01_01"> and add the PHP code prepare_input('AB01_01') that will tell SoSci Survey to read the data.

Note, that the second solution will not (!) automatically fill the previous answer into the input.

C) You can use the input elements provided by SoSci Survey. Let's say you created a text input TX01_01 (not an internal variable, but a differen question type) and want to place it somewhere in your HTML code, you use the palceholder %input:TX01_01%. That is the easiest option to combine custom HTML code with inputs.

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...