incorrect acc %
Hi, help I have a problem with the correct calculation of the accuracy.
My experiment has 3 difficulty levels per span length (span 2, span 3 and span 4). Each level has 1 practice_loop (with 10 trials) and 1 experimental_loop (with 20 trials).
Every trial consists of 2, or 3 or 4 target numbers 1 to 9 (each in a cell) and 4 or 5 mathematical operations (-2 to + 2 except 0). The subject must apply the operations presented in the cells and continuously update the information in each cell. After the 4 or 5 operations the subject has to type the final results respectively in each cell and in the right cell (both the intermediate results and the final results range from 1 to 9). In 5 trials there are 4 operations and in other 5 trials there are 5 operations. I designed my loop tables in Excel, directly using the files as input.
This is the first block (practice span 2):
Before each block I inserted an inline script (prepare) (this is for practice span 2):
At the end of this practice_loop_span_2 I get 25% accuracy. At the end of the experimental_loop_span_2 acc 75 %, practice_loop_span_3 acc 112,5 %, experimental_loop_span_3 acc 187,5 %, practice_loop_span_4 acc 237,5 %, experimental_loop_span_4 acc 315 %.
Help me please,
I can't really tell how your task runs and what you're trying to do with the left and right responses. The code you included seems odd at first sight (there doesn't seem to be any condition to be met for a response to be correct). In any case, my advice is to write to console the key variables you're using at various stages of the trial, so that you can track when values deviate from what their actual values should be. Doing so, you should be able to identify where the problem(s) come from. You need to do a bit of detective work here to pinpoint what is going on (there must be some error in the way to calculate scores or some failure to reset scores at the appropriate times).
I constructed the responses so that when the subject types the final results of the operations, they appear on the screen. Each block works well and calculates the right accuracy if taken by itself, without the other blocks, so I believe the inline scripts are correct. The problem of accuracy arises with the whole task: I would like each block to calculate accuracy individually. I think the problem is the continuation between one block and another, because that's where accuracy doesn't work well. It is as if OpenSesame did not understand that a block on which to calculate the acc % has finished (for example at the end of the practice loop span 2) and another one to start again (experimental loop span 2) on which to start calculating a new acc %.
I am very inexperienced with opensesame, can you help me? I share the task, maybe it is clearer.
Hi both of you,
I don't have time at the moment to look into the problem here, but just as a reminder, @neuropsy, please don't open multiple discussions about the same issue. This causes clutter and makes our life to help users somewhat harder.
For reference, the issue started in: https://forum.cogsci.nl/discussion/7662/help-acc-undefined#latest
Sorry I did not want to create disorder, indeed thanks for giving me help. I hope you can help me again.
I had a quick look at your task and spotted a few problems. The first is the high redundancy of objects. I'm not sure why you use different loggers in every block (using multiple loggers can confuse OS and mess up the output). I replaced all loggers by the same linked copy of a unique logger.
There are numerous other objects that need not be copied in numerous unlinked versions. I recommend that wherever you use the same object or code, you use linked copies. This has the advantage that it leaves fewer opportunities for errors (when you have multiple redundant copies of objects or code, modifications need to be implemented in every copy individually, which is more work and can introduce problems if you forget one). There's too much to clean up in your task, so I didn't tidy it up (only the logger, as mentioned earlier, because multiple loggers can mess things up).
One other issue is that in numerous places, you placed the logger before the Python code calculating the score or
ACC. That means that your output will not always have the correct up-to-date information.
I also noticed that you save the left and middle responses to a specific variable but you don't do the same with the right response. While the latter will be contained in the "
var.response" variable, that variable will also exist for the left and middle responses too, so sorting out responses to the different locations may be a little confusing. I'd recommend defining a specific variable for the response for the right response box.
I added some Python code to output some variable values to the console, to track things down as the task ran. I realized that while the number of correct responses appears to be correctly calculated as the task goes, the computation of the
ACCvariable is systematically wrong, and this is due to the fact that your
total_trialsvariable is equal to 80, even for the very first block. And this is when I realized one more thing, which is the origin of the problem here: your "init_paramters" code objects have the code inserted under the "prepare" tab instead of the "Run" tab. This means that the code from all these objects is executed before the ExperimentMUtest sequence. That means that the code of init_parameters_5 is executed before the ExperimentMUtest sequence begins and that it is the last time total_trials is executed. This is why is keeps the value of 80 throughout the task. The fix is this: your code for your
init_parameterobjects has to feature under the "Run" tab, not the "Prepare" tab.
I attach a modified version of your task. Have a look and try it out to see if it all works correctly now (your task is quite long and unfortunately I don't have the time to go through the whole task).
Hope this helps!
it seems to me that the task is working fine now. I used linked copies for many same objects, reducing the number of different objects. The acc% is correct now and the output excel records all responses.
Thank you so much.