Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

When are the survey elements created?

  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 1 week ago #182036 by LarryMartell
When are the survey elements created? was created by LarryMartell
I have inherited a Lime system that has a custom template. The template creates questions that result in an array with answers (i.e. one question has multiple answers), and there are multiple answers for the question (i.e. one question could have answer 1: a, b, c, d and answer 2: x, y, z), organized as a table on the page. When I look at the DOM after the survey is generated I see there are 10 potential answers (rows in the table), and all but the first is hidden. There is an 'Add row' button that unhides a row when clicked. What I need to do is have the survey rendered with the first 3 answers shown. I tried to do this in the document ready function - there the table exists but has no rows. I do not see any code in the custom template that created the rows of the table. Are the rows added in some lime code? Where would I put my code to unhide 3 rows of this table?

Sorry if this is not clear, this is my first experience with lime so please bear with me.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 week ago #182055 by tpartner
Replied by tpartner on topic When are the survey elements created?
If you have an 'Add row' button, you have a custom JavaScript workaround applied. If you disable that workaround, you should see all rows (sub-questions) defined in the LimeSurvey admin interface.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 1 week ago #182056 by LarryMartell
Replied by LarryMartell on topic When are the survey elements created?
I do not want to display all the rows (there are 10), only the first 3. What is confusing me is that in the document ready function the table has no rows, but then if I inspect the DOM after the page is rendered it has 10 rows. Where would those rows get created?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 1 week ago #182060 by tpartner
Replied by tpartner on topic When are the survey elements created?
I'm not sure what you are looking at but the rows are created server-side before the page is loaded. They may be hidden by CSS or JavaScript in your custom theme.

I suspect you are using this workaround so that will have to be modified - manual.limesurvey.org/Workarounds:_Manip...ble_Text.29_question

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 2 days ago #182308 by LarryMartell
Replied by LarryMartell on topic When are the survey elements created?
Thanks - I got this sorted out and working. One thing I had trouble with is installing the new template.js file. I tried to upload it in the template editor, but my update did not take - nothing was changed after uploading. On the deployed system I found the template.js file in either 2 or 3 different locations (differing by deployed system) - not counting the 4, 5, 6, or 7 tmp dirs. First I updated the file in all the places I found it (not including the tmp dir), but the changes were not seen by lime. Tried restarting, logging out, removing the tmp dir (which caused lime to not run), but no matter what, no joy. The only way I could get it deployed was to put it directly in the tmp dir it was being served out of. That does not seem like the correct thing to do, but I hope whenever that tmp dir gets updated or changed it will pick up the new file from one of the 3 places it exists at.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 days ago #182309 by tpartner
Replied by tpartner on topic When are the survey elements created?
There is a button in the configuration screen to reset tmp assets.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 2 days ago #182312 by LarryMartell
Replied by LarryMartell on topic When are the survey elements created?
Where is that? Below is what I see.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 days ago #182313 by Joffm
Replied by Joffm on topic When are the survey elements created?
Hi,
you find it here:
In "Configuration / Global Settings / General"


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 2 days ago #182314 by LarryMartell
Replied by LarryMartell on topic When are the survey elements created?
Do not see that button on that page
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 days ago #182318 by tpartner
Replied by tpartner on topic When are the survey elements created?
https://pathTo/limeSurvey/index.php/admin/globalsettings

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • LarryMartell
  • LarryMartell's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 2 days ago #182320 by LarryMartell
Replied by LarryMartell on topic When are the survey elements created?
Yes, I am on that page, but no button to clear assets cache. Did you look at my attached screen shot?
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
5 years 2 days ago - 5 years 2 days ago #182321 by tammo
Replied by tammo on topic When are the survey elements created?
From looking at the image you showed in a previous post in this thread, I see that your editor (and therefore your LimeSurvey installation) is from a version earlier than 3.0

You might have to clear the cache via FTP (or update your installation to the most currect version).


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 5 years 2 days ago by tammo.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose