Confidence rating/likert scale
in OpenSesame
Hi,
I'm trying to add in a likert scale to my experiment, to assess the participant's confidence in their performance. I've attempted to use this page http://osdoc.cogsci.nl/3.1/manual/forms/widgets/rating_scale/ to insert the scale as I would like it, however I don't think I'm understanding it correctly. Simply copying in the example script has given me the scale, however I don't understand how to include or adapt the rest of the coding on the page. I also need the scale to appear every 20 trials, however I don't know how to alter this either. Any suggestions would be greatly appreciated, thanks in advance
Comments
This is the python script I've copied and altered so far:
from libopensesame import widgets
form = widgets.form(exp)
label = widgets.label(form, text='Please rate your confidence in your performance')
rating_scale = widgets.rating_scale(form, nodes=['1', '2', '3', '4', '5', '6', '7'], var='response')
form.set_widget(label, (0,0))
form.set_widget(rating_scale, (0,1))
form._exec()
function rating_scale.init(form, nodes=7, click_accepts='False', orientation=u'horizontal', var='None', def='None')
function rating_scale.draw_frame(rect=None, style=u'normal')
function rating_scale.on_mouse_click(pos)
function rating_scale.render()
function rating_scale.set_rect(rect)
function rating_scale.set_value(val)
function rating_scale.set_var(val, var=None)
At the moment the experiment is crashing due to invalid syntax in the 'function rating_scale.init' line. I have altered this line, however it was not working to start off with, and I don't seem to be understanding the Rating_scale functions page, or how(/if) to change the coding for what I need
Hi,
Opensesame keeps track of the current trial with its
count_<item_label>variables. You can also define your own variable in the loop table or in aninline_script. The idea is then, to put in theshow_iffield of the form (accessible when clicking on the trial_sequence in the overview area), something like[trial_no]%20==0. This translates to: if the rest of the division of current trial number and 20 is 0, execute this item.If your entire form is defined inline, you can also do something like:
which is basically the exact same thing.
In your previous post the first block is python code and will be executed just fine. The second block (starting from the line that throws the error), is not python code.It actually is only part of the website layout describing the functionality of a rating scale. So delete it from your script, and work with the python code that you have.
Good luck,
Eduard