Visual Analog scale position logging

337 views
Skip to first unread message

Matt Riddle

unread,
May 3, 2014, 11:00:31 AM5/3/14
to e-p...@googlegroups.com
Hi,

I'm fairly new to anything beyond basic ePrime functions, so I apologize if this seems like a simple question.

I'd like to implement some form of Paul Groot's visual analog scale, but what I would like eprime to do is record the position on the scale every second or so.
So let's say the participant was letting his mind wander, and was continuously moving the scale up and down according to how they were feeling, and then
having ePrime log wherever the indicator is on the scale. What would be the easiest way to go about doing this? I don't know if the scale treats the indicator
as a mouse cursor or what, so I'm a little clueless what to do.

Thanks in advance for your help!

-Matt

Paul Groot

unread,
May 5, 2014, 3:57:39 AM5/5/14
to e-p...@googlegroups.com
Hi Matt,

I think that would be possible by modifying the DragScale function in the VAS.epk2 package. A while-loop is used in this function to refresh the needle when it is moved around. It's not very difficult to add a few lines that will save the needle position periodically. The modified attachment should do something like that. The 1-sec positions are now saved as attribute with incremental suffix (xyz.1, xyz.2 etc.). Another option would be to force logging at each interval by inserting a call to c.Log. In that case it is not required anymore to add the suffix, so all results would be inserted into the same xyz column of the output file. However, you will get more rows instead of columns.

Best
Paul

P.S. These are the inserted lines:

line 10+11:
Dim lSavePosAt As Long ' next time to save position
Dim lSavePosCount As Integer ' counter to

line 41+42:
lSavePosAt = Clock.ReadMillisec + 1000 ' save position every second
lSavePosCount = 0

lines 133-141:
    If Clock.ReadMillisec>=lSavePosAt Then
        lSavePosAt = lSavePosAt + 1000
        lSavePosCount = lSavePosCount + 1
        percent = 100*((ptPress.X-VAS_SliderDummy.Left)/sw)
        If percent<0 Then percent = 0
        If percent>100 Then percent = 100
        ' save the percent value
        c.SetAttrib attributeName & "." & CStr(lSavePosCount), percent
    End If




...



--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+u...@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/4379bc47-ef57-4d31-be0d-85e78682c9dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

with_1sec_logging.7z

Matt Riddle

unread,
May 5, 2014, 8:25:21 AM5/5/14
to e-p...@googlegroups.com
Hi Paul,

Thank you so much! I will give this a try.

-Matt

Matt Riddle

unread,
May 5, 2014, 10:58:37 AM5/5/14
to e-p...@googlegroups.com
If I'm working with the Eprime 1 version of this, could I just in theory take the lines from the package and insert them inline in the eprime 1 script?

Thanks,

-Matt

On Monday, May 5, 2014 3:57:39 AM UTC-4, Paul Groot wrote:

Paul Groot

unread,
May 5, 2014, 4:27:12 PM5/5/14
to e-p...@googlegroups.com
Matt,

There are no significant differences between the version 1 and version 2 scripts. The line numbering could be slightly different, so apply the following rules if the numbers are not clear: 

- The Dim statements can be placed at the start of the DragScale function. Typically below the other Dim statements.
- The two initialization lines should be placed before the while-loop. For example, just before the Mouse.SetCursorPos line.
- The third part should be placed at the end of the while-loop. I.e., before Wend.

Best
Paul


Reply all
Reply to author
Forward
0 new messages