Howdy, Stranger!

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

Supported by

"Python Crushed"

edited October 2023 in OSWeb

Hello everyone,


Since I added the code below to my experiment, I've been getting the "python crushed" error. What do you think could be the reason? I would appreciate your help.


Best regards,


-------

numbers.show()

my_keyboard = Keyboard(keylist=['1', '2','3','4','5','6'],timeout= 2000)

var.start_time1 = clock.time()

key, endtime = my_keyboard.get_key()

var.response1 = key

var.end_time1 = endtime

var.RT1 = var.end_time1 - var.start_time1

if var.response1==var.correct_response1:

var.correct1 = 1

else:

var.correct1 = 0


var.img2 = img2

var.img3 = img3

var.img4 = img4

var.img5 = img5

var.img6 = img6

if var.presented_pic1 == var.img1 and var.correct1 == 1:

var.total_Hneutralcorrect += 1


if var.presented_pic2 == var.img1 and var.correct2 == 1:

var.total_Hneutralcorrect += 1


if var.presented_pic3 == var.img1 and var.correct3 == 1:

var.total_Hneutralcorrect += 1


while var.count_fixation < 6:

if var.presented_pic1 in [img2,img3, img4, img5, img6] and var.correct1 == 1:

var.total_Hhighcorrect += 1


while var.count_fixation < 6:

if var.presented_pic2 in [img2,img3, img4, img5, img6] and var.correct2 == 1:

var.total_Hhighcorrect += 1


while var.count_fixation < 6:

if var.presented_pic3 in [img2,img3, img4, img5, img6] and var.correct3 == 1:

var.total_Hhighcorrect += 1

Comments

  • Hi @bssengul

    This looks like Python code. Python does not work in osweb, you need to use javascript. See here for more details:

    Hope this helps,

    Eduard

    Buy Me A Coffee

  • Ah sorry, I made a mistake. I do not use OSweb. It's an offline study.

  • Can you share your experiment in that case? I don't see any obvious problem with your code.

    Eduard

    Buy Me A Coffee

  • edited October 2023

    Sure,


    I have changed code a little bit. Now I do not have python crushed error but I obviously have troubles about my results. It does not count correct "total corrects" in log file.

    Here is the link for experiment: The code I mentioned is in numbers_1_1



  • Hello again, I have changed code. Code is working but do not calculate corrects very well again.


    #total_Hhneutralcorrect= High load- neutral pics with high arousal

    #total_Hhighcorrect= High load'da- high pics

    #total_Hlneutral_correct - high load- neutral pics with low arousal

    pics= [var.img2, var.img3, var.img4, var.img5, var.img6]

    if var.count_fixation < 6:

    if var.presented_pic1 == var.img1 and var.correct1 == 1:

    var.total_Hhneutralcorrect += 1


    elif var.presented_pic2 == var.img1 and var.correct2 == 1:

    var.total_Hhneutralcorrect += 1


    elif var.presented_pic3 == var.img1 and var.correct3 == 1:

    var.total_Hhneutralcorrect += 1



    elif (var.presented_pic1 in pics)==True and var.correct1 == 1:

    var.total_Hhighcorrect += 1


    elif (var.presented_pic2 in pics)==True and var.correct2 == 1:

    var.total_Hhighcorrect += 1


    elif (var.presented_pic3 in pics)==True and var.correct3 == 1:

    var.total_Hhighcorrect += 1




    if var.count_fixation > 5:

    if var.presented_pic1 == var.img1 and var.correct1 == 1:

    var.total_Hlneutralcorrect += 1


    elif var.presented_pic2 == var.img1 and var.correct2 == 1:

    var.total_Hlneutralcorrect += 1


    elif var.presented_pic3 == var.img1 and var.correct3 == 1:

    var.total_Hlneutralcorrect += 1


    elif (var.presented_pic1 in pics)==True and var.correct1 == 1:

    var.total_Hlowcorrect += 1


    elif (var.presented_pic2 in pics)==True and var.correct2 == 1:

    var.total_Hlowcorrect += 1


    elif (var.presented_pic3 in pics)==True and var.correct3 == 1:

    var.total_Hlowcorrect += 1


    https://drive.google.com/file/d/1i1M9fP23PjSipQlaxUjK4IR9KYLgZMCi/view?usp=sharing

  • H @bssengul ,

    Happy to hear that you almost figured out your experiment. Unfortunately, your experiment is quite confusing to me. You say that the accuracy is not calculated corrected, but you don't say what is actually measured, what correct means, what participants are supposed to do, and what actually does happen now. Based on your code, I can't tell. So if you still need help, I need some explanation on your design, and the questions I just mentioned.

    Thanks,

    Eduard

    Buy Me A Coffee

  • I am so sorry about that. I still could not figured it out.

    In the experiment, participants see 6 photographs in one condition. These photos are assigned to variables such as "var.img1", "var.img2". "var.img1" photos are always neutral photos. However, "var.img2,var.img3...var.img6" are high arousal photos in the first 6 photo sets, and low arousal photos in the next 6 photo sets. After viewing a photo set, participants are asked about the "location" of the three photos they saw in that photo set, respectively, on the screen they just saw. Participants choose the location of the photo in the photo set from the numbers in the rectangles they see on the screen. When the answer is correct, for example for the first question, the variable "var.correct1" is incremented by 1. "var.correct2" is incremented when the second question is true.


     "var.total_Hhneutralcorrect += 1" tries to calculate the total correctness of neutral photos presented with high arousal photos.

    "var.total_Hlneutralcorrect += 1" tries to calculate the total correctness of neutral photos presented with low arousal photos. While the total values of these variables are correct, the variables that try to get the total values of low arousal photos (var.total_Hlowcorrect += 1) and high arousal photos (var.total_Hhighcorrect += 1) do not calculate correctly.

    It's been long, I know, I apologize. But still, I hope I was able to explain myself.


    Best regards,

  • Thanks, it is a bit clearer now. However, your experiment is still quite cryptic to me. I can't see the logic clearly, so I would need to take a very deep dive in order to understand. Unfortunately, I don't have the time for this.

    What is actually not working? In which way are the accuracies incorrectly computed?

    Perhaps you can simplify your experiment quite a bit? Such that it is easier to follow the logic, and your problem is still present? Then I might be able to see the problem.

    Eduard

    Buy Me A Coffee

  • There is a variable called "presented_pic1" in experimental_loop. When I open the console and run the experiment, this variable is printed as "neutral_3.jpg", but when I look at the variable in the log file, it is printed as [img1]. I want to get the total correct scores in my work according to photo category. The code I wrote is not getting the total points correctly. I wonder how I should get the contents of the variable? So, like [img1] or neutral_1.jpg? Actually, I tried it both ways in the code, but it still didn't get the total score correctly.

  • edited November 2023

    Hi,

    When I open the console and run the experiment, this variable is printed as "neutral_3.jpg", but when I look at the variable in the log file, it is printed as [img1].

    Not 100% sure, but I think this is because what is printed out on the console is in the run phase, or in any case after [img] was filled in, whereas the logger it might still be before that? Could this be it?

    The code I wrote is not getting the total points correctly. I wonder how I should get the contents of the variable? So, like [img1] or neutral_1.jpg?

    As I said before, both your experiment as well as your code is too complicated/confusing to me, in order to give you clear advice. I had a closer look at the script you posted (25.10), and there are a lot of unusual coding things going on, which makes it hard to evaluate what is going on, let alone pointing to the specific problem. Therefore, my advice to you is to strip your experiment as much as possible (remove practice, remove as many trials as possible, etc), such that you end up with a short and slick experiment that I can look at and understand what is happening. If you're lucky, your problem will also evaporate miraculously. But even if it persists, it will become tremendously easier to help you fix it. At the moment, there is nothing I can do here.

    Does this make sense?

    Eduard

    ps, it might also help if you take a step back and explain again, what it is you want to investigate, what your conditions are, what independent and dependent measures are, etc, without getting too much into specific implementation details.

    Buy Me A Coffee

  • Hello, I feel very stuck when it comes to generating ideas on this subject. So thank you so much for your support!

    In fact, the logger was added after the script during the experiment.

    In the experiment I am trying to design, there is a high load and low load condition. All participants receive these conditions. Conditions are differentiated by the number of photographs (4 vs 6). I added the high load condition to the version of the experiment that I downloaded now. practice etc. I removed the steps. In the experiment, participants see photographs and try to remember the locations of three of these photographs. Correct answers are recorded in var.correct1, var.correct2, var.correct3 variables. The photographs consist of 5 high arousal and 1 neutral photograph in the first 6 attempts, and 5 low arousal and 1 neutral photograph in the last 6 trials. For this reason, in the first 6 trials (I count them with count_fixation), I try to save the corrects about the high arousal photographs whose location is asked in the total_Hhighcorrect variable. I am also trying to collect neutral photo corrects in the total_Hhneutralcorrect variable. I can also answer other questions about experiment.


    https://drive.google.com/file/d/1M40Qphjwk53ifFutfjqM3unAoDvAmVg4/view?usp=sharing



    Best regards,

    Beril

  • Hi Beril,

    Thanks, much clearer now.

    I think the problem was caused by not aligning the correct response in prep2 and the target image. Essentially this made the correct response assignment arbitrary.

    I adapted your experiment as much as possible, it does work now, but I am not sure whether it works in the exact way that you intend to. I changed quite a few things, also things that did worked, because it helped me understanding what was happening. In the end, the structure is a bit different that what you had, but as far as I can see, it works now. Probably not the most elegant solution, but working.

    Hope that helps,

    Eduard

    Buy Me A Coffee

  • ( uploading doesn;t work at the moment)

    Buy Me A Coffee

  • Thank you so much! I guess this time it works but I could not compare participant's response and correct response. Where are the numbers of the correct location of the photo kept in this script? I thought it was corr_pos at first, but the answers are not compatible with it.


    I appreciate your help,

    Best regards,

    Beril

  • Hi beril,

    Why do you want to compare them? The code does that already.

    For example for the first image:

    if var.response1 == int(var.corr_resp.split('.')[0]):
        var.correct1 = 1
    else:
        var.correct1 = 0 
    

    The response participants are giving is in var.response1 (or 2 or 3), and the correct response is stored in var.corr_resp. However, because this variable is coding the image name (e.g. 1.png), while the response is just a number, you need to process the correct response, by splitting the file name at the dot (changing "1.png" into ["1", "png"]), then selecting the first item ("1") and finally converting the string to an integer. Then the two variables can be compared.

    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