lab.js integration

Más
1 mes 3 semanas antes - 1 mes 3 semanas antes #191504 por sdyckfr
lab.js integration Publicado por sdyckfr
I have an experimental video segmentation task set up with lab.js ( lab.js.org ) and want to integrate it in LS (3.20.2+191119) similar to how the lab.js developers describe its integration with Qualtrics ( labjs.readthedocs.io/en/latest/learn/deploy/3a-qualtrics.html ).

Could anyone help me out with how to set up the JavaScript in LS to data from the lab.js experiment in a hidden textarea within LS?

The description for Qualtrics uses an "embedded data field" in Qualtrics, which - to my understanding - Limesurvey does not have. The lab.js experiment is embeded in an iframe. The following code is used for connecting lab.js and the qualtrics "embedded data field".
// Listen for the study sending data
window.addEventListener('message', function(event) {
  // Make sure that the event is from lab.js, then ...
  if (event.data.type === 'labjs.data') {
    // ... extract the data lab.js is sending.
 
    // We're going to work with JSON data
    const data = event.data.json
 
    // ... save data and submit page
    Qualtrics.SurveyEngine.setEmbeddedData('labjs-data', data)
    document.querySelector('.NextButton').click()
  }
})
Última Edición: 1 mes 3 semanas antes por sdyckfr.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

LimeSurvey Partners
Más
1 mes 1 semana antes #192129 por Skyler9
Respuesta de Skyler9 sobre el tema lab.js integration

sdyckfr escribió: I have an experimental video segmentation task set up with lab.js ( lab.js.org ) and want to integrate it in LS (3.20.2+191119) similar to how the lab.js developers describe its integration with Qualtrics ( labjs.readthedocs.io/en/latest/learn/deploy/3a-qualtrics.html ).

Could anyone help me out with how to set up the JavaScript in LS to data from the lab.js experiment in a hidden textarea within LS?

The description for Qualtrics uses an "embedded data field" in Qualtrics, which - to my understanding - Limesurvey does not have. The lab.js experiment is embeded in an iframe. The following code is used for connecting lab.js and the qualtrics "embedded data field".

// Listen for the study sending data
window.addEventListener('message', function(event) {
  // Make sure that the event is from lab.js, then ...
  if (event.data.type === 'labjs.data') {
    // ... extract the data lab.js is sending.
 
    // We're going to work with JSON data
    const data = event.data.json
 
    // ... save data and submit page
    Qualtrics.SurveyEngine.setEmbeddedData('labjs-data', data)
    document.querySelector('.NextButton').click()
  }
})


Its important to understand that running a controlled experiment on an algorithm that is so complex is nearly if not completely impossible. Thousands of variables are at play and it’s our job to try and minimise those variables to the best of our abilities. By doing so, we have to restrict the questions we may be able to answer to their simplest form. Only by doing that we may get some meaningful answers.

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

Más
1 mes 5 días antes #192142 por DenisChenu
Respuesta de DenisChenu sobre el tema lab.js integration
1. Add a text question to store the data
2. Add javascript : labjs.readthedocs.io/en/latest/learn/deploy/3-third-party.html
3. Fill the input with data $("answer{SGQ}").val(theData) using jquery

See manual.limesurvey.org/Workarounds:_Manip...ime_using_Javascript

If you want a more automatic system : check manual.limesurvey.org/BeforeQuestionRender

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

Por favor, Identificarse o Crear cuenta para unirse a la conversación.

¡Comenzar ahora!

Simplemente cree una cuenta y comience a usar LimeSurvey hoy mismo.

Registrarse ahora
¡Únase a nuestro boletín informativo!

Iniciar sesión