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

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

timestamps in questions. it wont work... :(( 3 years 4 months ago #61042

  • ikojck
  • ikojck's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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 administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 3 years 4 months ago #61044

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2714
  • Thank you received: 331
  • Karma: 121
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?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 3 years 4 months ago #61057

  • ikojck
  • ikojck's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
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: 3 years 4 months ago by ikojck.
The administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 3 years 4 months ago #61059

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2714
  • Thank you received: 331
  • Karma: 121
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 3 years 4 months ago #61063

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4206
  • Thank you received: 790
  • Karma: 360
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:
$('#question'+timeQID).hide();
To:
//$('#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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 3 years 4 months ago #61064

  • ikojck
  • ikojck's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
Hi,

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

:)
The administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 3 years 4 months ago #61065

  • ikojck
  • ikojck's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 9
  • Karma: 0
thanks to the lime survey team as well! its working now! :)
The administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 2 years 7 months ago #73556

  • hammannk
  • hammannk's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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 administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 2 years 7 months ago #73557

  • Mazi
  • Mazi's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 5325
  • Thank you received: 296
  • Karma: 249
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
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)limesurvey.org'"
The administrator has disabled public write access.

Re: timestamps in questions. it wont work... :(( 2 years 7 months ago #73558

  • hammannk
  • hammannk's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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 administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.166 seconds
Donation Image