Welcome to the LimeSurvey Community Forum

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

timestamps in questions. it wont work... :((

  • ikojck
  • ikojck's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #61042 by ikojck
Hi,

i want to add a timestamp to my question groups and i found some solutions. But, as i tried them none of them will work. i cant understand where the problem is as i am doing everything right, or am i forgetting something??!
i followed the instructions on both solutions that i found and i tested my survey for javascript and its enabled. but the timer still wont work.
its really urgent as i am doing my bachelor thesis at the moment.

Thank you!

1st. solution

www.aptigence.com.au/home/archives/28-Re...sing-LimeSurvey.html

2nd. solution

docs.limesurvey.org/Workarounds:+Manipul...cord_group_view_time
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61044 by holch
Well, what does not work? What is the result of your efforts?

Is there nothing written into the text field?

Did you set the right questionid?

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

The topic has been locked.
  • ikojck
  • ikojck's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago - 12 years 10 months ago #61057 by ikojck
in the end as i export my survey with the data i get "1980-01-01 00:00:00" for the timer. wich shouldnt be, i think!

what do you mean in the text field?? which text field, where? the text field of the question is empty before an after the completion of the survey. :(
and how else can i see the timer results?

I set as questionid the id of the question which has the javascript for the timestamp in its source section.is it correct? or should the question id be the id of the actual question in the group which the participants see and not the timestamp question which they dont see?

and which solution do you have in mind? the short or the long version?

because the short one is in the source of the help section of the question but the long one is in the question's source its self.

which should i use i how do i get it right?


P.S. I want there to be several groups with timestamps. and each group will have only two question - the timestamp question and the normal question which the user sees.
where do i place the javascript in the timestmap question or in my actual question which the user sees??

also, in the short solution its said that the visibility of the timestamp question should be hidden. but the long solution doesnt say anything about it. i dont know which is right?

1.Set up your survey to use JavaScript.
2.In the group, create a short-text question. We will hide this later with JavaScript and populate it with the elapsed time.
3.Place the following script in the source of the short-text question.
4.Replace "QQ" in line 6 with the ID of the short-text question.

The "hide" here is meant as hide the question or hide the short-text field of the question??
Last edit: 12 years 10 months ago by ikojck.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61059 by holch
Well, those are two different tutorials and seems like one is older than the other, because the feature to hide the question from within Limesurvey is only available in newer versions.

I was talking about the text field where you are supposed to write the timestamp in. If later on in the database there is written "1980-01-01 00:00:00", then this means that there has been written something into your hidden text field (or are you referring to the standard timestamp already provided by limesurvey for the whole survey?).

But unfortunately it is writing the wrong thing into the text field.

I am not an expert in Javascript nor have I ever used this workaround. What I would do is the following:
- Create the question group with the two questions
- I wouldn't hide the text question which is supposed to receive the info of the timestamp yet.
- Then I would use the javascript from the tutorial to fill this text field. If the textfield doesn't get filled, something is going wrong. You can also see whether the timestamp is correct.
- Only when the right time is written into this text field I would check what appears in the database. If that is correct I would hide the text question.

I am not sure where the Javascript belongs. I would write it into the first question on the page.

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

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 10 months ago #61063 by tpartner
Replied by tpartner on topic timestamps in questions. it wont work... :((
METHOD 1
The first (shorter) workaround simply populates a hidden question with a timestamp of when the group is viewed for the last time.

I think, though, that this workaround may not work because hiding the hidden question with the 'Always hide this question' advanced setting prevents it from being included in the DOM which means that it is inaccessable by JavaScript. I think this question should be hidden with CSS or JavaScript.

METHOD 2
The longer workaround records a total time that the group was viewed, even if a respondent leaves and returns to the group.

To test, you can leave the hidden question visible. Change:
Code:
$('#question'+timeQID).hide();
To:
Code:
//$('#question'+timeQID).hide();

I want there to be several groups with timestamps

Both workarounds can be applied to as many groups as you like.

also, in the short solution its said that the visibility of the timestamp question should be hidden. but the long solution doesnt say anything about it. i dont know which is right?

In the second workaround the question is hidden with JavaScript (see testing above).

The "hide" here is meant as hide the question or hide the short-text field of the question??

Hide the whole timer question.

where do i place the javascript in the timestmap question or in my actual question which the user sees??

JavaScript can be place in the question source or the help source of any question on the page.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • ikojck
  • ikojck's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #61064 by ikojck
Hi,

thanks very much! I figured it out at the end!

:)
The topic has been locked.
  • ikojck
  • ikojck's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 10 months ago #61065 by ikojck
thanks to the lime survey team as well! its working now! :)
The topic has been locked.
More
12 years 1 month ago #73556 by hammannk
Replied by hammannk on topic timestamps in questions. it wont work... :((
Hello!

First of all thank you for your help, the second method (longer one) works fine! But is it right that I get only the seconds not the milliseconds the user sees the page? And is there a possibility that I can change the script to see milliseconds as well?

Thanks!
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
12 years 1 month ago #73557 by Mazi
I just checked the technical details: At the database the value is store with miliseconds and when exporting results e.g. to MS Excel, these miliseconds are exported as well. Only at the browse response screen, this seems to be rounded.
I'm not sure what you would need miliseconds for, but you can file a ticket at our bugtracker, asking to show the total value at the browse response screen instead of the rounded one.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
12 years 1 month ago #73558 by hammannk
Replied by hammannk on topic timestamps in questions. it wont work... :((
Great! I didn't need to see the milliseconds, I just wondered if they would be recorded and just wanted to export them as well... thanks a lot!
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
12 years 1 month ago #73586 by Mazi

hammannk wrote: Great! I didn't need to see the milliseconds, I just wondered if they would be recorded and just wanted to export them as well... thanks a lot!

You're welcome :-)

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
9 years 11 months ago #106779 by ermal
Getting error "Property Survey_dynamic.datestamp is not defined." when taking survey, after the welcome screen.


anyone knows how to disable datestamps. where is it located in settings???
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose