Welcome to the LimeSurvey Community Forum

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

Timings aren't being saved

  • Luca_W
  • Luca_W's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #239751 by Luca_W
Timings aren't being saved was created by Luca_W
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition  Version 3.28.29+220920
==================

Hey everyone! 

I want to save timings for my survey, but despite the appropriate function being activated, the table where the timings should be is empty and reads "no surveys found" (as seen below), while all other answers are being stored. Here bugs.limesurvey.org/view.php?id=18171#c70476 it's reported as a bug and marked as solved, but it's either still not working for me or I don't understand what I need to do to fix it. Is there a way to make the timings work reliably (I heard it also depends on browsers and stuff?) or is there maybe a workaround, not using the build-in function? 


Thanks for any suggestions!

https://bugs.limesurvey.org/file_download.php?file_id=16078&type=bug

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #239752 by tpartner
Replied by tpartner on topic Timings aren't being saved
That bug was reported for and fixed for version 5.x.

The timings work for me in version 3.28.45. Update to the latest 3.x version and retest.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Luca_W
  • Luca_W's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #239753 by Luca_W
Replied by Luca_W on topic Timings aren't being saved
My LimeSurvey Access is through my university, so unfortunatly I can't update the version

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #239754 by holch
Replied by holch on topic Timings aren't being saved
Then you should let them know that the version they are using is outdated.

Even though I have seen worse (4 months without updates, bug and security fixes is "nothing" for a university installation, some of them never update), it is a good idea to run an update soon, as you can see. The bug seems to have been fixed in the meanwhile.

So besides an update, there is very little you can do.

Also, timings are not stored in "anonymous surveys", just to let you know, in case you use anonymous surveys. The browser should have no impact, because these timings are saved via the server.

Now, if you need timings and your university won't update anytime soon, you could create hidden questions and store the timing into these via Javascript. However, with a university installation, chances are high that the XSS filter is switched on and you won't be able to use Javascript.

Not sure if there is a function in Expressin script to store the current time in a hidden equation question.

But of course, keep in mind that the timings can be impacted by the browsers rendering speed, by the internet speed of a respondent, etc.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • Luca_W
  • Luca_W's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago - 1 year 9 months ago #239756 by Luca_W
Replied by Luca_W on topic Timings aren't being saved
Thanks for the quick reply and the hints. I can't see the XSS filter setting (obv.), but I have used javascript in my survey before and everything seemed to work fine. How could I track time with javascript? I tried this code: www.limesurvey.org/manual/Workarounds:_M...cord_group_view_time but can't get it to work. The question is still visible and nothing is stored (i replaced the QQ).
Last edit: 1 year 9 months ago by Luca_W.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago - 1 year 9 months ago #239757 by Joffm
Replied by Joffm on topic Timings aren't being saved
Hi, Luca,
I am not surprised that this workaround doesn't work.
It was created for version 1.87+
You saw the first line there
Tested with: 1.87+

And as you read in the next line
in version 1.92 there was implemented the timing table
As of version 1.92, group view time is accurately recorded in the timings table if you choose the Record Timings survey option.

One other thing: Seems that this bug only occured in environments with Microsoft SQL Server.

Joffm

 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 1 year 9 months ago by Joffm.

Please Log in to join the conversation.

  • Luca_W
  • Luca_W's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 9 months ago #239774 by Luca_W
Replied by Luca_W on topic Timings aren't being saved
Hi Jo,

yeah I saw that, thought I try it anyway. Is there another way?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 9 months ago #239788 by tpartner
Replied by tpartner on topic Timings aren't being saved

I tried this code: manual.limesurvey.org/Workarounds:_Manip...cord_group_view_time but can't get it to work.


This script placed in the source of a short-text question will load the input of that question with the elapsed time a respondent views the page.

After testing, you can hide that question with a CSS class "hidden d-none".
Code:
<script type="text/javascript" data-author="Tony Partner">
 
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // Identify this question
    var thisQuestion = $('#question{QID}');
 
    var timeInput = $('input:text.form-control:eq(0)', thisQuestion);
 
    var initSec = 0;
 
    // Check for elapsed time from previous visits    
    if ($.trim($(timeInput).val()) != '') {
 
      var initTime = $.trim($(timeInput).val());
 
      initTimeArr = initTime.split(':');
 
      initSec = (Number(initTimeArr[0])*3600)+(Number(initTimeArr[1])*60)+(Number(initTimeArr[2]));
 
    }
 
    // Run the timer update function
    recordTime(initSec);
 
    // Timer update function
    function recordTime(elapsedSec){
 
      var h = Math.floor(elapsedSec / 3600);      
      var m = Math.floor(elapsedSec % 3600 / 60);      
      var s = Math.floor(elapsedSec % 3600 % 60);
 
      var elapsedTime = (h > 0 ? h + ":" : "00:") + (m > 0 ? (m < 10 ? "0" : "") + m + ":" : "00:") + (s < 10 ? "0" : "") + s; 
 
      $(timeInput).val(elapsedTime).trigger('keyup');
 
      elapsedSec++;
 
      // Run the timer update function every second
      setTimeout(function() {
        recordTime(elapsedSec);
      }, 1000);
    }
  });
</script>

Sample survey attached: 

File Attachment:

File Name: limesurvey...3(1).lss
File Size:19 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: Luca_W

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose