Skip to content

Update the webwork version check approach.#2982

Closed
drgrice1 wants to merge 1 commit into
PreTeXtBook:masterfrom
drgrice1:update-webwork-version-check
Closed

Update the webwork version check approach.#2982
drgrice1 wants to merge 1 commit into
PreTeXtBook:masterfrom
drgrice1:update-webwork-version-check

Conversation

@drgrice1

Copy link
Copy Markdown
Contributor

The current method makes a request to the deprecated html2xml endpoint to get the version. Then falls back to retrieving and parsing the HTML for the landing page. The problem with that approach is that the html2xml endpoint will eventually be removed. Most likely this will happen with the next release of WeBWorK. See openwebwork/webwork2#3034.

So this switches to first making a request to the render_rpc endpoint. If that returns a 200 okay response, then get the version from the response. Otherwise fall back to the html2xml endpoint and attempt to get the version from that response. If that still fails, then try the landing page approach.

The render_rpc request will work for version 2.18 or newer of webwork2. The fallback html2xml request will only work for webwork 2.17. Any older version will not even send the ww_version in the html2xml request, so the landing page fallback approach is the only thing that could possibly work.

@Alex-Jordan

Copy link
Copy Markdown
Contributor

Thanks! I'm sure this is good, but can't test until roughly July 7. There is some stuff in doc/guide about setting up a WW server for PTX purposes, and it instructs everyone to enable html2xml. That should also be updated to only do that for when your WW server is 2.17.

@drgrice1

Copy link
Copy Markdown
Contributor Author

Okay. I will update that.

@drgrice1 drgrice1 force-pushed the update-webwork-version-check branch from bad7ae5 to aad84c2 Compare June 27, 2026 00:48
@drgrice1 drgrice1 force-pushed the update-webwork-version-check branch from aad84c2 to 425bb53 Compare June 27, 2026 00:51
@drgrice1

drgrice1 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Actually, the only reference to the html2xml endpoint in the doc/guides directory is in the doc/guides/publisher/webwork.xml file, and it is regarding the setup for the Access-Control-Allow-Origin header. The 2.17 setup for that obviously won't change. The 2.18 setup shouldn't change either. That does not affect the request from the webwork.py script, and the 2.18 javascript is still setup to use the html2xml endpoint, and so it still needs the html2xml setup for that. The 2.19 setup already says to use the render_rpc endpoint and leave the html2xml part commented out. There is no 2.20 setup instructions (although that would be the same as for 2.19). So I don't think a change is needed for that file.

@rbeezer

rbeezer commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Thanks, @drgrice1! I'll be able to study this closer in a couple of days.

@rbeezer

rbeezer commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks again, @drgrice1! I like it, and so does Claude. Thanks for getting this our in front of upcoming changes.

Tested against current server at AIM, and results look good based on the new endpoint.

Merged as-is with minor edits to commit message.

@rbeezer rbeezer closed this Jun 30, 2026
@drgrice1

Copy link
Copy Markdown
Contributor Author

Darn! I know you are particular about the commit messages, and so I tried to figure out what it should be based on the existing commit messages. It should have been a prefix of WeBWorK not Python.

@rbeezer

rbeezer commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

No problem! It was a good guess. Script or WeBWorK. A toss-up. Thanks for trying.

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

Successfully merging this pull request may close these issues.

3 participants