Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
How do I encode a condition matching technique into my program?

I am new to programming and am currently trying to use jsPsych to create a browser-based behavior experiment.

In my experiment, participants first complete a "pre-trial" in which they rate various pictures:

var scale_1 = ["Do not enjoy", "Neutral", "Enjoy"];

var pre_trial = {
    timeline: [{
        type: 'survey-likert',
        preamble: jsPsych.timelineVariable('image'),
        questions: [{labels: scale_1, prompt: "The prompt"}]
    }],
    timeline_variables: [
       {image: 'image address'},
       {image: 'image address'},
       {image: 'image address'}
    ]
};

Then, I use the ratings to divide the images into two conditions, A and B. This division process uses matching such that, ultimately, the images that received a "Do not enjoy" rating are evenly distributed between Condition A and Condition B, as are the images rated "Neutral" and the ones rated "Enjoy."

Unfortunately, I cannot figure out how to perform this matching procedure. I have tried many different combinations of various JavaScript and jsPsych functionalities, such as pop( ), splice( ), concat( ), jspsych.data.get( ).select('response'), and many more. However, all of them have failed.

Does anyone here have experience with matched condition assignment in jsPsych, or any idea about how to do it? If so, would you please consider sharing your ideas here? I know that there is a GitHub forum dedicated to jsPsych, but I figured I would ask my question here as well since I am struggling so much to find the answer.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think maybe you can divide your whole experiment into four parts: pretrial, do-not-enjoy, neutral, enjoy.

In the pretrial, there are only pretrial and the function of jumping to the page depending on the answer participants give.

The last three parts are the same, they can distribute the participants into condition A or condition B randomly. (And depends on the platform you host, you can pass an url parameter to the second part to link the data)

// pre_trial is omitted here
jsPsych.init({
    timeline: [pre_trial],
on_finish: function(data) {
        var url;
        if (data.values()[0].response =="Neutral"){
          url = "http://...." // the url of neutral part
        }else if (data.values()[0].response =="Enjoy"){
          url = "http://...." // the url of Enjoy part
        }else if (data.values()[0].response =="Not Enjoy"){
          url = "http://...." // the url of Not Enjoy part
        }
        window.open(url)
    }
});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda