Howdy, Stranger!

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

Supported by

multiple choice form: recording category for numerous response options?

Perhaps this is a simple problem, but I cannot find a solution in the manual.


Background: I have a multiple choice form with five possible responses, and importantly, the responses change for each trial. For the five possible responses, two of the responses represent one category (e.g., "1a", "1b" below), two of the responses represent a second category (e.g., "2a", "2b" below), and one of the responses is a distractor (e.g., "dist" below).

__options__

[1a]

[1b]

[2a]

[2b]

[dist]

__end__


For the sake of example, category 1 presents words for fruit, category 2 presents words for meat, and distractor is a drink. So for trial one, this might be:

[1a]   = apple

[1b]   = pear

[2a]   = sausage

[2b]   = steak

[dist]   = wine

For trial two, the response options change (e.g., 1a = orange, 1b = grapefruit, 2a = prosciutto, etc.). And so on for each trial.


Issue: The response that is logged is the word that is presented: if a participant responds by selecting the variable [1a] for trial one, the recorded response ("form_response" in the csv file) is "apple" ... not "1a". Ideally, since 1a/1b, etc., represent a category across all trials, I would also like to have the category logged (e.g., "fruit").


Question: How would I go about recording both the word and the category?


Running: OpenSesame 3.3.3 Lentiform Loewenfeld on Linux Mint 19.3 "Tricia".

Comments

  • Dear @jdg ,


    Thank you for formulating your question so clearly!

    One quick-and-dirty solution that I came up with, is to:

    • Append an inline_script item after your form_multiple_choice item
    • Use some some Python code to compare the current response to the corresponding category (assuming that you defined the different categories as separate variables earlier in your experiment, for example in the block_loop item):
    # Compare the response variable to the category values:
    if var.response == var._1a:
        var.category = "1a"
    elif var.response == var._1b:
        var.category = "1b"
    elif var.response == var._2a:
        var.category = "2a"
    elif var.response == var._2b:
        var.category = "2b"
    elif var.response == var.dist:
        var.category = "dist"
    

    I attached an example experiment.


    Hope this helps!


    Cheers,

    Lotje


    Did you like my answer? Feel free to Buy Me A Coffee :)

  • @lvanderlinden Thank you very much for the quick response and my apologies for the slow follow-up!

    Your solution worked, but with one problem: in my experiment the response options are shuffled and thus the response category does not end up matching the category defined in the block_loop item. I have attached a modified version of your script to illustrate the issue. The only change from your script is that in the block_loop I have added the following:

    shuffle_horiz _1a _1b _2a _2b dist

    Any help solving this would be greatly appreciated. I will respond in a more timely fashion now that I am back to my regular work hours.

    Cheers!


Sign In or Register to comment.