Closed samreid closed 10 months ago
Are you trying to add parameters to this PhET sim? https://phet.colorado.edu/sims/html/projectile-motion/latest/projectile-motion_all.html
so the URL you want to use is: https://phet.colorado.edu/sims/html/projectile-motion/latest/projectile-motion_all.html?sim=projectile-data-lab&projectileData
Are you then trying to launch CODAP with that sim with those URL parameters? If so, are you using this? https://codap.concord.org/app/static/dg/en/cert/index.html?di=https://phet.colorado.edu/sims/html/projectile-motion/latest/projectile-motion_all.html?sim=projectile-data-lab&projectileData
I believe it will work if you encode the di parameter so that you launch codap with this instead: https://codap.concord.org/app/static/dg/en/cert/index.html?di=https%3A%2F%2Fphet.colorado.edu%2Fsims%2Fhtml%2Fprojectile-motion%2Flatest%2Fprojectile-motion_all.html%3Fsim%3Dprojectile-data-lab%26projectileData
Excellent, thanks so much! We confirmed that encoding &
as %26
works well in our case. Thanks @ddamelin. I'll add some commits to enable the query parameters, then close this issue.
Pushed, and added documentation about the constraints. Closing.
@matthew-blackman and I observed that when trying to launch with ?sim=projectile-data-lab&projectileData, CODAP was ignorning the subsequent query strings. We ran an experiment by passing ?a&b&c and it only takes ?a. The problem is here where CODAP uses SproutCore to parse the URL:
https://github.com/concord-consortium/codap/blob/c5ad3e28c254deab3fb5a7e604be47a3f7efc045/apps/dg/components/game/game_view.js#L77-L83
It gets truncated like this: