Create a checklist allowing multiple clicks?
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Create a checklist allowing multiple clicks? Expand / Collapse
Author
Message
Posted 10/22/2007 12:01:36 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/24/2008 3:53:03 PM
Posts: 9, Visits: 48
Hi everyone,

I am creating a program in which participants are to memorize words presented to them. To test this, I need to generate a checklist of "old" and "new" words and present it to participants. I need participants to click on all the words that they recognize and then click to continue. I would like to present all the words at once on the screen, and have each clicked word change colour, so that participants know what they have already checked/clicked. Is there a simple way to do this? I have no problem "hardcoding" the words in, one by one, as long as it works.

I have tried everything in the GUI, and my scripting knowledge = "0". I've looked at the Visual Analog demo, and can't figure out how to change it. Any help would be greatly appreciated

-Kirk

Post #724
Posted 10/25/2007 4:30:33 PM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: 10/30/2008 3:23:17 PM
Posts: 127, Visits: 924
Hi Kirk,

The modified version of the Visual Analog Sample is the one you'll need to look at. I have attached it here. The subject will be able to click on as many choices as they like, and their choices will be highlighted (they can also unselect a choice if necessary). The main change you will need to make is to log whatever is inside the selection. So, for example, say that the first area that can be selected is named "Text1" and its Text property references the "Choice1" attribute. You will need to use script to check the number of the choice and then log the value of the attribute it's referencing. So, if the value of Choice1 is "cat", then you would need to log "cat" in the data file. This can be done by accessing the attribute via script.

So, basically, you can add more boxes if necessary, but ensure that they are all using a standardized naming convention. For example, "Text1", "Text2", etc. Then, after the stimulus has ended, you will use a bit of script to loop through all of the possible choices. If the BackColor property is yellow (i.e. the selection color), then you will log the attribute with the same number in the data file. For example:

Dim nCount As Integer

'Assumes you have 4 total choices available.
For nCount = 1 To 4

  'Access the next SlideText sub-object (i.e. choice area).
  strHit = "Text" & nCount
  Set xSlide = CSlideText(Stimulus.States.Item("Default").Objects(strHit))

  'Check if this box was selected and log the text displayed if so.
  If xSlide.BackColor = "yellow" Then
    c.SetAttrib "Choice" & nCount, c.GetAttrib("Choice" & nCount)
  End If

  'Reset the BackColor for the next trial.
  xSlide.BackColor = CColor("green")
Next i

This script would be placed in the UninitAndLog InLine in the attached sample.

I hope that this has been helpful. Let me know if you need further assistance.


- Matt


- Matt
PST Technical Consultant
http://pstnet.com


  Post Attachments 
VASMultipleSelection.es (7 views, 27.77 KB)
Post #748
Posted 10/26/2007 2:54:05 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/24/2008 3:53:03 PM
Posts: 9, Visits: 48
Thank you so much for your help! That looks really good.

I'm just trying to add some text boxes, now. I included that bit of script into the UnInitLog inline file, and i keep getting a type mismatch error. I'm really not sure why.

I have the following in the UninitAndLog inline file:

Mouse.ShowCursor FALSE

'Generic counter variable.
Dim i As Integer

'String variables for storing subject responses.
Dim strRow1Response As String
Dim strRow2Response As String

'Reset the BackColor of all boxes to the default.
Dim nCount As Integer

'Assumes you have 4 total choices available.
For nCount = 1 To 4

  'Access the next SlideText sub-object (i.e. choice area).
  strHit = "Text" & nCount
  Set xSlide = CSlideText(Stimulus.States("Default").Objects(strHit))

  'Check if this box was selected and log the text displayed if so.
  If xSlide.BackColor = "yellow" Then
    c.SetAttrib "Choice" & nCount, c.GetAttrib("Choice" & nCount)
  End If

  'Reset the BackColor for the next trial.
  xSlide.BackColor = CColor("white")
Next nCount

'Release references
Set xSlide = Nothing
Set theState = Nothing


'Log subject's final ratings for each row in the data file.
c.SetAttrib "Question1Responses", strRow1Response
c.SetAttrib "Question2Responses", strRow2Response

The error comes in at the "If xSlide.BackColor = "yellow"" line.

I apologize if I'm missing something that's really obvious, but I am really limited with my ability to debug these things.

Post #758
Posted 10/27/2007 12:48:45 PM


Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: 10/30/2008 3:23:17 PM
Posts: 127, Visits: 924
Kirk,

Sorry about that. The line of script causing the error should actually be:

If xSlide.BackColor = CColor("yellow") Then

"Yellow" must actually be converted to a Color value so that it can be evaluated in E-Prime.



- Matt
PST Technical Consultant
http://pstnet.com
Post #762
Posted 10/29/2007 11:35:23 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/24/2008 3:53:03 PM
Posts: 9, Visits: 48
That did it!

This works perfectly now! Thank you so much for you help!

Post #777
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 3:47am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.078. 12 queries. Compression Disabled.