Millisecond Online Community

Forums & Feeds
Welcome to Millisecond Online Community Sign in | Join | Help
in Search

Random picture

Last post 08-22-2008, 5:20 AM by Ernesto. 2 replies.
Sort Posts: Previous Next
  •  08-14-2008, 5:24 AM 1800

    Random picture

    I have to show a random picture (from 3 possibles) The selection must be remembered, because I have to show a similar one after a few pages.
    I have Picture1-1.jpg, Picture1-2.jpg and Picture1-3.jpg
    and Picture2-1.jpg, Picture2-2.jpg and Picture2-3.jpg

    If the Picture1-1.jpg was shown, I have to show Picture2-1.jpg.
    If the Picture1-2.jpg was shown, I have to show Picture2-2.jpg.
    If the Picture1-3.jpg was shown, I have to show Picture2-3.jpg.

    it is possible that I have to do the same with 3 sounds(mp3).


  •  08-14-2008, 6:07 AM 1802 in reply to 1800

    Re: Random picture

    You should be able to pull this off by using two linked itemsets. The basic setup is the same for pictures and sounds. Here's some pseudo-code for pictures as an example:

    <picture firstpicture>
    / items = ("Picture1-1.jpg", "Picture1-2.jpg", "Picture1-3.jpg")
    / select = noreplace
    ...
    <picture>

    <picture secondpicture>
    / items = ("Picture2-1.jpg", "Picture2-2.jpg", "Picture2-3.jpg")
    / select = current(firstpicture)
    ...
    <picture>

    <trial firstpicture>
    / stimulusframes = [1=firstpicture]
    ...
    </trial>

    <trial secondpicture>
    / stimulusframes = [1=secondpicture]
    ...
    </trial>

    The trial 'firstpicture' randomly presents one of the images contained in <picture firstpicture>. The trial 'secondpicture' presents the corresponding image from the set defined in <picture secondpicture>.

    Hope this helps,
    ~Dave
  •  08-22-2008, 5:20 AM 1836 in reply to 1802

    Re: Random picture

    Thanks!! That was what I was looking for.
    ~Ernesto
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems