I am working with a group of physics teachers and we are programming simulations using EJS. I had them work with EJS 5 under the assumption that we could output HTML 5. But I can not figure out how that works. Can anyone point me in the right direction? Thanks, Nick Gross
Unfortunately, you cannot write your code using the Java 'flavour' of EjsS and then automatically generate the HTML version, which requires Javascript and HTML view elements. This is not so simple. You need to use the Javascript 'flavour' of EjsS to create your simulation from the start, instead.
The good news is that your previous knowledge with EJS helps A LOT with the new flavour. The Model part looks very much the same. (The main change is that Javascript has no typed variables. - no 'int', 'double', etc. All variables are just 'var'. Still, EjsS lets you select what type it should have, for convenience when connecting to view properties.) Algorithms look very much the same.
The View is a little bit more different, because not all view elements exist. But we tried our best to offer similar elements. I think you can easily get up and running by copying and pasting from existing Javacript+HTML examples.
Myself, whenever I want to port an existing Java simulation to the new Javascript+HTML flavour, I open the Java and the Javascript flavoured versions of EjsS side by side. The Java with the existing simulation, and the Javascript empty, and then copy or retype as much as possible. This works fine for the Model.
For the View, I typically start copying another existing Javascript example with a view similar to what I want to create.
It takes me sort of an hour, or less, but the result RUNS ON MY TABLET!
Francisco, Thanks so much for your reply. I am still confused though. What do you mean by the EjsS? I don't see the download for that on the download page.
http://www.um.es/fem/EjsWiki/Main/Download
Everything else you say makes perfect sense, I just need a starting point. Thanks Nick
EjsS is the new acronym for the good old boy EJS. Below is what I wrote in the Wiki main page. If you don't want to read it, the short version is that EjsS 5.0 is the new EJS.
Paco
Easy Java/Javascript Simulations, also known as EjsS (and, formerly, EJS or Ejs), is a free authoring tool written in Java that helps non-programmers create interactive simulations in Java or Javascript, mainly for teaching or learning purposes. EjsS has been created by Francisco Esquembre and is part of the Open Source Physics project.
A brief historical and naming remark: Before release 5.0, EjsS could only create Java simulations. Hence, its former name was "Easy Java Simulations" and its acronym just "EJS". Now, since release 5.0, EjsS can create (also) simulations that use Javascript and HTML5, and hence can be run on tablets and smartphones (see our Reader App). This major change explains why we have renamed EJS as Easy Java/Javascript Simulations, and its acronym is EjsS. You may still find many references to EjsS (even in this wiki) that use its old name.
So if I have EJS 5.0 (which I do) and I export an web version, (which I have tried but struggled with) I should be able to run it with out a security issue and on an iPad?
Make sure that, in the "Advanced options" tab of the EJS Console (not EJS, but its Console), you choose the "Programming language" to be "Javascript".
Then run EJS (or EjsS :-) ) and create a simulation with it. The simulation you export will be a purely Javascript+HTML one, so it runs on tablets.
To run on a tablet, you can either:
- Serve the simulation HTML page from a Web server, and then open the page (from the server) using the tablet browser.
- Use our EjsS Reader App. We now have ready the Android version of it. But the iPad version will be available in days (so we hope). See http://www.um.es/fem/EjsWiki/Main/ReaderApp