Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Randomization + item-specific duration

edited March 2012 in OpenSesame

Hi Sebastiaan,

Thanks for this great program!

I have a question regarding randomization. I have a set of items, names and surnmes. Each item contains also additional information (images, more text) but that's irrelevant now (I have created slides and export them as .png files to use in OpenSesame). Here is what I want to do:

  1. I have a list of "name slides" and "surname slides". Each "name slide" has assigned one "surname slide".
  2. Create a random presentation of "name slides" where each "name slide" is followed by it's assigned "surname slide". (In other words, I would randomized just the "name slides").

Example:
[name slide] [surname slide]
[Sherlock] [Holmes]
[Doctor] [Watson]
[James] [Moriarty]
[Mrs.] [Hudson]

I want to randomize it like this:
[James] [Moriarty]
[Sherlock] [Holmes]
[Mrs.] [Hudson]
[Doctor] [Watson]

But not like this:
[Doctor] [Moriarty]
[Hudson] [Watson]
[Holmes] [Sherlock]
[James] [Mrs.]

I hope it hasn't been answered yet. If I'm wrong, please post a link to the answer. Thanks in advance!

Best regards,
Jakub

Comments

  • edited 8:04PM

    Hi Jakub,

    Welcome to the forum!

    If I understand your question correctly, this would be fairly easy to implement. Basically, you want to present two slides (which would be sketchpads in OpenSesame) in a fixed order, right? But which pair of slides should be shown on a given trial, should be randomized.

    First, you would set up a table in the block-loop with something like the following (if this does not sound familiar, please check out the tutorial):

    name     surname
    Sherlock Holmes
    Mrs.     Hudson
    ...
    James    Moriarty

    Next, you would add two sketchpads to a sequences, the first containing the text [name], the second containing the text [surname]. So the structure in the overview would look something like this (there would probably be more items in the actual experiment):

    loop
    - sequence
    - - sketchpad_name
    - - sketchpad_surname

    Hope this gets you started!

    Regards,
    Sebastiaan

    Buy Me A Coffee

  • edited March 2012

    Thanks for your quick reply, Sebastiaan!

    Well, seems pretty straightforward and I did just what you wrote here to do. I set up a block loop with NAME and SURNAME variables. Then I used names of my .png files (n1-n6 as values for the NAME variable and a1-a6 as values for the SURNAME variable). I did basically something like they did in "Cat face experiment" tutorial, inserting images into file pool, then into sketchpad and modifying the script accordingly. The problem is, when I run the experiment either in window or full screen, I get just the first Display_text item, and then the experiment terminates with following error message:

    An unexpected error occurred, which was not caught by OpenSesame. This should not happen! Message:
    Only 24-bit or 32-bit surfaces can be smoothly scaled

    I get this on both Windows and Ubuntu 11.10, running Darwin. I assume it has to do with pictures I imported into the experiment. Is there a way to solve it?

    Thanks in advance.

    EDIT: Ok, I changed the back-end to PsychoPy and the problem seems to be solved. As for randomization, it works just like I wanted. Thanks again!

  • edited 8:04PM

    PS.: I figured a debug window could help:

    http://dl.dropbox.com/u/5689384/debug.txt

  • edited 8:04PM

    Hi Jakub,

    Thank you for anticipating my question! The debug output clears things up. It indeed seems that some images cannot be scaled with the legacy (pygame) back-end. I can reproduce this using a grayscale .bmp file. I will see what I can do to fix this: https://github.com/smathot/OpenSesame/issues/76

    One way to solve it, as you discovered, is to use the psycho back-end. Alternatively, you could convert your images into .png format with a tool such as GIMP or (more advanced) ImageMagick, both available in Ubuntu.

    Good luck!

    Regards,
    Sebastiaan

    Buy Me A Coffee

  • edited March 2012

    Hey there again!

    This is not so urgent but anyway:

    While on Win 7 the program works fine using PsychoPy backend, on Oneiric I get these while using PsychoPy and OpenGL:

    http://dl.dropbox.com/u/5689384/debug_psychopy_oneiric

    http://dl.dropbox.com/u/5689384/debug_opnGL_oneiric

    Seems like I'm missing some GL libraries. I did some research and installed various packages but it didn't do the trick. I don't actually know which libraries are necessary and where to get them. A hint would be appreciated! ;-)

    Jakub

  • edited 8:04PM

    Hi Jacob,

    You need the following packages: python-opengl and/ or psychopy.

    sudo apt-get install python-opengl psychopy

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited 8:04PM

    Sorry, I forgot to mention the most important thing: both python-opengl and psychopy are already installed on my system but I get those errors anyway.

  • edited 8:04PM

    Really? Hmm, maybe there's something wrong with (the Python bindings of) OpenGL. If you open a Python interpreter (by typing python in a terminal) and try to import OpenGL, do you receive an error?

    import OpenGL.GL

    And can you run other OpenGL based things? For example, do the desktop effects work (e.g., are there shadows under the Windows)?

    Buy Me A Coffee

  • edited 8:04PM

    As for the desktop effects: Yes, there are shadows under windows (altho I didn't explore other kinds of effects since I don't like to use them. However, I will try if it's necessary).

    And here is the output from terminal:

    Traceback (most recent call last):
      File "", line 1, in 
      File "/usr/lib/pymodules/python2.7/OpenGL/GL/__init__.py", line 2, in 
        from OpenGL.raw.GL import *
      File "/usr/lib/pymodules/python2.7/OpenGL/raw/GL/__init__.py", line 6, in 
        from OpenGL.raw.GL.constants import *
      File "/usr/lib/pymodules/python2.7/OpenGL/raw/GL/constants.py", line 7, in 
        from OpenGL import platform, arrays
      File "/usr/lib/pymodules/python2.7/OpenGL/platform/__init__.py", line 36, in 
        _load()
      File "/usr/lib/pymodules/python2.7/OpenGL/platform/__init__.py", line 27, in _load
        plugin_class = plugin.load()
      File "/usr/lib/pymodules/python2.7/OpenGL/plugins.py", line 14, in load
        return importByName( self.import_path )
      File "/usr/lib/pymodules/python2.7/OpenGL/plugins.py", line 28, in importByName
        module = __import__( ".".join(moduleName), {}, {}, moduleName)
      File "/usr/lib/pymodules/python2.7/OpenGL/platform/glx.py", line 8, in 
        class GLXPlatform( baseplatform.BasePlatform ):
      File "/usr/lib/pymodules/python2.7/OpenGL/platform/glx.py", line 20, in GLXPlatform
        raise ImportError("Unable to load OpenGL library", *err.args)
    ImportError: ('Unable to load OpenGL library', 'GL: cannot open shared object file: No such file or directory', 'GL', None)
    
  • edited 8:04PM

    Hi Jacub,

    Hmm, right. It appears that (py)OpenGL doesn't work on your system. If you haven't done anything out of the ordinary, such as adding third party repositories with different versions of OpenGL-related stuff, my bet is that there's a problem with your graphics card. Perhaps you could try some Google searches on the error that you get + your version of Ubuntu + your graphics card?

    I'm afraid I cannot really help you much in this department. It can be a bit tricky to get the proper graphics drivers running on Ubuntu, unfortunately (I've had my share of trouble as well).

    Good luck!

    Sebastiaan

    Buy Me A Coffee

  • edited 8:04PM

    Thanks, Sebastiaan! At least I know what's going on and I can use the Windows version while trying to solve this problem.

    Good luck to you too!

    Jakub

  • edited 8:04PM

    Hi Sebastiaan!

    I have more questions about randomization.

    These are my variables:

    NAME  SURNAME
    a1    n1
    ...   ...
    a12   n12
    

    As I said earlier, each variable represents a serie of slides to be presented to the subject via displaying the sketchpad. Each sketchpad element's duration is set to a specific time period. Now, here comes the tricky part:

    I need all the odd numbers (a1, a3... a5 and n1, ...n5) to have the duration set to, let's say 12 seconds while all the even numbers (the rest) to have the duration set to 6 seconds. In other words, I need the duration of the sketchpad element to be determined by what value of the variable is being used.

    Is this possible?

    Jakub

  • edited March 2012

    Hi Jakub,

    Yes, sure. The easiest way is probably to add an extra column, let's call it MYDURATION, so the table looks like this:

    NAME  SURNAME MYDURATION
    a1    n1   12
    ...   ...   6
    a12   n12   6

    And then you enter [MYDURATION] into the duration field of the sketchpad.

    Hope this helps!

    Cheers,
    Sebastiaan

    Buy Me A Coffee

  • edited 8:04PM

    That's pretty intuitive, actually (so intuitive that I haven't thought of it). I'm starting to see the elegance of this program.

    Thanks a lot!

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games