acc variable not calculated

I have just transferred an experiment from a PC running win 7 with a PST SR box via the serial port to a laptop running win 10 with the PST box running through a serial to usb converter.

The experiment worked fine on the PC but now does not calculate acc on the laptop. The buttons on the box works. Further, the variable inspector shows that the responses are being collected (i.e. response_SRBOX_trials) and avg_rt is calculated and updated on every trial. However, the acc variable is always 0 and the correct variable is also always 0.

I am at a loss.

I had to upgrade the opensesame version to 3.2 (Kafkaesque Koffka) for the PC. Further, the dummy mode on the SRBOX plugin doesn't work, If you tick the box for dummy mode than the experiment crashes and the error window says that the srbox could not be detected.

I've managed to get it working by using an inline script right after the srbox item (see below).

Acc and correct are now calculated but total_correct still doesn't work (I can live with that).

Would be nice to know what went wrong in the first place and why the ACC and correct variables were not calculated without the inline script.

Deiniol

# check if the response is the same as correct response 1
if self.get("response") == self.get("correct_response"):
exp.set("correct", 1)
# if the response is not one of the correct responses, set correct to 0
else:
exp.set("correct", 0)
# increase the total amount of responses by one
self.experiment.total_responses += 1
# if the response was correct, increase the amount of correct responses by one
if self.get("correct") == 1:
self.experiment.total_correct += 1
# calculate the accuracy
self.experiment.acc = 100.0 * self.experiment.total_correct / self.experiment.total_responses
# save the accuracy under the two variables OpenSesame saves it to
exp.set("acc", self.experiment.acc)
exp.set("accuracy", self.experiment.acc)

There were indeed two issues with the SRBox plugin, and you ran into both: dummy mode was broken, and the correctness of the responses was not correctly set. Both of these should be fixed in the upcoming maintenance release (3.2.8). Could you try the latest prerelease of 3.2.8 and let us know whether this fixes these issues for you?

Many thanks for your help. Yes, the pre release version fixed the problems with the srbox and correct variables. However, I have another problem. I have 500 experimental trials set to run sequentially. Repeat is set to "each cycle 1.00x" . However, the block of trials is presented twice (i.e. 1000) trials.

I did experiment with deleting the practice block (which loops until the participant has achieved 70% accuracy) and the 500 experimental trials are only presented once. However, with the practice block included the 500 experimental trials are presented twice.

the problem is that you call the experimental loop twice. Once, in the inline_script in which you restart the practice loop if necessary, and once Opensesame does it for you, just because the experimental sequence is in the list of items to run. Two alternatives: 1) remove the else statement in that inline_script (checkAcc), or set the run if field of experimental sequence to 'Never'