Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Saving totals to DB

Re: Saving totals to DB 2 years 10 months ago #65897

  • jg2011
  • jg2011's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
I just found this post bugs.limesurvey.org/view.php?id=5375
Scripts do not run for hidden questions. c_schmitz states "this is intended behaviour".

So any solution using a hidden question with javascript to save assessment totals to the database cannot work.
The administrator has disabled public write access.

Re: Saving totals to DB 2 years 10 months ago #65955

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5300
  • Thank you received: 291
  • Karma: 247
jg2011, the bug report states "If you hide a question (by setting "Always hide this question" to Yes), then any script embedded in the question text is not executed."

The reason is that in that case no HTML is generated at all so you can't fill the question and nothing will be saved.

The solution is to hide the question by using Javascript at the question text. To hide a question using Javascript you first have to disable the internal <a href='docs.limesurvey.org/tiki-index.php?page=...al+settings#Security'>XSS</a> filter at the admin section (global settings -> security -> "Filter HTML for <a href='docs.limesurvey.org/tiki-index.php?page=...al+settings#Security'>XSS</a> = 'no'").
Then you ahve to edit the according question. Edit the question text in source code mode and add this snippet at the end of the text:
 
<script>
   $(document).ready(function() 
   {
      $('#question4444').hide();
   });
</script>
 
 
You have to replace the question ID ("4444") with the ID of the current question .

Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
Last Edit: 2 years 10 months ago by Mazi. Reason: SOURCE CODE CORRECTED
The administrator has disabled public write access.

Re: Saving totals to DB 2 years 10 months ago #65957

  • TMSWhite
  • TMSWhite's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 759
  • Thank you received: 82
  • Karma: 36
FYI, Expression Manager also helps address this 'hidden' behavior in LimeSurvey 1.92. Relevance (whether a question should be processed) and Visibility are now separated. That way, you can have an Equation question that is relevant, but hidden. Anything that is relevant is saved to the database, even if it is hidden via the "Always hide this question" option. This is the strategy you can take for your hidden assessment scores in the future.
The administrator has disabled public write access.

Re: Saving totals to DB 2 years 10 months ago #65967

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1061
  • Thank you received: 234
  • Karma: 74
One option is to make the survey question by question
Yes... or probably better group by group with:
Group#1: All your survey questions
Group#2: your hiddden (or not ) question for asssessments stuff
Now you can force the submit action for your Group#2's question adding this to its answer source:
<script>
jQuery(document).ready(function($) {
document.limesurvey.submit();});
</script>
BenoÎt
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Last Edit: 2 years 10 months ago by Ben_V.
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.223 seconds
Donation Image