PhET-iO with self-hosted sims

78 views
Skip to first unread message

Alberto Corbi

unread,
Jun 3, 2021, 9:19:17 AM6/3/21
to Developing Interactive Simulations in HTML5
Hi! How would one use (for debugging, testing…) PhET-iO with a localhost served sim?

Thanks in advance.

cmalley

unread,
Jun 4, 2021, 10:52:04 AM6/4/21
to Developing Interactive Simulations in HTML5

Your question is very broad, but I’ll try to give some general guidance.

Most of the PhET team uses the Chrome browser for debugging and development. Information about Chrome DevTools can be found at https://developer.chrome.com/docs/devtools/.

Assuming that you have a local web server running…

If you created your simulation using the instruction in the PhET Development Overview (https://github.com/phetsims/phet-info/blob/master/doc/phet-development-overview.md#creating-a-new-sim) then there will be a .html file at the top-level of your repository that you can use for development and debugging.  For example, the .html file for Natural Selection is https://github.com/phetsims/natural-selection/blob/master/natural-selection_en.html.  Do not edit this file manually.  If you add dependencies to package.json, you make need to run ‘grunt update’ . But otherwise, you can just open this file with your web browser to run the simulation.

It’s highly recommended to run with the ?ea query parameter added to the URL. This enables assertions. If you’re not familiar with the use of assertions, do a Google search, there are lots of good general references. Running with assertions enabled will verify that you’re not violating conditions of various PhET libraries. If you violate a conditions, you'll get an Error in the browser console.

For general debugging, you can put debugger; statements in your code to set breakpoints, then step through code in Chrome DevTools. Again, debugger is a general tool, do a Google search for more information. 

That should get you started. If you have other specific questions, this is the place to ask!

Chris Malley
PixelZoom, Inc.

Alberto Corbi

unread,
Jun 4, 2021, 1:11:03 PM6/4/21
to Developing Interactive Simulations in HTML5
Thank you Chris…

More than debugging, what I meant was interfacing with a locally-served PhET sim just like in the example:

and being able to read logging messages about the student interaction with the sim. 

Is this possible from a technical and legal point of view. From what I've read, PhET-iO requieres an ad hoc licence… correctly?

Thanks again and warmest greetings from Spain.

Alberto.

cmalley

unread,
Jun 5, 2021, 3:16:08 PM6/5/21
to Developing Interactive Simulations in HTML5
Thanks for clarifying! Yes, PhET-iO is a licensed product.  PhET licensing information can be found at https://phet.colorado.edu/en/licensing.  Since this is more of a "legal" question than a "development" question, I recommend that you send your question directly to phe...@colorado.edu and/or phet...@colorado.edu.

Chris Malley
PixelZoom, Inc.

Reply all
Reply to author
Forward
0 new messages