Howdy, Stranger!

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

Supported by

[open] Copying or embedding a text_input screen into a sketchpad item

edited March 2015 in OpenSesame

Hi all,

I think the title is abstract of my interest:) I want to know if there is a way to copy or embed a text_input screen (and also text_display etc.) entirely (with the same coordinates of all widgets and images) into a sketchpad item. Thanks for replies.

Edit: Another question (that is not related to this topic; but i had asked before and i couldn't have a satisfactory answer) is that is there a way to set a specific duration time for text_input without waiting for a keypress from the participants?

Comments

  • edited March 2015

    Hi Deniz, I answered your other post.

    Further, if you want to collect a text input during a sketchpad item, I assume you want to display images while texts are collected? I don't think you can do something like that with a sketchpad item. Rather, in order to do this (and immediately take care of those timing things as well), I think you would have to build an interface from scratch with an inline_script. Basically you build your canvas with everything you previously wanted in a sketchpad item (images, text whatever). And then insert two more things: a timer, and something that collects keyboard responses and adds all responses to the canvas:

      from openexp.keyboard import keyboard
      my_keyboard = keyboard(exp, keylist=none)
    
      x = 500 # an example of an x-coordinate to begin response text at
      start_time = self.time()
      timecounter = 0
    
      while timecounter < 20000 # 20 seconds to answer:
    
           response, timestamp = my_keyboard.get_key()
    
           exp.canvas.text(response, x=x, y=something)
           exp.canvas.show()
           x += 30  # increase x so the next letter won't overlap with the previous one
           timecounter = self.time() - start_time
    

    Hopefully this provides a basis for you to realize your experiment. Let me know how it goes.
    Cheers,
    Josh

Sign In or Register to comment.