Check out the LimeSurvey source code on GitHub!

displayQ and tbdispSGQA hidden input fields - do we really need them?

More
4 years 10 months ago #75422 by TMSWhite
Here's a question for people who use custom JavaScript in their surveys.

In 1.91, we have the following:
(1) for each question, there is one <input type='hidden' id='displayQ'> field
(2) for each sub-question, there is one <input type'hidden' id='tbdispSGQA'>

When the question/sub-question is relevant, their value is set to 'on'; and when it is irrelevant, the value is set to ''.

None of these variables is needed or used by Expression Manager in 1.92, we I'm wondering whether they can be safely removed.

So, for each question, there are 2 or 3 input variables; so removing the displayQ and tbdispSGQA variables would reduce the number of $_POST variables by 33-50%

Pros:
(1) PHP 5.39 has a default limit of 1000 $_POST variables per input page - so if we don't remove them, we impose limits on survey size.
(2) Reducing the _POST size reduces network traffic and may avoid timeouts.

Cons:
(1) Might break existing surveys if they are using custom JavaScript that accesses those variables. However, those surveys could use the new relevanceQ and relevanceSGQA variables instead; and people heavily invested in those variables could just stick with 1.91+.

So, any strong objections to removing those variables?

Please Log in to join the conversation.

More
4 years 10 months ago #75437 by DenisChenu

TMSWhite wrote: So, any strong objections to removing those variables?

Remove ! Remove !

Less is more ;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
4 years 10 months ago #75462 by Mazi
Please contact user tpartner about it, he is our JS expert.


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
4 years 10 months ago #75515 by c_schmitz
I am for removing these.

Best regards

Carsten Schmitz
LimeSurvey project leader

Please Log in to join the conversation.

More
4 years 10 months ago #75516 by tpartner
Me too.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 10 months ago #75530 by TMSWhite
OK - doing that.

One related question - What about the variables that have name='javaSGQA'? They mostly contain duplicates of the values in the inputs with name='SGQA' (which are usually the ones that are submitted, and processed to store the values in the database). Unfortunately, there is not

I'd like to remove the name='javaSGQA' attribute so that those values don't get POSTed. The input elements would stay (they are needed for JavaScript), and the IDs would remain (so that you can access those input fields via $('#javaSGQA'), but only SGQA and not javaSGQA values would be submitted.

The Pros of this is that it would ensure only one POST variable per sub-question, instead of 2.

Do you see any problems with (or have concerns about) this strategy?

Please Log in to join the conversation.

More
4 years 10 months ago #75538 by tpartner
Personally, I never use the name attributes but do quite often search for elements with an ID starting with a "java" string.

Eg.
$('#question'+q1ID+' li[id^="java"]:visible input.checkbox').attr('checked', true);

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form