Howdy, Stranger!

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

Supported by

Absent workerID

Hello developers,

I noticed that the workerID variable is no longer included in the results on Jatos. Over on the Jatos forum Kristian suggested that this is not a Jatos issue but an OSweb one. Perhaps it was intentional, but it seems unhelpful to me. The workerID was a very simple way of separating different participants from each other. Could you bring it back please? Or am I missing something?

Cheers,

Jasper

Comments

  • Hi @Jasper,

    The workerId is now added in a separate data structure called 'context'. If you look at the data for a single participant, you can see that it has the following (json) structure:

    {
       data: [ /* OpenSesame trial data */ ],
       context: { /* Jatos specific data */ }
    }
    

    Sadly the function inside opensesame that converts Jatos data to a tabular format (excel or csv) doesn't take this context section in to account yet. That being said, the data stored in Jatos should now be valid json, so you could for instance use this script to easily extract Opensesame's data and the context data:

    import json
    import pandas as pd
    
    # Read jatos data and convert it to json
    with open('jatos_results_20200514114136.txt') as fp:
        jsonData = json.load(fp)
    
    # Convert opensesame data and context data to dataframes
    os_data = pd.DataFrame(jsonData['data'])
    
    # Save to excel (or csv)
    os_data.to_excel('os_data.xlsx') # or user .to_csv()
    with open('context.json') as fp:
       json.dump(jsonData['data'], fp)
    

    Buy Me A Coffee

  • Thanks for your reply!

  • I forgot to add the modes to open() calls, which should be "r" for the first and "w+" for the second

    Buy Me A Coffee

Sign In or Register to comment.