@@ -11,33 +11,35 @@ def make_trials(config):
1111 for mm in temp_moods :
1212 trial = dict (
1313 inst = f"How { mm ['mood' ]} are you at this moment?\n Press F to move left, Press J to move right." ,
14- mood = mm ['mood' ],
15- notmood = mm ['notmood' ]
14+ mood = mm ['mood' ]. title () ,
15+ notmood = mm ['notmood' ]. title ()
1616 )
1717 trials .append (trial )
1818 return trials
1919
2020@Subroutine
2121def HappyQuest (self , task , block_num , trial_num , config = default_happy_config ):
22- gen = Func (
23- make_trials ,
24- config
25- )
26- trials = gen .result
22+ # gen = Func(
23+ # make_trials,
24+ # config
25+ # )
26+ # trials = gen.result
27+
28+ trials = make_trials (config )
2729
2830 with UntilDone ():
2931
3032 with Loop (trials ) as trial :
3133 Wait (0.3 )
3234 with Parallel ():
33- Label (text = Ref ( trial .current ['inst' ]) ,
35+ Label (text = trial .current ['inst' ],
3436 font_size = s (config .HAPPY_FONT_SIZE ),
3537 halign = 'center' ,
3638 center_y = self .exp .screen .center_y + s (300 ))
3739 sld = Slider (min = - 10 , max = 10 , value = 0 , width = s (config .SLIDER_WIDTH ))
38- Label (text = Ref ( trial .current ['notmood' ]) , font_size = s (config .HAPPY_FONT_SIZE ),
40+ Label (text = trial .current ['notmood' ], font_size = s (config .HAPPY_FONT_SIZE ),
3941 center_x = sld .left , center_y = sld .center_y - s (100 ))
40- Label (text = Ref ( trial .current ['mood' ]) , font_size = s (config .HAPPY_FONT_SIZE ),
42+ Label (text = trial .current ['mood' ], font_size = s (config .HAPPY_FONT_SIZE ),
4143 center_x = sld .right , center_y = sld .center_y - s (100 ))
4244 Label (text = 'Press Spacebar to lock-in your response.' ,
4345 top = sld .bottom - s (250 ), font_size = s (config .HAPPY_FONT_SIZE ))
@@ -74,7 +76,7 @@ def HappyQuest(self, task, block_num, trial_num, config=default_happy_config):
7476 submit = KeyPress (keys = ['SPACEBAR' ])
7577 Log (name = "happy" ,
7678 task = task ,
77- mood = Ref ( trial .current ['mood' ]) ,
79+ mood = trial .current ['mood' ],
7880 block_num = block_num ,
7981 trial_num = trial_num ,
8082 slider_appear = sld .appear_time ,
@@ -86,8 +88,9 @@ def HappyQuest(self, task, block_num, trial_num, config=default_happy_config):
8688if __name__ == "__main__" :
8789 import config
8890
89- exp = Experiment (debug = True )
91+ exp = Experiment ()
9092
91- HappyQuest (config , 'test' , 0 )
93+ HappyQuest (task = 'test' , block_num = 0 , trial_num = 0 )
94+ HappyQuest (task = 'test' , block_num = 0 , trial_num = 1 )
9295
9396 exp .run ()
0 commit comments