Thanks, Thibault.

This gets a bit complex, so I've created a Forum thread here: 

I've taken the liberty of copying your email response so that you don't have to (and so that I can respond to it).


On Fri, Jul 8, 2011 at 6:15 AM, Thibault Le Meur <> wrote:
Hi Tom,

Le 08/07/2011 06:48, Thomas White, MD, MS, MA a écrit :

In the generated Javascript, there are the following types of xxxxxSGQA codes.  Please let me know if I am understanding their purpose correctly and/or point me to documentation describing how they should be used.

(1) questionQ - a <div> around each question; controls whether the question is visible/hidden


(2) displayQ - set to 'on' if visible - but what is this really used for?

I would love to know the current use of this field as well.
In fact I would love to have this field recorded to DB and used to efficiently implement the chaining-conditions thing.

(3) javaSQGA - these match the column names from the deployed survey, and can hold a value (but don't seem to).  What are they used for?  Does this hold the response for each question?
(4) answerSGQA - all types except X, R, and | have answerSGQA-<value> IDs.  How are these supposed to be used?  Sometimes they store values, but there are many more of these than there are database fields.

At the time I rewrote the conditions-code the answerSGQA element was used to store the answer for a question in the current page. However, for some question types the true value to be recorded to DB is computed from the HTML elements manipulated by the participants (see for instance the Ranking question type). In this case the element used to store the value my be named by the  javaSQGA convention.

The above statement was true for questions displayed in the same page, but since conditions can use answers from questions in previous page, javaSGQA hidden-input elements are used to store answer from previous page.

The only way to know in which element you can get an answer is to use the retrieveJSidname() php function.

(5) javatbdSGQA - what are these for?
(6) tbdispSGQA - what are these for?  I'm seeing them for all question types except for :;P5H!LD|GIKRQ

Table-specific elements (for question types using a table layout).
I've no idea of how exactly they are used.

If the javaSGQA fields are truly storing the current responses, then I can generate Javascript equations from ExpressionManager that control the visibility for each qestionQ based on mathematical equations using those javaSGQA values.

However, most of the custom JavaScript solutions for dealing with dynamic sums and display seem to use the answerSGQA fields, so I'm confused as to which I should be using.

Any pointers?  Thanks.

I'm afraid that the only pointer is the PHP  code of the retrieveJSidname() function.

Hope this helps a little bit,


------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense.
_______________________________________________ limesurvey-developers mailing list