Try OSWeb 1.4 with new features for online experiments!
(Update August 31: the latest prerelease is now 3.3.10a14.)
OSWeb 1.4 will be released soon. This is a substantial update with many new features for online experiments.
New features:
- Many improvements to the inline_javascript item to bring it closer to the Python API:- Canvas support for programmatically creating displays
- Common functions such as xy_circle()
- poolobject for access to the file pool
- persistentobject for sharing variables and functions between scripts
 
- Support for .csvfiles as source for loop tables
- Support for all color specifications, including HSL, HSV, and LAB color spaces
- Support for form plugins (except form_base)
- Support for custom HTML forms through the new inline_htmlitem
- Customizable welcome text (on the first screen that is shown)
OSWeb 1.4 will be officially released together with OpenSesame 3.3.10. But you can already try it now, thus helping us by finding any remaining bugs, and helping yourself by being among the first to get your hands on this cool new functionality!
How to update to OSWeb 1.4?
If you're using Windows, the easiest way to get OSWeb 1.4 is by downloading the latest prerelease of OpenSesame 3.3.10:
For other operating systems, including Mac OS, you can update the OSWeb extension in your existing OpenSesame installation. You can do this with pip (you may need to prefix pip  with !  when running from the OpenSesame console):
!pip install opensesame-extension-osweb --upgrade !pip install opensesame-extension-osweb --upgrade --user # doesn't need admin rights
Or with conda :
!conda update opensesame-extension-osweb -y -c cogsci
Ubuntu users can install the latest (testing) versions of OSWeb and other packages through the Rapunzel PPA:
sudo add-apt-repository ppa:smathot/rapunzel sudo apt-get update
For more information about how to update packages in OpenSesame, see:
 
				 
							 
							

Comments
Fantastic new features - thank you Seb! 😃
Tested
formsand they worked perfectly!Is there any documentation on how to use the
poolobject and thepersistentobject by any chance?Many thanks,
Bo
Hi @boyao , glad to hear it works for you! There is some limited documentation for
poolandpersistenton this page:Check out SigmundAI.eu for our OpenSesame AI assistant!
That is great! Does this version also allow to change the source file of a loop using JavaScript? In an online experiment, I would like to pick a pseudo-random trial sequence (say 1 out of 24 files generated in Excel) and the [] notation seems not to be allowed for the file name field of a loop.
@HenkvanSteenbergen Yes, you can. The
[var_name]notation also works forloopsources (if it appears not to, then that must be because of something different), so you can specify theloopsource by setting a variable in aninline_javascriptitem.Check out SigmundAI.eu for our OpenSesame AI assistant!
Hi @sebastiaan,
Love the new features! Thanks for this!
I understand documentation is limited at the moment and that it's a pre-release. I was wondering whether you could give me a hint on how to go about modifying the welcome screen, though. Would love to give it a go (happy to report my experience here for other users).
Best,
Fabrice.
Hi @HenkvanSteenbergen,
Following up on Sebastian's reply, you can indeed select a csv file at random and use it as the source of a loop. Here's how to do it practically.
First, ensure that your csv files are loaded in the pool.
Use Javascript to select a digit at random (here I'm picking a digit between 1 and 5; you could of course easily change that to 1 and 24):
// Picks a random digit between 1 and 5 var pickedset=Math.floor(Math.random() * 5) +1 // output info to console for monitoring console.log("Picked: "+pickedset) console.log("Picked file: stimset"+pickedset+".csv") // defines the variable containing the name of the csv file to be used vars.stimfile="stimset"+pickedset+".csv"Once you've defined
stimfileas the variable containing the name of the file to use as the source, you can use the[ ]method like so:Make sure that the headers in your csv files match the names you use when setting up the objects to to be presented in your sequence:
That's it!
You can download my example here:
I hope this helps. Hopefully it'll help you work out why it is not working in your task (using your browser's console or the debugger can be very useful to find the origin of the problem).
Good luck!
Fabrice.
_____________________________________________________________________________________
If you found my reply helpful and wish to invite me to a coffee, you can do so here 😉: https://www.buymeacoffee.com/psyfab
Dear @sebastiaan,
I have a question about exporting my experiment to Jatos if my experiment procedure has an inline script? When I check on my compatibility, it was showed item_inline script is not supported, is there any suggestion for me to solve this issue?
Best,
TZ
Hi @Tzlim,
OsWeb is based on javascript, not Python, therefore you cannot use the regular python inline_script. Fortunately, since OSWeb, the
inline_javascriptis quite powerful and can do many things that the python inline_script can do.So in order to migrate your experiment to the web, you need to translate the the python bits to javascript bits. Check out the documentation. There is a lot of very useful information on how to go about it.
Hope this helps,
Eduard
ps, if you have specific issues with your experiments and the adjustments to osweb-compatibility, it is better to open a dedicated discussion for it, rather than replying to this announcement-type discussion.