An IBEX controller for Picture-Sentence Matching Tasks

794 views
Skip to first unread message

Alexandre Cremers

unread,
Mar 12, 2014, 12:07:33 PM3/12/14
to ibexexp...@googlegroups.com
Dear IBEX users,

I wrote a modified version of the Question controller for picture-sentence matching task for people in our lab. I guess this may be useful to other users so I am sharing it here. To use it, just put the .css file in the css_includes directory and the .js file in the js_includes directory.

The controller is called PictureAccept. It takes as arguments a sentence ("s") and a list of url's which should link to pictures ("as"). "as" can also be a list of lists, which each sublist containing a key and a url, as in Question. In this case, a response key is associated with each image. If "as" is just a list of url's, participants will need to click on the pictures.

The result file contains a number indicating which picture was chosen (from 1 to n) and the time taken to answer (this is explained in the comments of the results file).

Example syntax (A, S, D being the response keys for pictures 1, 2, 3 respectively):

["Example","PictureAccept", {s: "The sentence you want to show",
                            as: [["A","http://...picture1.png"],
                                   ["S","http://...picture2.png"],
                                   ["D","http://...picture3.png"]]

The width of the pictures is forced to be 16em in the .css file ("img" entry) and they always come with a black border. You are free to modify this as you need (especially if you would like to include more than 3 pictures). You still need to host your pictures somewhere outside ibex farm.

I did not test it a lot, so it may not work perfectly on all browsers, or if you try something too specific (many or big pictures...). You'd rather not look inside the .js file if you enjoy beautiful code as it is very unclean (I did minimal modifications of the Question controller, and left a lot of things which are useless here).

You can see an example here:

http://spellout.net/ibexexps/Emmanuel/Picture-Matching/experiment.html

I hope you will find it useful!
Alexandre




PictureAccept.css
PictureAccept.js

Alex Drummond

unread,
Mar 12, 2014, 12:56:38 PM3/12/14
to ibexexp...@googlegroups.com
Hey Alexandre, thanks for posting this. I can add it in to the next version of Ibex if it's ok with you.
Alex


--
You received this message because you are subscribed to the Google Groups "ibexexperiments" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperimen...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alexandre Cremers

unread,
Mar 12, 2014, 1:05:41 PM3/12/14
to ibexexp...@googlegroups.com

Feel free to add it if you want, but maybe I should write something cleaner then.

Titus von der Malsburg

unread,
Feb 13, 2016, 12:41:39 PM2/13/16
to ibexexperiments
Hi Alexandre (and Alex),

your PictureAccept controller is super useful and it seems to work nicely in my experiment.  Does the code have a home?  Are there more recent versions than that posted here?

I have made one small change: in my version, the order of the pictures is randomized to rule out effects of order.

Best,

  Titus

Alex Drummond

unread,
Feb 14, 2016, 11:26:57 AM2/14/16
to ibexexp...@googlegroups.com
Feel free to add it as one of the controllers in the main ibex distribution if you want to (https://github.com/addrummond/ibex). I gave Titus commit access already. I can also give you commit access if you want, Alexandre, if you send me your github username.
Alex

Alexandre Cremers

unread,
Feb 14, 2016, 4:38:28 PM2/14/16
to ibexexp...@googlegroups.com
Hi Titus and Alex,

I have not been using this code since when I posted it (I had developed it for someone else at the lab to begin with). I only corrected an error where the controller encoded the url of the picture instead of its number in the results file when a particular choice of response options was selected (can't remember the details, sorry). Feel free to update it with your own changes and and commit it if you want!

I'm glad this is useful :)

Alexandre
PictureAccept.js

Titus von der Malsburg

unread,
Feb 15, 2016, 3:51:51 PM2/15/16
to ibexexp...@googlegroups.com

I added the controller in the new directory "contrib". After a clean-up
we can include it in standard ibex.

Tentative documentation (based on Alexandre’s earlier email) is here:

https://github.com/addrummond/ibex/blob/master/contrib/PictureAccept.md

Titus
signature.asc

Gonzalo Silvera

unread,
May 5, 2017, 11:49:56 AM5/5/17
to ibexexperiments
Hello Alexandre!
I was wondering if there's a way to use a pictures as a sentence. Did you modify something in the js file to make the controller accept the url of the pictures?

Alexandre Cremers

unread,
May 5, 2017, 12:03:34 PM5/5/17
to ibexexp...@googlegroups.com
Hi,

I modified the js indeed. If you want a picture on top of page, the simplest is to use a Vbox and place a Message controller above the Question. It's then very easy to include anything you want in the HTML option of Message.

Best,
A

--
You received this message because you are subscribed to the Google Groups "ibexexperiments" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperiments+unsubscribe@googlegroups.com.

Gonzalo Silvera

unread,
May 9, 2017, 10:21:52 AM5/9/17
to ibexexperiments
Thanks Alexandre, It's working! I have another question. It's posible to display the 2 controllers inline with a vbox? There's a way to modify something in the code to do that?
A

To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperimen...@googlegroups.com.

Alexandre Cremers

unread,
May 9, 2017, 10:47:39 AM5/9/17
to ibexexp...@googlegroups.com
If you mean, present them horizontally, I'm afraid it will require a bit of work. The VBox creates a table if I recall correctly (for details, you can look at the .js file, or use the Inspector tool in Firefox).

To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperiments+unsubscribe@googlegroups.com.

Gonzalo Silvera

unread,
Jun 5, 2017, 8:54:03 AM6/5/17
to ibexexperiments
I modified the vbox file and it works, thanks a lot for the help, I appreciate that Alexandre. I have a last question... Is there a way to load images from ibex with any controller instead of using an external host? And if it's not, can you or someone else recommend me a free external host?

Alexandre Cremers

unread,
Jun 5, 2017, 9:37:14 AM6/5/17
to ibexexp...@googlegroups.com
I was using a personal ftp, but it should also be possible to use a public hosting service (like imgur). In the latter case, just make sure they don't add watermarks, and that the quality of your image remains good enough.

To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperiments+unsubscribe@googlegroups.com.

Gonzalo Silvera

unread,
Jun 5, 2017, 12:00:53 PM6/5/17
to ibexexperiments
Thanks again. I've seen in the group that some people are using dropbox, but i need to keep the images in private. FTP its probably a good solution for that, i read that you can give a username and a password to the client to access to the file. Do i need to set up something in ibex to use ftp or it works only with links? Do you recommend any software to use ftp?

Alex Drummond

unread,
Jun 5, 2017, 12:26:38 PM6/5/17
to ibexexp...@googlegroups.com
Hi Gonzalo,

The experiment is accessible to anyone who has the URL, so there is no way to keep the images private, wherever you are storing them.

Alex

To unsubscribe from this group and stop receiving emails from it, send an email to ibexexperiments+unsubscribe@googlegroups.com.
Message has been deleted

Hiroki Fujita

unread,
Aug 21, 2017, 12:39:06 PM8/21/17
to ibexexperiments

Hi Titus,

The css and js files Alexandre provided above worked but the files in your github which, I suppose, contain the randomising function did not. Is there any updated version? 
Also, could you tell me if there is any way to specify a correct answer with the PictureAccept package (I have difficulty doing this, as the PictureAccept command should be in the sentence controller)?

Thank you.

Hiroki
Reply all
Reply to author
Forward
0 new messages