Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Version of JSX Graph possible in future releases? #1169

Open
MuellerAle opened this issue Apr 18, 2024 · 8 comments
Open

New Version of JSX Graph possible in future releases? #1169

MuellerAle opened this issue Apr 18, 2024 · 8 comments

Comments

@MuellerAle
Copy link

We use a lot of JSX Graphs in STACK questions. We would be interested to use the new features "vector fields" and "implicit functions" which are implemented in newer JSX versions. Is it possible to update JSX graph to 1.7?

@sangwinc
Copy link
Member

We're preparing a new version of STACK and I think that's a reasonable request. We updated JSXGraph to 1.8 for the next release already, see
e5fa06e
Thanks for making this request though - I don't always notice a new release of JSXGraph and you're right to prompt for us to bump it.
Chris

@aharjula
Copy link
Member

aharjula commented Apr 18, 2024

If your STACK is 4.4.3 or newer you can do one of two things:

  1. If you want to change the whole install to use a particular version of JSXGraph you could simply change the files (jsxgraphcore.min.js and jsxgraph.min.css) in question/type/stack/corsscripts/ to something newer and hope that things work everywhere. You could, for example, simply copy them from the dev branch where they are fresh. Basically, those are files directly from the official JSXGraph release; no modifications are required for their content.
  2. The less radical solution would be to use the override features of the [[jsxgraph]]-block for those graphs that need to test future features:
[[jsxgraph ... overridejs="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.8.0/jsxgraphcore.min.js"
               overridecss="https://cdnjs.cloudflare.com/ajax/libs/jsxgraph/1.8.0/jsxgraph.min.css"]]
         ....
[[/jsxgraph]]

You can try addresses to any version you want, we don't guarantee that they work but in general JSXGraph is very stable and seems to work and this is the mechanism that we recommend for those that want to push forward while STACK lags behind. Both now and in the future. It is also the mechanism to use should one really really want to freeze JSXGraph to a given version.

Naturally, remote addresses will only work when accessible, and they may stop being so at any time... But that is a separate problem.

@MuellerAle
Copy link
Author

Great, thank you both so much!

@LukeLongworth
Copy link
Contributor

@sangwinc STACK's JSXGraph is a few versions behind again - you mentioned above to prompt you about this so I am :)

We have found a bug to do with bounding boxes being wrong when the graph is generated out of sight (such as inside a [[hint]] block or - even more confusingly - in a background tab sometimes). This seems to have been fixed between 1.8.0 and 1.10.1, we think in 1.9.2.

@sangwinc sangwinc reopened this Dec 13, 2024
@sangwinc
Copy link
Member

Thanks @LukeLongworth, I'm very happy to keep JSXGraph updated. How urgent is the upgrade?

The scripts are here: https://github.com/maths/moodle-qtype_stack/tree/master/corsscripts
If you need a release with an update immediately, we can consider that.

Can you help sort this out?

@LukeLongworth
Copy link
Contributor

Kia ora @sangwinc,

Not urgent at all, we have an easy (if a bit hack-y) fix on our end that will keep our questions operating fine until we next upgrade our local install.

I'll be on Christmas leave for the next few weeks, but I can help out in early January. What needs to be done to update JSXGraph? Anything aside from changing the jsxgraph.min.css and jsxgraphcore.min.js files (and presumably checking that things still work)?

@aharjula
Copy link
Member

aharjula commented Dec 16, 2024

Sorry, been busy, again.

The process is as it was the last time I made such commit which did not make it to the point release:

  1. Those two files need to be replaced. Direct copies from the CDN version work fine, no more custom builds.
  2. Then add frozen CDN URLs to the named version map in stack/cas/castext2/blocks/jsxgraph.block.php.
  3. Test that the healthcheck example works, the binding in particular and the render of the formula.
  4. Test the binding in more detail by checking that samplequestions/stack_jxg.binding-demo-4.4.xml still does sensible things.
  5. If all looks good and keeps looking good after Moodle JavaScript reset, NOOP edit of question to recompile it and running in private-mode/incognito-mode to ensure that things are new and not coming from any cache. Then things should be fine.
  6. If one has Meclib materials, then more testing with them is naturally recommended.

@aharjula
Copy link
Member

One does not need to touch any STACK code to test new JSXGraph versions. One can always just state that a particular [[jsxgraph]] block should use the official CDN version by setting [[jsxgraph version="cdn"]] or any specific other versions by tuning [[jsxgraph overridecss="..." overridejs="..."]] separately. Then, one can test if things work, but then one needs to check that one is testing with the correct version every time one tests...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants