Welcome to the LimeSurvey Community Forum

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

Including optional 'script' field in tab-separated import

More
3 weeks 4 hours ago #271257 by criteriac
Your LimeSurvey version: Cloud Version 6.15.5
==================
Hi everyone,

I'm running a survey with a large number of items, so it makes sense for me to edit and upload these as a survey via the tab-separated import method. However, I can't see anywhere where I can include text for the "script" tab when you view it in the survey platform. Each question has a bit of javascript attached and it would be quite time-consuming to manually add this after importing the text file.

Am I missing something and it is actually possible to include the script within the question in a .txt file?

Cheers :)

Please Log in to join the conversation.

More
2 weeks 6 days ago #271264 by Joffm
You can use either the question text or the help text.
Remember to surround with <script>...</script> tags.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: criteriac

Please Log in to join the conversation.

More
2 weeks 6 days ago #271266 by criteriac
Thanks Joffm, that did seem to work. I placed the javascript in the "help" column surrounded by <script> tags. While the script doesn't get automatically populated into the "script" tab (it stays in the help tab), it executes correctly and that is fine for our use case.

Please Log in to join the conversation.

More
2 weeks 5 days ago #271269 by holch
Over years we have included all scripts in the question text or the help text, until they included a field for the scripts. So there is no problem to have the script there, as long as it appears in the source code.

The script tab is basically just a way to separate the script visually from question text and help text in the GUI. In the source code it doesn't really matter.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
2 weeks 4 days ago #271272 by tammo
True, but there is a nasty thing here:
1. The script field itself is surrounded by the script tags, so implementing a solution as described in this forum will be different in the question/help field (please include the <script></script> tags) from implementing it in the script field (please exclude the <script></script> tags. This will result in people not using the script field as often because of the different behaviour.
2. Adding <css> statements is excluded, while this would have been helpful.
and now pops up:
3. This field is excluded in an export.

This could all have been done so much better with the same effort!

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

More
2 weeks 2 days ago #271279 by holch
Yeah, the script field is actually a pretty good idea, but it has been implemented rather "sub optimal". I think separating scripts and CSS from the main question text or the help text is a good idea in theory. But the way this was implemented certainly didn't help its "popularity". Maybe this should be a bug report.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
2 weeks 2 days ago #271283 by tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

More
2 weeks 2 days ago #271292 by holch
Well, that bug report talks about having CSS in the script field. But the issue here is that the script field isn't exported.

Seems to be different issues.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
2 weeks 17 hours ago #271319 by tammo
Yes, right. I pointed to this error report to show that the other point I made here are already reported. Since 2022.

I fear that this feature was implemented with too high speed and too little thinking about consequences.

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

More
2 weeks 15 hours ago #271324 by holch

I fear that this feature was implemented with too high speed and too little thinking about consequences.
 
Wouldn't be the first time, and won't be the last either.

Unfortunately there seems to be very little "strategy" in the development. A developer picks something up, thinks its fairly easy to implement, without looking into the deeper implications. Of course it isn't too difficult to add a new text field, if you don't look at all the implications of that.

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.

Please Log in to join the conversation.

More
2 weeks 13 hours ago #271327 by tammo
I hope that the developers read this and find a way of making this feature better.

I want to be positive about what LimeSurvey is, even though it has its flaws. In fact it helps me a lot doing my work. But is can always be improved.

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose