Howdy, Stranger!

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

Supported by

Programming a multi-character (correct) response

Hi everyone,

I am programming my first OpenSesame experiment. The goal is a spelling bee task. My current trial sequence looks like this:

1) a word is presented through a sampler calling on a random word defined as [word] in the block loop

2) the answer_input_form is used to collect the participants answer

3) an inline script is written to compare the answer of the answer_input_form to the correct answer [word].

4) feedback is presented (correct/incorrect)


This set-up has some flaws: The answer_input_form cannot be timeout by the press of a butten (i.e. press enter when you have finished typing the word). Therefore, I have also tried this method: https://forum.cogsci.nl/discussion/31/solved-multi-character-keyboard-response-or-simultaneous-sketchpad-and-text-input but am unsure how to adapt the code to my situation.

Any help is appreciated, thanks in advance!

Comments

  • Hi @elisevt,

    Here's a hybrid solution using code inspired from that you found.

    It kind of works, with one limitation: it is not possible to enforce a strict timeout on the keyboard object using that method. This is because the keyboard call awaits a response before executring any other code, and so the timeout condition cannot be assessed until after a key has been pressed. This means that if you wanted to enforce a time limit of, say, 5000 ms, the response taking would not be interrupted until the first key being pressed after that 5000 ms interval. I searched for a solution to this but I don't think one exists (through I'm no Python expert; perhaps @eduard knows of a way around it).

    Other than that, I attach a demo task that does most of what you require: presents words in random order, takes multiple key presses (handles back spaces, special characters), kind of limits the response time window, and scores the response and provides feedback. Hopefully you can modify it and adapt it to your needs.

    I included notes throughout the code inside the task so that you can see what each bit does.

    The general logic is to encapsulate the registration of multiple key presses with it s own loop, nested within the loop controlling the trial. That way, we can interrupt the registration of responses when the subject presses "ENTER" or when the last response registered comes later than the maximim allowed time (not that I coded this as the "time_limit" variable inside the "words_list" loop, so that it could be set differently for different trial if you wanted to).

    Please also note the use of the break it function in the loop tasked with registering key presses:

    Here's my version of the task:

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • Hi Fabrice,

    Thanks so much, the experiment is running now!


    Elise

  • Hi @elisevt,

    Glad I could help! Good luck with your experiment!

    Cheers,

    Fabrice.

    Buy Me A Coffee

  • edited May 21

    Hi @Fab,

    I've slowly but surely been building my experiment, with your help! The trial set-up still looks similar to your screenshot. The only problem left to solve that the randomization in OS is random with replacement. However, I would like to have randomization without replacement so no word is presented twice during the experiment. My wordpool is large enough to allow this.

    Thanks in advance for your help!


    Cheers,

    Elise

  • Hi @elisevt,

    I'm not sure I understand what you mean. The random order setting of the loop does not allow the repetition of a trial within a cycle.

    If you set the number of cycle to a value greater than 1, then the trials will each be presented several times (the number of cycles you specified).

    If you're using this method and some words are repeated, then it must be that you have the same word featured on multiple rows in your loop.

    Hope this helps,

    Fabrice.

    Buy Me A Coffee

  • Hi @Fab,

    This is part of the experiment overview:

    The idea is that for each round (1 round = 3 trials) in the experiment, participants pick a difficulty level for words to spell (Keuzescherm - Keuzekey - Keuze). The screenshot shows level 1 and part of 2. Each level has its own library defined under LX_trial_loop, where X = chosen difficulty.

    Let's say difficulty 1 is chosen two rounds in a row, the experiment reloops through the L1_loop two times. I guess my question is: is there a way to write out words during the first L1_loop (let's call the variable already_presented) and removing these words from the possible rows during the second L1_loop.

    Hope this makes more sense.

    Elise

  • Hi Elise,

    You can define a list to which you add all words that were presented, essentially maintaining an "already_presented" list. Then you can use this list to check whether the selected word was already presented and if so, resample from the words list.

    There are different ways to approach that list. It is important where you initialize/reset it: (1) Once in the beginning of the experiment will keep all used_words throughout the entire experiment. (2) In every block will clear the list in every block, so that the same word can re-appear, but only in separate blocks. (3) In such a way that every run is replacing the previous one, such that you would end up with a "recent-words-list" of sorts. You could also use a dictionary instead of a list and keep track of the recent words per difficulty level simultaneously.

    Does this make sense?

    Eduard

    Buy Me A Coffee

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