Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

display endPage.html for more than a flash

Hi!

I'm writing a study in jsPsych and JATOS, and at several points we want to be able to end the study based on users' responses (failing to consent, sharing information that makes them ineligible to participate). JsPsych and JATOS both theoretically have methods for displaying a page after the study is over, explaining to participants why they've been abruptly booted.

However, the simple html page I wrote (endPage.html, according to what JATOS docs suggested) just flashes on the screen for less than a second before the tab closes.

Is there a way to keep endPage.html up until the user closes the tab?

Thanks,

-E

Relevant code snippets

JATOS endStudy calls:

jatos.onLoad(function(){

var jsPsych = initJsPsych({
      on_close:  function() {
        var resultData = jsPsych.data.get().ignore('internal_node_id');
        jatos.endStudy(resultData.csv());
      },
      on_finish: function() {
        var resultData = jsPsych.data.get().ignore('internal_node_id');
        jatos.submitResultData(resultData.csv(),jatos.endStudy);
      }
    });

A sample trial that ends study early:

var info = {
    type: jsPsychHtmlButtonResponse,
    stimulus: '<h2>Participant Consent</h2><p>Please download and read <a href="CONSENT.pdf" target="_blank">this consent form</a>.</p><p>By continuing, you are consenting to this study.</p>',
    choices: ['Could not download','Agree to participate'],
    on_finish: function(data) {
      if(data.response == 0){
        jsPsych.endExperiment(endmessage,data);
      }
    }
}


Comments

  • Hi!

    I just tried the endPage.html with my local JATOS but without jsPsych and it worked. So, I'm pretty sure it has something to do with jsPsych messing with jatos.js' endStudy. I assume there is nothing in your endPage.html that closes the tab, e.g. like window.close() ?

    I see that you call jatos.endStudy twice once from on_close and once from on_finish . I'm not so familiar with jsPsych but maybe this is not necessary and actually might cause your blip. Have you tried to use only one of the two callbacks?

    I hope this helps already and if not keep asking.

    Best,

    Kristian

  • Hi Kristian,

    You were correct in assuming that endPage.html didn't have anything like window.close(). :)

    Your suggestion of calling jatos.endStudy only once seems to have worked on a very cursory test. I just commented out the full on_close portion and tried running it again. The behaviour looked exactly the same if I used the "run" button within the JATOS interface (it flashed the end screen then redirected to the JATOS study view immediately), but if I copied a study link and ran it in a new tab, endPage.html did just what I wanted it to.

    I'd like to find a way to keep both the on_close and on_finish statements, though. It happens sometimes that participants close the tab before the data gets sent to JATOS, and I want to avoid losing that information if possible. Still, this is a good enough fix for now, and that's a separate issue, so if I can't figure it out I guess I'll start a separate issue.

    Thanks so much,

    -Elise

  • Hi Elise,

    The behaviour looked exactly the same if I used the "run" button within the JATOS interface (it flashed the end screen then redirected to the JATOS study view immediately), but if I copied a study link and ran it in a new tab, endPage.html did just what I wanted it to.

    Ah, yes, if you start a study with 'Run' button in JATOS' GUI / study page, the endPage.html won't show. This happens only if you use a proper study link. Obvious reason is that the first one is for development and people usually want to get back to JATOS' GUI.

    I'd like to find a way to keep both the on_close and on_finish statements, though. It happens sometimes that participants close the tab before the data gets sent to JATOS, and I want to avoid losing that information if possible.

    I'm still lost here. I could imagine that somehow by defining both jsPsych callbacks the study is finished twice. But JATOS should just ignore the second call and the first call should proceed as expected and redirect to the endPage.html. Not sure what happens there. But I can't work on it without being able to reproduce it in my JATOS :/.

    Best,

    Kristian

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games