Howdy, Stranger!

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

Supported by

Dynamic source files and path issues

I'm designing a lab-based experiment in OS 3.3.14 on a MacOS 12. As I am a new user migrating from PsychoPy, I have already run into some trouble using source files and setting durations. Here are the two issues I'm facing, for which I couldn't find an answer on the forum.

  1. For each participant, I have already individual excel sheet (e.g., p1_stim.xlsx) with holds a column (e.g., stimPath) having file names (face1.jpg) pointing to the stimuli (faces) to be presented. I wanted to add an inline code which sets a variable to the correct excel sheet per subject. Then set the "Source/File" in the block loop to this variable. Even if I manually set var.stimFile = "p1_stim.xlsx" and the block loop source is set to the the variable name itself (in the GUI or the script), I get an error ("Failed to read text file: var.stimFile" or "No such file or directory: 'var.stimFile' "
  2. ) even though I can see the correct variable name and value in the Inspector. How do I make this work?
  3. What if I were to use a separate folder for these stimuli excel sheets, within the folder where the experiment sits?
  4. I can fix the first problem by manually updating the source excel in the block loop for each participant. But then, all faces (file names are in the excel column) would have to be in the same folder as the experiment, which isn't neat. I could get around to this by adding all faces to the pool in advance, but this is a large dataset that the file pool cannot handle. And the number of faces used per participant is a pre-determined subset of this database. Not efficient. It would therefore be nice to somehow append a path to the file name used in the sketchpad.
  5. Finally, an unrelated problem. I would like each face to be presented for a full 3 seconds and associated KB response to timeout after 3 seconds. Basically, each face should remain on the screen for 3 seconds, and the participant must respond in this time or the trial moves forward to next. I can't seem to make this work. Setting the duration of face to 3 seconds, and KB timeout to 3 seconds makes each trial last 6 seconds. Setting face to 3s and KB to zero or infinite also doesn't work.

I've attached a sample of the excel and the experiment.

Please help. Thanks!



  • Update to the question above:

    1. I solved the first problem (listed above as 1-3), by loading all the excel files in the file pool. Thats the trick! And then I could dynamically select the right file by pointing the block loop source to [stimFile] which derives its values from a global-level inline code var.stimFile = (u'p%s_stim.xlsx' % var.subject_nr)
    2. Problem 4 about paths can also then be solved by preloading the files in the file pool, while keeping them in the desired folder.
    3. Problem 5 remains unsolved.

  • Hi Sam,

    Good that you figured most of it out by yourself!

    I would like each face to be presented for a full 3 seconds and associated KB response to timeout after 3 seconds

    The easiest would be to use co-routines:

    If this is no option for you, you would need to resort to Python coding, but that's also not super complicated. I suggest you start with the co-routines, and if this doesn't work out, I can help you with the other option.

    Good luck!


    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 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