Time stamp when an individual question is answered

More
1 month 2 days ago #188810 by ChrisMcD
I am trying to setup a survey which will be completed over several days.

Is it possible to record the exact time when an individual question (or group) was answered ? I know I can see when the whole survey was completed, but I'd like to see the time of one individual question.

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

LimeSurvey Partners
More
1 month 2 days ago #188811 by holch
This is possible, see here:
manual.limesurvey.org/Activating_a_survey

When you activate the survey, you can set "Save timings" to YES and Limesurvey will record when a "page" has been submitted. You can do this for individual questions only if you use the question by question mode. In the group by group mode you will only be able to do it per group, because it will save the timings when you "submit" a page and go to the next one.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

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

More
1 month 2 days ago #188818 by ChrisMcD
Ah ok thanks for the reply. I was hoping to be able to use Group By Group and somehow get a a timestamp of when a question or if not when a group was completed (e.g. group1 submited at 9.53am).

Looks like this might not be possible

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

More
1 month 2 days ago #188819 by holch
Hmmm, I am not sure why you say that. I just showed you an option.

Wait, you are referring to timestamps. Maybe that is the issue. Not sure if LS just notes the time itself or the timestamp. Haven't used this feature in quite a while.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

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

More
1 month 2 days ago #188820 by ChrisMcD
Apologies I maybe did not make myself clear.

I have timings switched on and it will currently record how much time a user took to answer a group of questions e.g. Group 4 - 23.24(seconds)

What I would like is to be able to see the exact time of day when a group was completed. So when I export the responses I can see Group4 - 19.23:23

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

More
1 month 2 days ago #188821 by holch
Just did a quick test on the LS Demo site and seems like it is not timestamps that are saved per question, but rather the timing in between.

18,"2019-09-17 01:11:57","2","en","1658867261","2019-09-17 01:11:47","2019-09-17 01:11:57"," Demo.limesurvey.org/index.php?r=admin/su....26","","6.91","4.35 "


However, you have the timestamp when the survey was started and you have the last time stamp as well, so you probably could calculate the timestamp per question group based on this.

Or you could write the timestamp into a hidden question (not via GUI, but CSS). I am not sure how this could be done, though. Not an expert on JS.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

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

More
1 month 2 days ago - 1 month 2 days ago #188823 by tpartner
Can't test this week but I think you should be able to insert a hidden (via CSS) text question in each group and set the date in those questions with Expression Manager in equation questions. (I think Expression Manager will be fired on page-submit)

{myHiddenQuestion = date()}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 1 month 2 days ago by tpartner.

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

More
1 month 2 days ago - 1 month 2 days ago #188834 by ChrisMcD
Thanks for reply Tony. I saw another suggestion which appears to be similiar to your method. Suggest putting the below, in the source code of a free text box. I assume you leave the box blank, and it it populates with the datetime. ITried the code, but when I export the repsonses, the box was blank.


<script type="text/javascript" charset="utf-8">	
	$(document).ready(function(){
		if($('#question{QID} input.text').val() == '') {
			$('#question{QID} input.text').val(new Date().getTime());
		}
	});
</script>

Actually I checked and I think it might have been one of your old posts lol
Last edit: 1 month 2 days ago by ChrisMcD. Reason: more info

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

More
1 month 2 days ago #188836 by holch
Did you hide the question? If so, how?

Always try with the question not hidden first and see what happens. Only when that works, hide the question.

If you hide the question via the GUI (the feature you mentioned before - "Always hide question"), it does not appear in the source code of the questionnaire at all and the JS funcion can not write into it. So for using javacript, you'll need to hide the question via CSS, as Tony described above.

However, if you use the approach via Expression Manager, you can hide the question via GUI, because Expression Manager can still write to the question, even if it is not in the html code of the displayed questionnaire.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

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

More
1 month 1 day ago #188844 by tpartner
Also, I think you may want to remove the .getTime() function. That will give you epoch time, not a date.

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
1 month 1 day ago #188853 by DenisChenu
Unsure, mus be checked but i think you can use (for group 1 here)

1. A text question startTimeG1 (hidden by attribute)
2. A text question lastTimeG1 (hidden by attribute)
3. An equation question setTimeG1 (hidden by attribute)

Equation can be
{startTimeG1=if(is_empty(startTimeG1.NAOK,date("Y-m-d H:i:s"),startTimeG1)}
{lastTimeG1=date("Y-m-d H:i:s")}

startTimeG1 get the 1st seen time
lastTimeG1 get the last seen time (just a microseconds after).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

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

More
1 month 1 day ago #188857 by ChrisMcD
Hi Tony

The code still doesnt seem to populate a date/time in the response field. The question is hidden and doesnt appear to give any errors.

Any other ideas ?
<script>
	$(document).ready(function(){
		if($('#question{QID} input.text').val() == '') {
			$('#question{QID} input.text').val(new Date().getTime());
		}
      {
     $('#question{QID}').hide();
  }
	});
</script>

Thanks for the help

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

More
1 month 1 day ago - 1 month 1 day ago #188876 by tpartner
Try this:

<script>
	$(document).ready(function(){
if($('#question{QID} input:text:eq(0)').val() == '') {
			$('#question{QID} input:text:eq(0)').val(new Date());
		}
      {
     $('#question{QID}').hide();
  }
	});
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 1 month 1 day ago by tpartner.

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

More
1 month 19 hours ago #188887 by ChrisMcD
Perfect Tony ! That's exactly what I was looking for.

Many thanks for your help and hard work, you guys are doing fantastic job supporting the community !

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

More
1 month 17 hours ago - 1 month 17 hours ago #188892 by ChrisMcD
I forgot to also post (for anyone in the future looking to do the same). This only appears to work when selecting a question "Short Free Text" I initially had it as "Long Free Text" which didn't work.
Last edit: 1 month 17 hours ago by ChrisMcD. Reason: moe info

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!