Survey Page with parallel port response box?


Author
Message
matt2004
matt2004
Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)
Group: Forum Members
Posts: 11, Visits: 1

Dear Inquisiteers,


I'm having some trouble getting a task for a fMRI experiment working. The participants will be using a response box, which has a parallel-port output - given the restraints of the scanner we can't really use any other response device (mouse, keyboard etc.). At several points duing the scan we need the participants to perform a rating on a 20-point scale. My idea was to use the <surveypage> and  <slider> elementts to show a slider on screen which they could then increment and decrement with two buttons of the response box - after a specified time (say 10s) the survey page should time-out and record the position of the slider.


However, it appears that the <surveypage> element isn't *quite* like a conventional trial element in that it appears to be set up for mouse-input only. Setting  /inputdevice=lpt1 within the survey page appears to do nothing! I'm also seeing some slightly strange behaviour where the slider responds to the left and right keyboard cursor keys under an older version of Inquisit (3.02) but this functionality appears to have been removed in version 3.0.6.


What can I do? Is there any way to get the surveypage element to respond to parallel port input? Alternatively, is there a clever way of using the standard trial element to present an interactive rating bar which can be incremented and decremented for a given time period, using port input? Or any other suggestions?


Any help much appreciated! Many thanks in advance.


Matt.


Dave
Dave
Supreme Being (863K reputation)Supreme Being (863K reputation)Supreme Being (863K reputation)Supreme Being (863K reputation)Supreme Being (863K reputation)Supreme Being (863K reputation)Supreme Being (863K reputation)Supreme Being (863K reputation)Supreme Being (863K reputation)
Group: Administrators
Posts: 10K, Visits: 60K

Is there any way to get the surveypage element to respond to parallel port input?


No, it's not possible.


Alternatively, is there a clever way of using the standard trial element to present an interactive rating bar which can be incremented and decremented for a given time period, using port input?


Yes, this can be done, but it requires a fairly good understanding of Inquisit's programming model. Here's a quick demo to get you started (use the 'A' and 'S' key to navigate; this can be easily adapted to port input devices):


<data>
/ columns = [date,time,subject,text.question.currentitem,expressions.ratingvalue]
</data>

<values>
/ ratingtimeout = 10000
/ timeremaining = values.ratingtimeout
/ distance = 15%
/ questionnumber = 0
</values>

<expressions>
/ ratingvalue = 1+(text.indicator.hposition-text.r1.hposition)/values.distance
</expressions>

<block myblock>
/ trials = [1-2=getquestion]
</block>

<trial getquestion>
/ stimulusframes = [1=blankscreen]
/ ontrialbegin = [values.timeremaining=values.ratingtimeout; values.questionnumber=counter.myquestions.selectedvalue]
/ validresponse = (noresponse)
/ trialduration = 500
/ branch = [trial.rating]
/ recorddata = false
</trial>

<trial rating>
/ ontrialend = [if(trial.rating.response==30 && text.indicator.hposition>text.r1.hposition)
    text.indicator.hposition=text.indicator.hposition-values.distance]
/ ontrialend = [if(trial.rating.response==31 && text.indicator.hposition<text.r5.hposition)
    text.indicator.hposition=text.indicator.hposition+values.distance]
/ ontrialend = [values.timeremaining=values.timeremaining-trial.rating.latency]
/ stimulusframes = [1=question,r1,r2,r3,r4,r5,indicator,currentrating]
/ validresponse = (30, 31)
/ branch = [if(values.timeremaining>0)trial.rating else trial.dumpdata]
/ timeout = values.timeremaining
/ recorddata = false
</trial>

<trial dumpdata>
/ trialduration = 0
</trial>

<text question>
/ items = ("Q1", "Q2")
/ position = (50%, 30%)
/ erase = false
/ select = values.questionnumber
</text>

<counter myquestions>
/ select = noreplace(1-2)
</counter>

<text currentrating>
/ items = ("Your current rating is <%expressions.ratingvalue%>. You have <%values.timeremaining%> ms left.")
/ position = (50%, 40%)
/ erase = false
</text>

<text indicator>
/ items = ("^")
/ position = (50%, 55%)
</text>

<text r1>
/ items = ("1")
/ position = (20%, 50%)
/ erase = false
</text>

<text r2>
/ items = ("2")
/ position = (35%, 50%)
/ erase = false
</text>

<text r3>
/ items = ("3")
/ position = (50%, 50%)
/ erase = false
</text>

<text r4>
/ items = ("4")
/ position = (65%, 50%)
/ erase = false
</text>

<text r5>
/ items = ("5")
/ position = (80%, 50%)
/ erase = false
</text>

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


BTW, this is much the same approach that you would use to build interactive user interfaces in Inquisit. If you're interested in learning more about this, I recommend working through the Tower Of London script available from the Task Library.


Regards,


~Dave


matt2004
matt2004
Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)
Group: Forum Members
Posts: 11, Visits: 1

Many thanks Dave! You are a gentlemen, a scholar, and a hero of Homeric statue. 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search