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

TOPIC: Saving GPS coordinates

Saving GPS coordinates 10 months 2 weeks ago #118564

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 4399
  • Thank you received: 620
  • Karma: 198
@tpartner: And it is not even 1.92, it is 1.91, even older...
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.

Saving GPS coordinates 10 months 2 weeks ago #118589

  • shawnchan
  • shawnchan's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
Oh..I guess I have to upgrade Limesurvey before asking for help again.

Thanks again for your advise.
The administrator has disabled public write access.

Saving GPS coordinates 10 months 4 days ago #118976

  • shawnchan
  • shawnchan's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
I used your scripts on Demo version of limesurvey and I can get the GPS coordinates now. The GPS coordinates is automatically shown the text box when I open the survey. Thanks tpartner for that.

What I'm trying to do now is to use the GPS function as a measure of quality control, making sure that they have done the interviews at the correct location.

Is there any way we can "secretly" store the GPS coordinates without noticing the users? because now GPS coordinates is shown on screen and even can be edited by users. I tried to do it by hiding the questions but I can't get the GPS coordinates when the question is hidden.
The administrator has disabled public write access.

Saving GPS coordinates 10 months 4 days ago #118981

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5419
  • Thank you received: 1155
  • Karma: 480
You cannot manipulate a question that is hidden with the advanced question settings.

Try hiding the question with JavaScript.

<script type="text/javascript" charset="utf-8">
 
	$(document).ready(function(){
 
		// Identify this question
		var q1ID = '{QID}';
		var q1 = $('#question'+q1ID);
 
		// Hide this question
		q1.hide();
 
		function getGPS() {
			if (navigator.geolocation) {  
				navigator.geolocation.getCurrentPosition(showGPS, gpsError);
			} else {  
				$('input.text', q1).val('No GPS Functionality');  
			}
		}
 
		function gpsError(error) {
			//alert('GPS Error: '+error.code+', '+error.message);
		}
 
		function showGPS(position) {
			$('input.text', q1).val(position.coords.latitude+', '+position.coords.longitude);
		}
 
		getGPS();
 
	});
</script>
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.

Saving GPS coordinates 10 months 3 days ago #119032

  • shawnchan
  • shawnchan's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 5
  • Karma: 0
It's works perfectly now!!! Thanks a lot!
The administrator has disabled public write access.

Saving GPS coordinates 4 days 2 hours ago #131079

  • rasheed
  • rasheed's Avatar
  • Offline
  • Senior Lime
  • Posts: 46
  • Thank you received: 3
  • Karma: 1
Hello,

I wonder if there is a similar script for getting the device system info such as OS, Navigator,..

Thank you !
The administrator has disabled public write access.

Saving GPS coordinates 4 days 2 hours ago #131081

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 4399
  • Thank you received: 620
  • Karma: 198
Yes there is and you can find an example here in the forum. It might be a little older, but I gave an example where you save a lot of data about the browser and the screen etc. via Javascript into a hidden question. I am not sure if OS is included, but should be possible to include.
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.

Saving GPS coordinates 4 days 2 hours ago #131082

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 4399
  • Thank you received: 620
  • Karma: 198
Here the post that I mention. You just need to find out how to reference the OS via Javascript, but you should find some examples out there for this.

www.limesurvey.org/forum/can-i-do-this-w...g-screen-size#127805
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.
The following user(s) said Thank You: rasheed
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.216 seconds