Howdy, Stranger!

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

Supported by

[solved] Rating_scale widget showing tickmarks

edited November 2015 in OpenSesame

Dear all,

this is my first post of this kind, so please excuse any mistakes or imprecise descriptions of the problem etc.

I have a problem using the Rating_scale widget in a custom form using python inline scripting.
this is the code for the whole form:

# Creating form
# Margins are defined as "top;right;bottom;left". Each value corresponds to a
# margin in pixels.
form = widgets.form(self.experiment, cols=[1,1,1,1,1,1], rows=[6,1,1,1],
               margins=(20, 70, 20, 50), spacing=3)

# Creating widgets
face = widgets.image(form, path=self.experiment.get_file(self.get('pic')))
criterion = widgets.label(form, text = self.get('criterion'))
garnicht = widgets.label(form, text = 'gar nicht '+ self.get('criterion'), center = False)
extrem = widgets.label(form, text = 'extrem ' + self.get('criterion'), center = False)
ratingscale = widgets.rating_scale(form, nodes=['1', '2', '3', '4', '5', '6', '7', '8', '9 '], var = 'response', click_accepts=True)


# Adding widgets to form
form.set_widget(face, (0,0), colspan=6)
form.set_widget(criterion, (2,1), colspan = 2)
form.set_widget(garnicht, (0,2), colspan =1)
form.set_widget(extrem, (5,2), colspan=1)
form.set_widget(ratingscale, (0,3), colspan= 6)

# Executing form
form._exec()

i.e. there is an image file from a list of images 'pic' which needs to be rated according to the criterion 'criterion' on a scale from 1 to 9.

It works well, but I still need the following properties for the experiment which I don't know how to implement:

1) after clicking on one of the boxes, a tickmark should appear and 1000 ms later the form Closes

2) if no response is given, the form closes after 5000 ms

If I use the code as posted, I can implement "2)" using a sort of delay script. The main problem in that case is not seeing a tickmark and closing the form with a set delay after the subject has decided. I only have a tickmark appearing if I choose the option click_accepts =False in my Rating_scale widget, but this leads the form to not close of course.
I know that I could use an additional button to address the tickmark issue, but I would really like to avoid that, since there will be a lot of ratings to be given.

I hope the problem is clear and thank you in advance for any tipps.!:)

Comments

  • edited 11:45AM

    Hi Anne,

    Never having worked with forms myself, I tried to find out if there was anything to regulate timing-related things like these, but I'm not sure yet. @Sebastiaan, do you have an answer here?

    If not, we would have to work with inline_scripts instead - but let's await Sebastiaan's answer first!

    Cheers,

    Josh

  • edited 11:45AM

    Hi Anne,

    This doesn't sound to hard.

    after clicking on one of the boxes, a tickmark should appear and 1000 ms later the form Closes

    The tickmark is not shown in your case, because the form is immediately closed when the participant ticks a box. However, if you add a 1000 ms delay after the form, you should see the tickbox appearing.

    if no response is given, the form closes after 5000 ms

    This is only possible with OpenSesame 3.0, which is currently in testing. If you feel adventurous, you can download a pre-release of 3.0.0, and use the new timeout keyword. The documentation is not updated to reflect this yet, but you can pass a timeout keyword to widgets.form, like so:

    form = widgets.form(self.experiment, cols=[1,1,1,1,1,1], rows=[6,1,1,1],
                   margins=(20, 70, 20, 50), spacing=3, timeout=5000)
    

    See also:

    Cheers!
    Sebastiaan

  • edited 11:45AM

    Dear Sebastiaan and Josh,

    so sorry for not replying any earlier. I never got notified again that anyone replied so I thought my question was somehow lost.

    Thank you for your replies. I tried using version 3.0 but none of my experiments run and I get heaps of Errors I didn't get before. :(

    I found a solution which involves cheating and I guess is not very elegant. It does the trick, though. It completely relies on inline-scripting. Maybe it can still be of use to anyone even though it is not very pretty.

    The general idea is to only render the form, then getting the position of the mouse click, then rendering a form of the same built but this time with a default that corresponds to the value that was clicked. It works well, but of course it is a bit of a pain to get the x and y position of each box.

    I hope the dropbox link works:
    https://www.dropbox.com/sh/92vj64zmajcejrp/AAAf9fV8bIkeJtkF1pQmXC1ha?dl=0

    I hope it helps someone!

  • edited 11:45AM

    Hi Anne,

    Great that you worked out a solution; and yes, I would've gone for inline_scripts as well. Although coding may be a pain in the behind at times, in the end it grants you nearly endless freedom!

    Cheers,

    Josh

  • edited 11:45AM

    Hey Josh,

    yes, it's pretty rewarding. Hope to gradually transit to nearly only coding. It's a rocky road ;)
    Let me know if you have a more elegant solution than the one I uploaded.

    Best,
    Anne

  • edited 11:45AM

    Hi Anne,

    Could you try the latest 3.0.2 prerelease to see if you can run your experiment? There was a problem with non-ascii characters in forms, but it should be resolved now:

    The goal is to have OpenSesame 3.0 run old experiments without any problem, but there are still some kinks to be worked out. You could help by posting a detailed description of any problems that you run into when running old experiments (i.e. things that worked before but don't work anymore).

    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