Home > Uncategorized > How To Force GPS Capturing

How To Force GPS Capturing

Overview

Sometimes GPS data might not be captured due tobeing indoor’s or having problematic GPS signal communication.
This ‘how to’ will show you how to force the GPS data to be captured in your survey and not to allow it to end, unless the GPS data is captured.

Step 1: Writing the needed code in the Advanced Scripts:
Step 2: Creating the needed validation question.

Step 1: Writing the needed code in the Advanced Scripts:

First you would need to write the following code in you’r ‘Advanced Scripts’ window:

function OnGPSUpdated(inLocation)

{


SubjectGPSLocation = inLocation;

}

function GPSValid ()

{

    var retVal = false;

    retVal = SubjectGPSLocation.IsValid;

    if (!retVal) {

        OpenGPS();

    }

    return retVal;

}


Step 2: Creating the needed validation question.

Now create an empty question that has this text and this start script:
Start Script:
SetTextFormat(CurrQues,GPSValid());

Question Body Text:
Was GPS captured until now: {0}
End of the survey. This question has a validation check to make sure the GPS location info was captured

* The question body test can be changed to your own text, as long as it has the ‘{0}’ as it would pipe inside it the current GPS data.

Now you should create the validation rule that will prevent the surveyor to continue, unless GPS data was captured:
Condition:
!GPSValid()

Message:
* Whatever you want.

You can also add another empty question right after it, to let the surveyor know that the data was captured, for example:

Start Script:
SetTextFormat(CurrQues,SubjectGPSLocation.Longitude,SubjectGPSLocation.Latitude);

Question Body Text:

GPS coordinates were recorded:
Long: {0}
Lat: {1}
You can now safely finish the survey

Here is a demo survey using this method:
Demo Survey – Force GPS Capture

That’s it!

Visit us at: http://www.dooblo.net

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: