Welcome to the LimeSurvey Community Forum

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

COMO AUTOMATIZAR GPS AL ABRIR EL FORMULARIO?

  • CristobalB
  • CristobalB's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 5 days ago #243624 by CristobalB
Ayúdenos a ayudarle y rellene los siguientes campos:.
Su versión de LimeSurvey:[vea la parte inferior derecha de su pantalla de administración de LimeSurvey].
Servidor propio o LimeSurvey Cloud:
Plantilla de diseño utilizada:
==================
[Buen dia, como puedo automatizar la carga de GPS al iniciar el formulario? ]

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 3 days ago #243659 by holch
Que quiere decir "automatizar GPS"? Que quieres hacer? No lo entiendo.

También: Porque no respondiste las preguntas básicas (Versión, tipo de host, plantilla/tema de Limesurvey)

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

Please Log in to join the conversation.

  • CristobalB
  • CristobalB's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 1 day ago #243736 by CristobalB
Replied by CristobalB on topic COMO AUTOMATIZAR GPS AL ABRIR EL FORMULARIO?
Lo que quiero es que al iniciar una encuesta sin tener ningun boton se registre las coordnadas gps en una pregunta abierta oculta

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 months 18 hours ago #243776 by holch
Puedes incluir un Javascript para escribir los cordenatos GPS en una pregunta del tipo texto curto, por exemplo.

Aqui un ejemplo (probablemente de Tpartner):
Code:
<script type="text/javascript" charset="utf-8">
 
$(document).ready(function(){
 
// Identify this question
var q1ID = '{QID}';
var q1 = $('#question'+q1ID);
 
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><script type="text/javascript" charset="utf-8">
 
$(document).on('ready pjax:scriptcomplete',function(){
 
// Identify this question
var q1ID = '{QID}';
var q1 = $('#question'+q1ID);
 
function getGPS() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showGPS, gpsError);
} else {
$('input.text', q1).val('No GPS Functionality');
$('input:hidden[id^="answer"]', 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);
$('input:hidden[id^="answer"]', q1).val(position.coords.latitude+';'+position.coords.longitude);
}
 
getGPS();
 
});
</script><script type="text/javascript" charset="utf-8">
 
$(document).on('ready pjax:scriptcomplete',function(){
 
// Identify this question
var q1ID = '{QID}';
var q1 = $('#question'+q1ID);
 
// Click event for the button
$('.gpsLink').click(function(){
getGPS();
});
 
function getGPS() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showGPS, gpsError);
} else {
$('input.text', q1).val('No GPS Functionality');
$('input:hidden[id^="answer"]', 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);
$('input:hidden[id^="answer"]', q1).val(position.coords.latitude+';'+position.coords.longitude);
}
 
});
</script>

Esto lo pones en el texto de la pregunta y la pregunta escondes, pero vía una clase de CSS "hidden" que puedes poner en las configuraciones avanzadas del la pregunta. No puedes usar el "always hide", porque no funciona con Javascript.

Pero, la persona va a tener que aceptar GPS en el navegador, cuando aparece el pedido. si no, no va a funcionar.

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

Please Log in to join the conversation.

  • CristobalB
  • CristobalB's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 months 1 week ago #244170 by CristobalB
Replied by CristobalB on topic COMO AUTOMATIZAR GPS AL ABRIR EL FORMULARIO?
Gracias, ya coloque el script pero no corre por favor me puedes ayudar con el Archivo . Lss

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 months 1 week ago - 10 months 1 week ago #244172 by Joffm
No, viceversa.
Tu envías tu exportación lss. 

Entonces podemos ver tu error y decir por qué no funciona.

Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 10 months 1 week ago by Joffm.
The following user(s) said Thank You: holch

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose