![]() ![]() Does anyone have any experience with this or any ideas? However, this doesn’t seem to be translating over well to the touchscreen as the screen always has to be tapped twice before the programs moves forward. I used Builder to create a click event so that when the mouse is clicked (or in this case, the equivalent event of ‘screen is touched’) the routine ends. The first is that, in order for the program to move forward, the screen has to be tapped twice. I think the code on the response part is: correct = new visual.I’d like participants to be able to touch a button on either side of the screen of a Windows Surface for an on-site IAT test. Thing is I didn’t write the code, I just built the experiment. I have the same problem with the doublé tap. Lastly, note that your code above doesn’t have matching levels of indenting between the if and else clauses. If that is the case, then your check could just be: if correct is True: # NB no quotes on either term here True or False) rather than the strings of characters 'True' or 'False'. It might be possible, for example, that the variable has been interpreted from the conditions file to contain boolean values (i.e. To see what the variable contains and whether it is of the type you expect. ![]() without quotes) so that the comparison is done with the contents of that variable name.Ī useful tip for debugging things like this is to (TEMPORARILY) insert some debugging statements to check the content of your variables. ![]() You need to refer to the variable name correct (i.e. Yes, but as stated above, quoting "correct" guarantees that this code won’t work either: the literal string of characters "correct" will never equal the string of characters "True". I tried this code without putting correct in quotes, but it didn’t work. notice how in your code above, you actually test topLeftImg twice? A key mantra in programming is DRY: don’t repeat yourself, because such code is error-prone and hard to maintain.Īlso note that you don’t need to set continueRoutine = True, as it will remain that way unless set otherwise. Using loops like this allows you to avoid repeating code, which easily allows errors to creep in. ThisExp.addData('clicked_stimulus', stimulus.name) If ntains(mouse) and stimulus.name = corrAns: Can’t resist also suggesting a more concise way of doing the whole thing though: # this list should could just be created once per trial, in the 'begin routine' tab: You can simply add custom data fields to your data file using thisExp.addData(). Hi, you’ve come up with a nice way of getting around the issue of the double click. How do I write this to the file?ĭoes anyone have any guidance on how to achieve this? This component works perfectly (I’ve tried many different things!), but I want it to be shown in the data output what the kid clicked on and I don’t know how to add a column that says which image was clicked on. Just to clarify, there’s a correct answer and I only want the trial to end if the kids click on the correct answer. The only thing I’ve managed to get to work is this code component on every frame: if ntains(mouse) and eval(corrAns) = topLeftImg:Įlif ntains(mouse) and eval(corrAns) = topLeftImg:Įlif ntains(mouse) and eval(corrAns) = topRightImg:Įlif ntains(mouse) and eval(corrAns) = bottomLeftImg:Įlif ntains(mouse) and eval(corrAns) = bottomRightImg: I tried using the clickable stimuli within the mouse components of the Builder, but it required a double tap to register the response which isn’t ideal. I ran into lots of issues because of the multi-touch aspect of my screen. I’ve created a touchscreen task to be used with children where they tab on different stim to give their answer. So I’m using a Windows 10 laptop/tablet hybrid. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |