Check out the LimeSurvey source code on GitHub!

Large surveys - createinsertquery() issue

5 years 1 month ago #71158 by maknase
I'm on 1.91+ and I have an issue with large scale surveys (400 groups, 4 questions each, all mandatory). As at every step (group) the results are saved it takes some time to load the next page. I found out that the function createinsertquery in save.php on line 138 takes most of the time.

So, I thought I reduce the time and save the results only every 20 steps (groups). with this code:
if ($thisstep % 20 == 0) $subquery = createinsertquery();

Works fine until I get to the 20th step. Then it says suddenly that I haven't answered a mandatory question.

Any idea why this happens? ANy other idea how I can avoid limesurvey to save results at every step?

Please Log in to join the conversation.

5 years 1 month ago #71175 by TMSWhite

LimeSurvey 1.92 RC1 fixes that problem in two ways:
(1) It only loads the survey definition from the database once at survey start time. 1.91+ would re-load the entire definition on each page.
(2) It has a NavigateForwards() function that checks the validity of each group, and manages skipping of groups if several in a row are irrelevant (have no questions that should be shown). That function pools all of the database update information and generates SQL when it gets to a page that should be shown (or the end of the survey). So, if you skip 20 pages, you'll still only have one database update call.
(3) It also checks all of the mandatory and validation rules. So, if you are using the Navigation Index, and skip back 20 pages, change something, then try to skip to the end, it will stop on the first page that fails a mandatory or validation rule.

1.92 RC1 isn't considered a stable release yet, but you might want to try it to see if it addresses your issue.


Please Log in to join the conversation.

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