Howdy, Stranger!

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

Supported by

Bug : Variable font size

edited September 2016 in OpenSesame

Hi everyone,
I'm creating a numerical Stroop task in Open Sesame.
In this task, participants have to select the numerically larger number without taking into account the physical size of the numbers.
For example, in the incongruent condition you can have a big "2" and a little "6", and you have to select the 6.

So, in a sketchpad, I wrote [nb1] and [nb2] to display my numbers. In the script, at "font size", I wrote [size_nb1] and [size_nb2] for each number.

The experiment starts well, I get my big and little numbers. My problem is I can't finish the experimental block because, at some point (randomly), the program crashes and I get the following error message :

The experiment did not finish normally for the following reason: font_size should be numeric (float or int), not

Details
item-stack: experiment[run].block_1[run].experimental_sequence_1[run].expe_loop_1[run].trial_sequence_1[prepare].target[prepare]

Do you know what I can do to fix this ?

Thanks for your help

Thomas

Comments

  • Hi Thomas,

    Apparently, one of your font_size values is not a numerical value. Best check your list carefully; maybe there's a value here with a comma instead of a point? (e.g. 13,5 instead of 13.5)

    Cheers

    Josh

  • And you didn't copy the error message completely. Based on the continuation of that error message we would know what the value of font_size was. Could have been a list as well..

    Cheers

  • @sebastiaan I just tried to work out this problem with Thomas, but there seems to be a more serious bug underlying this. Since the canvas.text() command doesn't come with a size argument, one has to set the font size manually, for example with canvas.set_font(), or in the script of a sketchpad with the parameter font_size. I tried both, but the experiment simply ends at a random point with the incomplete error report "font_size should be numeric (float or int), not".

    When using a sketchpad, there will already be the following warning (before running the experiment): "Font size '[specific_trial_value]' is invalid or variably defined, using 18". When running the experiment, it doesn't use size 18; it actually does use the specific_trial_value - until it crashes.

    Any idea how to solve this?

    Cheers

    Joshua

  • Hi,
    Since that I could'nt manage to get my experiment run by displaying text, I choose to try a different way to do things.
    So now I use the same approach as in the gaze cuing tutorial. I'm still using a sketchap, but now I use images​ instead of text.

    I created a variable "[scale_OP]", which can be "1.0" or "0.6".
    The script in my sketchpad is :
    set duration 0
    set description "Displays stimuli"
    draw image center=1 file="OP_[OP1].png" scale="[scale_OP1]" show_if=always x=-64 y=0 z_index=0
    draw image center=1 file="OP_[OP2].png" scale="[scale_OP2]" show_if=always x=64 y=0 z_index=0

    Nevertheless, I still have an error message, randomly during the experiment.
    I get this error message :

    Stopped
    The experiment did not finish normally for the following reason:

    Unexpected error
    Details

    item-stack: experiment[run].block_2[run].experiment_sequence_2[run].expe_block_2[run].trial_sequence_2[prepare].target[prepare]
    exception message: The picture file 'OP_.png' does not exist
    time: Wed Sep 14 16:26:00 2016
    exception type: IOError

    Do you have an idea of what can be wrong here ?

    Again, thanks for your help,

  • Hi Thomas,

    It seems the variable OP1 or OP2 has no value and so you get this error:

    exception message: The picture file 'OP_.png' does not exist

    Possibly you define this variable OP1 or OP2 in a loop item where there is an empty entry (an empty cell in the loop table)?

    Best,
    Jarik

  • Hi Jarik,
    I verified the variables OP1 and OP2 and there is no empty cells in the loop table.
    Moreover, the problems appears randomly during the experiment (e.g., after 9 items; after 42 items), and not specifically at some point.
    I tried to change the values from "2" to "2.0" but the problem remains.
    Best,
    Thomas

  • Could you upload your experiment? Maybe I can take a quick look.

    Best,
    Jarik

  • Hi Thomas,

    What a smart way to send your experiment via a private message and thanks for the approval to share the solution publicly here so others can benefit.

    The thing is the last cycle (or row) 130 is completely empty and the Order is set to random so this explains the error and the random behavior. I guess you want to set the number of Cycles to 129

    Best,
    Jarik

  • @sebastiaan I just tried to work out this problem with Thomas, but there seems to be a more serious bug underlying this. Since the canvas.text() command doesn't come with a size argument, one has to set the font size manually, for example with canvas.set_font(), or in the script of a sketchpad with the parameter font_size. I tried both, but the experiment simply ends at a random point with the incomplete error report "font_size should be numeric (float or int), not".

    This conversation slipped under the radar for me. Just to chip in on this one comment: There actually is a style keyword font_size, but it's missing from the documentation. But the following should work (untested, typing from my tablet):

    c = canvas()
    c.text('some text', font_size=10)
    c.show()
    

    In any case, I'll take a look at what's going on, and whether there's indeed a bug.

  • Hi guys,

    I cannot find any bug in specifying variable font sizes, neither in an inline_script nor in a sketchpad. So the problem is likely something else, such as (as the error message also says, and as Jarik's screenshot suggests) that you've specified an empty value.

    That being said, I did spot one minor bug while looking into this: When specifying a variable font size in a sketchpad and then editing the text, the font size is reset to a default (non-variable) value. But that's not the cause of the issue here.

    Cheers,
    Sebastiaan

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