Millisecond Forums

Converting Inquisit 5 script to run on version 4

https://forums.millisecond.com/Topic26082.aspx

By George Newman - 11/15/2018

Hey there. 

I've adapted a script using inquisit 5 and have just found out that we only have access to version 4 to run on the web. 

I saw from similar posts that I have to go trough manually and change out expressions. So I downloaded a different version of the ANT (for inquisit 4) to see where I should be going and it looks so different that I'm a bit lost were to start. Are there some obvious replacements i can make or would I be better off starting again with a version 4 script?

thanks


By Dave - 11/16/2018

George Newman - Friday, November 16, 2018
Hey there. 

I've adapted a script using inquisit 5 and have just found out that we only have access to version 4 to run on the web. 

I saw from similar posts that I have to go trough manually and change out expressions. So I downloaded a different version of the ANT (for inquisit 4) to see where I should be going and it looks so different that I'm a bit lost were to start. Are there some obvious replacements i can make or would I be better off starting again with a version 4 script?

thanks



Instead of <parameters> you need to use <values>, Inquisit 4 syntax knows no <parameters> element. In the <data> and <summarydata> elements' /columns attributes, you need to use [ ], not ( ), in Inquisi 4.  /validresponse doesn't work with parameters or values in Inquisit 4, you need to use /isvalidresponse instead. So things like

<trial centercue>
...
/ validresponse = (parameters.responsekey_left, parameters.responsekey_right)
...
</trial>

need to be changed to

<trial centercue>
...
/ isvalidresponse = [trial.centercue.response == values.responsekey_left || trial.centercue.response == values.responsekey_right]
...
</trial>

Similarly,

<trial centercue>
...
/ response = timeout(values.target_duration)
...
</trial>

needs to be replaced with

<trial centercue>
...
/ timeout = values.fixation1_duration+values.cue_duration+values.ISI_cuetarget + values.target_duration
...
</trial>

There is no built-in clearscreen element in Inquisit 4, so you need to define a blank <shape> covering the entire screen instead.

<shape clearscreen>
/ shape = rectangle
/ color = white
/ size = (100%, 100%)
/ erase = false
</shape>


Finally, and probably most importantly, <list> elements in Inquisit 4 do not have mean, median, standarddeviation properties, so things like

<expressions>
/ overallACC = list.accuracy.mean * 100
/ meanRT_correct = list.latencies.mean

/ACCnocue = list.accuracy_nocue.mean*100
/ACCcentercue = list.accuracy_centercue.mean*100
/ACCspatialcue = list.accuracy_spatialcue.mean*100

/ meanRT_correctNoCue = list.latencies_nocue.mean
/ meanRT_correctCenterCue = list.latencies_centercue.mean
/ meanRT_correctSpatialCue = list.latencies_spatialcue.mean

/ACCcongruent = list.accuracy_congruent.mean*100
/ACCincongruent = list.accuracy_incongruent.mean*100

/ meanRT_correctCongruent = list.latencies_congruent.mean
/ meanRT_correctInCongruent = list.latencies_incongruent.mean
...
</expressions>

won't work. You need to sum up the latencies of interest in additional <values> instead and divide by the respective N to get those means.

By George Newman - 11/16/2018

thanks for the quick reply, I'll get going with those. 

However,  I've run into another problem that i didn't expect. In inquisit 5 I could display text in a <likert> trail using an html element (which I had to do because I need portions of the text in bold) but now when I try to do the same thing the mouse cursor disappears and I don' seem to able to respond to the trial. I've added all the mouse based instructions to the code that i could find (although I didn't use any in version 5) but it still will only respond to keyboard input. However this only happens when the html element is used, it's fine when it's just the <text>. 

Any ideas what's going on there?





By Dave - 11/16/2018

George Newman - Friday, November 16, 2018
thanks for the quick reply, I'll get going with those. 

However,  I've run into another problem that i didn't expect. In inquisit 5 I could display text in a <likert> trail using an html element (which I had to do because I need portions of the text in bold) but now when I try to do the same thing the mouse cursor disappears and I don' seem to able to respond to the trial. I've added all the mouse based instructions to the code that i could find (although I didn't use any in version 5) but it still will only respond to keyboard input. However this only happens when the html element is used, it's fine when it's just the <text>. 

Any ideas what's going on there?






Evidently a bug in Inquisit 4. Options for workarounds would be:

- Not using <html> in those <likert>s, for example use a screenshot of the HTML displayed via a <picture>.
- Not using <likert>, but standard <trial> elements acting like likerts (cf. https://www.millisecond.com/download/library/v2/CustomLikert/customlikert.zip ).

By George Newman - 11/16/2018

Hey again

So the custom <trial> work-around runs into similar (but not the same) problem. It won't display the response buttons at the same time as the html (although it does display the cursor). If I set the stimulusframes of the html to 100, for example, then what happens is the scale is displayed until the html appears, at which point it disappears. Is this still the same bug?

As to the screen shot, that works fine (thank you) but I'm not sure about will happen when it is displayed on screens of different sizes. Will it scale? I'm worried that it might end up cutting off some of the words, or covering the question text or even possibly the response buttons below. Is there anyway I can guarantee that this sort of thing won't happen?

Thanks again.
By Dave - 11/16/2018

George Newman - Friday, November 16, 2018
Hey again

So the custom <trial> work-around runs into similar (but not the same) problem. It won't display the response buttons at the same time as the html (although it does display the cursor). If I set the stimulusframes of the html to 100, for example, then what happens is the scale is displayed until the html appears, at which point it disappears. Is this still the same bug?

As to the screen shot, that works fine (thank you) but I'm not sure about will happen when it is displayed on screens of different sizes. Will it scale? I'm worried that it might end up cutting off some of the words, or covering the question text or even possibly the response buttons below. Is there anyway I can guarantee that this sort of thing won't happen?

Thanks again.

Re. the <picture> approach, scaling across different screen sizes should not be an issue if you make use of /canvasaspectratio in the respective script's <defaults> and use percentages in /size and /position attributes.

Re. the <trial> issue, I seem to be unable to reproduce this one, but I don't have your HTML file. The attached example works fine for me in Inquisit 4.
By George Newman - 11/18/2018

Huh. That seems to work (even when plug my harmint.htm)! Still can't see where I went wrong in my code but I'm happy for that to be one of life's little mysteries! Thank you very much. I will proceed using this method. One last thing, is there a template for this exact thing but with a 7 point scale? I'm struggling to make a pictures that add on the extra two points i need. 

Thanks again for all your help.

By Dave - 11/18/2018

George Newman - Sunday, November 18, 2018
Huh. That seems to work (even when plug my harmint.htm)! Still can't see where I went wrong in my code but I'm happy for that to be one of life's little mysteries! Thank you very much. I will proceed using this method. One last thing, is there a template for this exact thing but with a 7 point scale? I'm struggling to make a pictures that add on the extra two points i need. 

Thanks again for all your help.


No, there isn't a pre-made 7-point sample that I''m aware of. Extending the existing one to 7 points should be straightforward, though, what exactly are you struggling with?
By George Newman - 11/21/2018

Apologies you, were right. It was straightforward. I was just being mildly stupid. 

Just out of interest, what determines which element appears in front of which? because it seems that this set up works because the buttons, b1, b2 etc, are layered on top of the scale.jpg but i can't see that explicitly in the code anywhere? If I could layer some elements in-front i might be able to do it with the original scale.

Thanks again.
By Dave - 11/22/2018

George Newman - Thursday, November 22, 2018
Apologies you, were right. It was straightforward. I was just being mildly stupid. 

Just out of interest, what determines which element appears in front of which? because it seems that this set up works because the buttons, b1, b2 etc, are layered on top of the scale.jpg but i can't see that explicitly in the code anywhere? If I could layer some elements in-front i might be able to do it with the original scale.

Thanks again.

The order in /stimulustimes or -frames determines what is drawn on top of what, see https://www.millisecond.com/forums/FindPost26096.aspx
By George Newman - 11/22/2018

Ah I see. So there is no way to present the stimulus frames "behind" the trial its self? And that's why the custom trial works while the likert doesn't, because you can layer the response  buttons on top of the html?
By Dave - 11/22/2018

George Newman - Thursday, November 22, 2018
Ah I see. So there is no way to present the stimulus frames "behind" the trial its self? And that's why the custom trial works while the likert doesn't, because you can layer the response  buttons on top of the html?

> So there is no way to present the stimulus frames "behind" the trial its self?

No, there is no such thing as a "trial itself" layer.

> And that's why the custom trial works while the likert doesn't, because you can layer the response  buttons on top of the html?

No, it's plainly a bug in how Inquisit 4 handles the <html> element in certain situations. In essence, the mouse is captured by the HTML window. Inquisit 5 doesn't have that problem.

Does that clarify?
By carloskij - 6/4/2019

Hi all, 
I found in the Inquisit library the attached version of Davidson et al.'s hearts and flowers task. Unfortunately, it is written for Inquisit 5 and my department has a licence for Inquisit 4, on which it doesn't work. Can someone help me in converting the code for Inquisit 4?

C.
By Dave - 6/4/2019

carloskij - 6/5/2019
Hi all, 
I found in the Inquisit library the attached version of Davidson et al.'s hearts and flowers task. Unfortunately, it is written for Inquisit 5 and my department has a licence for Inquisit 4, on which it doesn't work. Can someone help me in converting the code for Inquisit 4?

C.

Here's a list of things you typically have to change: https://www.millisecond.com/forums/FindPost27217.aspx