phetsims / forces-and-motion-basics

"Forces and Motion: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/forces-and-motion-basics
GNU General Public License v3.0
7 stars 10 forks source link

Instrument the toolboxes for the motion screens #215

Closed samreid closed 7 years ago

samreid commented 7 years ago

@kathy-phet said:

I could not figure out how to get rid of the now empty boxes.

image

@kathy-phet wants to use this for a paper, so we will need a new version on the public phet-io site. I'll publish a version there with instrumented toolboxes and give @kathy-phet a link so she can use the instance proxies to generate a new HTML file. Then she can give the the file and I can post it somewhere, probably on the phet-io site. @mattpen can you recommend a good place for this? Context is below:

On 11/11/2016 3:37 PM, Sam Reid wrote:

It appears like it runs. I tried saving it and opening it in the browser and I was able to push the box.

It could be that those boxes are not instrumented for PhET-iO. How soon do you need this by? Do you need it in a permanent or temporary location?

Best Regards, Sam

On 11/11/16 4:00 PM, Kathy Perkins wrote:

It's not a huge rush, working on a paper. It would be good to have a temporary link sometime next week to include in the paper for review, and then we would need something more permanent down the road after the paper is reviewed.

K

Also, it will be up to @kathy-phet to decide how much QA to put toward testing this customized version. The sim has been under development during the classroom activity wrapper, and phet-io has been in flux lately too.

samreid commented 7 years ago

Unfortunately the crate is a child of the left toolbox, so making the toolbox invisible also makes the crate invisible.

Possible solutions:

  1. Make the objects not children of the toolboxes. This would be a significant rewrite, but perhaps better in the long run. I probably wouldn't be able to get this done, bug free and passing QA this week without help.
  2. Provide methods on Rectangle to setFill(null) and setStroke(null). The simplest variant of this would require a few lines of phet-io code to complete @kathy-phet's customization. The more complex generalization would be to add color pickers to instance proxies for every stroke and fill. Wiring either of these up through instance-proxies would be a lot of work.
  3. Create a sim-specific query parameter that sets the stroke and fill of the toolboxes to null. This may be the simplest short-term solution. But @kathy-phet wouldn't be able to say that the customization was achieved by calling existing phet-io API methods. (not sure if that is important or not).

Tagging @andrewadare and @zepumph in case they have other recommendations.

samreid commented 7 years ago

Also tagging @zepumph and @mattpen to review the preceding commit which instruments the toolboxes.

samreid commented 7 years ago

The custom sim query parameter seemed like a good enough solution for now, use showItemToolboxes=false to disable the item toolboxes.

However, I tried launching this in instance proxies and was met with a number of exceptions when pushing "launch." Will require further investigation.

mattpen commented 7 years ago

@mattpen can you recommend a good place for this?

I'd suggest making a new directory for small examples used in research, especially if we plan on serving further examples like this from phet-io.colorado.edu.

Perhaps /research/{{name-of-kathy's-paper}}/ or /examples/{{name-of-kathy's-paper}}/? If either of those works for you @samreid I can create the directory and make sure it has the appropriate permissions. Would this directory need to be public, or should it be protected with the .htpasswd file?


Also tagging @mattpen to review the preceding commit which instruments the toolboxes.

https://github.com/phetsims/forces-and-motion-basics/commit/33bdd01ec83fd87e9925d9a61b540e480820222b looks fine to me. I'm not intimately familiar with the instrumentation process yet, but I don't think it will have any negative effects on the classroom-activity wrapper

samreid commented 7 years ago

I like your suggestions because they would lead to easy-to-read URLs (may be important for a printed publication) but also wanted to brainstorm putting it in:

phet-io.colorado.edu/sims/forces-and-motion-basics/1.2.3-phetio/wrappers/{{name-of-paper}}

That is, putting it adjacent to the version of the sim it uses, and publishing it as a wrapper. Thoughts?

kathy-phet commented 7 years ago

I will almost certainly create a tinyurl that links to whatever directory we put this example in. I do believe we will make more examples for public sharing through papers or talks.

The classroom FAMB activity wrapper will also need to have a public copy available for this same book.

I guess I would lead towards a structure like Matt was suggesting, just because if we find a bug and then need to republish, we could publish it at the same web address (that is we could publish over the existing original copy). Where as with Sam's structure that is not as possible. Thoughts?

samreid commented 7 years ago

I will almost certainly create a tinyurl that links to whatever directory we put this example in. I do believe we will make more examples for public sharing through papers or talks.

http://phet-io.colorado.edu/examples/crate

Seems more professional and usable than: http://tinyurl.com/phet-io-crate-example

For instance, having the URL of our website will help people find our homepage.

I guess I would lead towards a structure like Matt was suggesting, just because if we find a bug and then need to republish, we could publish it at the same web address (that is we could publish over the existing original copy). Where as with Sam's structure that is not as possible. Thoughts?

On phet-server, we have a redirect (or rewrite?) rule that points the sim pages at the latest version of a simulation. Perhaps that would be suitable here, as a way we can publish bugfixes without having to delete/overwrite previous versions?

mattpen commented 7 years ago

On phet-server, we have a redirect (or rewrite?) rule that points the sim pages at the latest version of a simulation. Perhaps that would be suitable here, as a way we can publish bugfixes without having to delete/overwrite previous versions?

Does this mean we would need to republish example wrappers for research papers with every production deploy?

kathy-phet commented 7 years ago

For instance, having the URL of our website will help people find our homepage.

I agree and like your URL.

Does this mean we would need to republish example wrappers for research papers with every production deploy?

No - I think only republish if we find a bug that we didn't originally see that is hampering the example, or because it starts to break because of some change in browsers or something. These examples will not be maintained like our current sims are.

I'd also be fine with placing a redirect at http://phet-io.colorado.edu/examples/crate that points to the version we want them to use in another directory.

mattpen commented 7 years ago

I think only republish if we find a bug that we didn't originally see that is hampering the example

I agree that this would be ideal. However, if the link you use is something like phet-io.colorado.edu/sims/forces-and-motion-basics/latest/wrappers/name-of-paper, then it would necessitate recreating the example every time we publish the phet-io sim. Is this what you meant @samreid?

Or did you mean that we create a symlink such that phet-io.colorado.edu/examples/name-of-paper returns the file at phet-io.colorado.edu/sims/forces-and-motion-basics/1.2.3-phetio/wrappers/{{name-of-paper}} and we just change that symlink if we republish? This seems more difficult to maintain as we already need to recreate and copy over a new example created in instance proxies, why not just put it in this location to begin with?

samreid commented 7 years ago

However, if the link you use is something like phet-io.colorado.edu/sims/forces-and-motion-basics/latest/wrappers/name-of-paper, then it would necessitate recreating the example every time we publish the phet-io sim. Is this what you meant @samreid?

I understand the problem you are referring to. I don't think we should implement phet-io.colorado.edu/sims/forces-and-motion-basics/latest/ yet.

why not just put it in this location to begin with?

After discussion, that sounds good to me! We will just need to make sure we have a reasonable way to maintain the wrapper for maintenance releases, but I'm not worried about that.

samreid commented 7 years ago

The launch problem is solved in https://github.com/phetsims/phet-io/issues/866. Now I can publish a version for @kathy-phet to review and create a customized HTML wrapper.

samreid commented 7 years ago

I also had to address https://github.com/phetsims/phet-io/issues/867. Now that's done, here's a version @kathy-phet can use to create a customized version:

http://www.colorado.edu/physics/phet/dev/html/forces-and-motion-basics/2.1.7-phetiodev.2/wrappers/instance-proxies/instance-proxies.html?launchLocalVersion&showItemToolboxes=false

Note I have already appended &showItemToolboxes=false

It would be good to have a temporary link sometime next week to include in the paper for review

@kathy-phet can you use that link to generate an HTML file for your paper? This is just a dev version, we will need to create a version on the phet-io site for your real paper.

zepumph commented 7 years ago

Unassigning. @samreid let me know if you want any help if @kathy-phet comes back with anything to do.

kathy-phet commented 7 years ago

I made a new exemplar using the proxies here. Seems to work great. Can we post this example to phet-io in a public place? Was there a consensus on the directory structure for these public facing examples in papers? etextbook_code.txt

kathy-phet commented 7 years ago

@samreid @mattpen @zepumph - Not sure who would take this on?

samreid commented 7 years ago

In https://github.com/phetsims/forces-and-motion-basics/issues/215#issuecomment-260992232 we decided on the basic URL structure, but it would be helpful to know from @kathy-phet a "nickname" for the customized simulation that you would want to appear in the URL. It would be great for @mattpen to post this, if he is available.

kathy-phet commented 7 years ago

@mattpen, Can you please put Sam's file "etextbook_code.txt" above, here? https://phet-io.colorado.edu/examples/etextbook_friction

Thanks!

mattpen commented 7 years ago

@samreid - I've uploaded this to https://phet-io.colorado.edu/examples/etextbook_friction/, but it is currently failing, due to libraries linked from spot. Do you know how to recreate the sim such that it points to phet-io.colorado.edu instead?

image

samreid commented 7 years ago

It looks like I should publish a production version from the same shas, I'll work on that shortly.

samreid commented 7 years ago

We'll publish to 2.1.7-phetio from the 2.1-phetio branch.

samreid commented 7 years ago

I created branch 2.1-phetio-etextbook-friction since 2.1-phetio branch was already up past 2.2.

samreid commented 7 years ago

New version published here: https://phet-io.colorado.edu/sims/forces-and-motion-basics/2.1.7-phetio/wrappers/index/

samreid commented 7 years ago

@mattpen can you please update the links in /Users/samreid/github/phet-io-website/root/examples/etextbook_friction/index.html to point to the files in https://phet-io.colorado.edu/sims/forces-and-motion-basics/2.1.7-phetio/wrappers/index/ then redeploy and test it?

mattpen commented 7 years ago

The new version has been deployed to https://phet-io.colorado.edu/examples/etextbook_friction/ and is working without errors.

mattpen commented 7 years ago

Tagging @kathy-phet so that she is aware that the exemplar has been redeployed. This issue appears to be complete, closing.