Howdy, Stranger!

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

Supported by

acc variable not calculated

Hello all,

I have just transferred an experiment from a PC running win 7 with a PST SR box via the serial port to a laptop running win 10 with the PST box running through a serial to usb converter.

The experiment worked fine on the PC but now does not calculate acc on the laptop.  The buttons on the box works. Further, the variable inspector shows that the responses are being collected (i.e. response_SRBOX_trials) and avg_rt is calculated and updated on every trial.  However, the acc variable is always 0 and the correct variable is also always 0. 

I am at a loss. 

I had to upgrade the opensesame version to 3.2 (Kafkaesque Koffka) for the PC.  Further, the dummy mode on the SRBOX plugin doesn't work, If you tick the box for dummy mode than the experiment crashes and the error window says that the srbox could not be detected.


Any help would be gratefully accepted.

Deiniol 

Comments

  • edited June 2019

    Update,


    I still can't get this to work. Keyboard inputs work fine and ACC and correct variables are calculated but still no luck with the SR box.


    I also get an error when running the SRbox in dummy mode (see below). Don't know if this has anything to do with the ACC not being calculated when srbox is run in 'normal' Mode.


    Help!


    Unexpected error
    item-stack: experiment[run].experimental_block[run].block_sequence_exp_[run].exp_block_loop[run].trial_sequence[run].SRBOX_trials[run]
    exception type: AttributeError
    exception message: srbox not found
    time: Fri Jun 07 11:25:57 2019
    Traceback:
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\misc\process.py", line 157, in run
       exp.run()
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\experiment.py", line 456, in run
       self.items.execute(self.var.start)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
       self.run(name)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
       self[name].run()
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
       self.experiment.items.run(_item)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
       self[name].run()
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\loop.py", line 359, in run
       self.experiment.items.execute(self._item)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
       self.run(name)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
       self[name].run()
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
       self.experiment.items.run(_item)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
       self[name].run()
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\loop.py", line 359, in run
       self.experiment.items.execute(self._item)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 103, in execute
       self.run(name)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
       self[name].run()
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\sequence.py", line 51, in run
       self.experiment.items.run(_item)
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item_store.py", line 122, in run
       self[name].run()
     File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\srbox\srbox.py", line 115, in run
       self.experiment.srbox.start()
     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\item.py", line 237, in __getattr__
       raise AttributeError(u'%s not found' % var)
    AttributeError: srbox not found
    
  • edited June 2019

    I've managed to get it working by using an inline script right after the srbox item (see below).

    Acc and correct are now calculated but total_correct still doesn't work (I can live with that).


    Would be nice to know what went wrong in the first place and why the ACC and correct variables were not calculated without the inline script.


    Deiniol



    # check if the response is the same as correct response 1
    if self.get("response") == self.get("correct_response"):
     exp.set("correct", 1)
    # if the response is not one of the correct responses, set correct to 0
    else:
     exp.set("correct", 0)
    # increase the total amount of responses by one
    self.experiment.total_responses += 1
    # if the response was correct, increase the amount of correct responses by one
    if self.get("correct") == 1:
     self.experiment.total_correct += 1
    # calculate the accuracy
    self.experiment.acc = 100.0 * self.experiment.total_correct / self.experiment.total_responses
    # save the accuracy under the two variables OpenSesame saves it to
    exp.set("acc", self.experiment.acc)
    exp.set("accuracy", self.experiment.acc)
    


  • Hi Deiniol,

    There were indeed two issues with the SRBox plugin, and you ran into both: dummy mode was broken, and the correctness of the responses was not correctly set. Both of these should be fixed in the upcoming maintenance release (3.2.8). Could you try the latest prerelease of 3.2.8 and let us know whether this fixes these issues for you?

    Cheers!

    Sebastiaan

    (@pdias: This is also what you ran into, I think.)

  • Hi Sebastiaan,


    Many thanks for your help. Yes, the pre release version fixed the problems with the srbox and correct variables. However, I have another problem. I have 500 experimental trials set to run sequentially. Repeat is set to "each cycle 1.00x" . However, the block of trials is presented twice (i.e. 1000) trials.

    I did experiment with deleting the practice block (which loops until the participant has achieved 70% accuracy) and the 500 experimental trials are only presented once. However, with the practice block included the 500 experimental trials are presented twice.

    I am at a loss and would appreciate any guidance.

    I have attached the file.

    Many thanks

    Deiniol


  • Hi Deiniol,

    the problem is that you call the experimental loop twice. Once, in the inline_script in which you restart the practice loop if necessary, and once Opensesame does it for you, just because the experimental sequence is in the list of items to run. Two alternatives: 1) remove the else statement in that inline_script (checkAcc), or set the run if field of experimental sequence to 'Never'

    Eduard

    Buy Me A Coffee

  • Eduard,

    Fantastic. Thank you very much.

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