Howdy, Stranger!

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

Supported by

Self-Assessment Manikin - SAM

edited December 2019 in OpenSesame

Hi,

I created SAM rating form. It took much time, I benefited from the Forum. Thus I want to share it with you. I hope you can save time thanks to that form.

def kontrol(): 
	return var.ratingscale1 != None and var.ratingscale2 != None and var.ratingscale3 != None and var.ratingscale4 != None and var.ratingscale5 != None and var.ratingscale6 != None and var.ratingscale8 != None and var.ratingscale9 != None
from libopensesame import widgets
pict = self.get("picture")

question1 = Label(text='Mutlu', center=True)
question2 = Label(text='Üzgün', center=True)
question3 = Label(text='Korkmuş', center=True)
question4 = Label(text='Öfkeli', center=True)
question5 = Label(text='Şaşırmış', center=True)
question6 = Label(text='Kızgın', center=True)
question8 = Label(text='Değerlik', center=True)
question9 = Label(text='Uyarılmışlık', center=True)

my_form = Form(validator=kontrol, rows=23, cols=3, margins=(5,20,15,20))

ratingScale1 = RatingScale(nodes=['1','2','3','4','5','6','7'],var="ratingscale1")
ratingScale2 = RatingScale(nodes=['','','','','','',''], var="ratingscale2")
ratingScale3 = RatingScale(nodes=['','','','','','',''], var="ratingscale3")
ratingScale4 = RatingScale(nodes=['','','','','','',''], var="ratingscale4")
ratingScale5 = RatingScale(nodes=['','','','','','',''], var="ratingscale5")
ratingScale6 = RatingScale(nodes=['','','','','','',''], var="ratingscale6")
ratingScale8 = RatingScale(nodes=['','','','','','','','',''],var="ratingscale8")
ratingScale9 = RatingScale(nodes=['','','','','','','','',''], var="ratingscale9")
image = widgets.image(my_form, path=self.experiment.get_file(pict), adjust=True, frame=True)
image1 = ImageWidget(path=pool['SAM-Valance.jpg'], adjust=False, frame=False)
image2 = ImageWidget(path=pool['SAM-Arousal.jpg'], adjust=False, frame=False)
nextButton = Button(text='Next')




my_form.set_widget(image, (0, 0), rowspan=4)
my_form.set_widget(question1, (0, 4))
my_form.set_widget(question2, (0, 5))
my_form.set_widget(question3, (0, 6))
my_form.set_widget(question4, (0, 7))
my_form.set_widget(question5, (0, 8))
my_form.set_widget(question6, (0, 9))
my_form.set_widget(question8, (0, 15))
my_form.set_widget(question9, (0, 20))

my_form.set_widget(ratingScale1, (1, 4), colspan=2)
my_form.set_widget(ratingScale2, (1, 5), colspan=2)
my_form.set_widget(ratingScale3, (1, 6), colspan=2)
my_form.set_widget(ratingScale4, (1, 7), colspan=2)
my_form.set_widget(ratingScale5, (1, 8), colspan=2)
my_form.set_widget(ratingScale6, (1, 9), colspan=2)


my_form.set_widget(image1, (1, 13), colspan=2)
my_form.set_widget(ratingScale8, (1, 15), colspan=2)
my_form.set_widget(image2, (1, 18), colspan=2)
my_form.set_widget(ratingScale9, (1, 20), colspan=2)
my_form.set_widget(nextButton, (2, 21), rowspan=2)
my_form._exec()

Comments

  • Hello @sinem,

    Thank you very much for sharing your code. I'm trying to do something similar and I would like to know what the first 4 lines of your code are for? Are they absolutely necessary?

    Thanks in advance.

  • Hi Gio,

    from libopensesame import widgets
    

    It is probably not necessary anymore to explicitly import widgets. It should automatically be available in the workspace, but best to try it out, and decide based on whether the experiment crashes whether you need it or not (it will crash, if it is necessary)

    pict = self.get("picture")
    

    extracts the variable that is stored as part of exp This is old syntax and also not necessary anymore. You can either use var.picture instead of pict or do something like pict=var.picture

    def kontrol(): 
    	return var.ratingscale1 != None and var.ratingscale2 != None and var.ratingscale3 != None and var.ratingscale4 != None and var.ratingscale5 != None and var.ratingscale6 != None and var.ratingscale8 != None and var.ratingscale9 != None
    

    This defines a validator than can be used to make sure that the form response is valid. See the documentation on validation.

    Hope this helps,

    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