Howdy, Stranger!

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

Supported by

Creating a new variable to display during feedback

Hello!

I have a question regarding creating a new variable that I can display during the feedback item at the end of a block.

About the experiment: This is a mate budgeting experiment. So participants are shown 10 traits (as form_base items) that people might prefer in potential partners. At the end of each form_base item I've created a trait_score (this is named differently for each of the 10 traits) variable. The experiment is counterbalanced between 3 blocks: low, medium and high budget with a set 'total score' that can be reached. When a new form_base item begins, I want to be able to show the remaining 'total_score' as a sort of countdown


i.e. if 'total_score' for a budget = 20, & someone selects a trait for 8 then the remaining score on the next form_base item should be shown as 20-8 = 12.

I also want to be able to show the 'total_score' at the final feedback item with individual trait_score(s)

I am quite new to opensesame and python in general so I couldn't wrap my mind around if I could simply create this variable as part of form_base or if I'd need a whole new inline_script. Please help out!

Comments

  • Hi,

    Yes, in general terms you need an inline_script for this.

    if 'total_score' for a budget = 20, & someone selects a trait for 8 then the remaining score on the next form_base item should be shown as 20-8 = 12.

    You would do this with something like the following code in the Run phase of an inline_script :

    var.total_score = var.total_score - var.trait_score
    

    Of course the details depend on what you want to do exactly. But it seems that you mainly want to do basic arithmetic, and that should be fairly straightforward.

    Cheers!

    Sebastiaan

Sign In or Register to comment.