When are the survey elements created?

More
3 months 4 days ago #182036 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.

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 months 4 days ago #182055 by tpartner
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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
3 months 4 days ago #182056 by LarryMartell
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?

Please Log in or Create an account to join the conversation.

More
3 months 4 days ago #182060 by tpartner
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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182308 by LarryMartell
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.

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182309 by tpartner
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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182312 by LarryMartell
Where is that? Below is what I see.
Attachments:

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182313 by Joffm
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
Attachments:

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182314 by LarryMartell
Do not see that button on that page
Attachments:

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182318 by tpartner
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.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182320 by LarryMartell
Yes, I am on that page, but no button to clear assets cache. Did you look at my attached screen shot?

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago - 2 months 4 weeks ago #182321 by tammo
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 Tools for Research
Proud developers of the TFR Responsive Limesurvey theme
toolsforresearch.com/limesurvey-responsive-template
Last edit: 2 months 4 weeks ago by tammo.

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182322 by LarryMartell
How do I clear the cache via FTP? I do have direct ssh access to the host running lime. I tried just deleting the tmp dirs but then lime would not run.

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182324 by tammo
Sorry, I need to let the people that currently still have older versions running answer, because this may have changd. I am not sure any more.

In the newer version (3.0 and up) it is at tmp/assets and tmp/runtime/cache. But if anyone knows better, please inform here!

Tammo


Tammo ter Hark at Tools for Research
Proud developers of the TFR Responsive Limesurvey theme
toolsforresearch.com/limesurvey-responsive-template

Please Log in or Create an account to join the conversation.

More
2 months 4 weeks ago #182332 by LarryMartell
We are running Version 2.73.1+171220 and the files are served from tmp/assets - I read in a post here that I could remove the tmp dirs and they would get recreated, but when I did that they did not, and lime would not run. Luckily I had made a copy before I deleted them. But not sure what FTP has do to with this.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!