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

Update the AppletObjects.pl macro for changes in the ADD_JS_FILE usage #549

Merged
merged 2 commits into from
Mar 22, 2021

Conversation

drgrice1
Copy link
Member

This adds the js prefix to the location of the javascript files added by AppletObjects.pl via ADD_JS_FILE.

This should be merged if and only if openwebwork/webwork2#1258 is merged.

Add the usage of ADD_JS_FILE and ADD_CSS_FILE to the parserGraphTool.pl
macro.
@drgrice1 drgrice1 changed the base branch from master to develop March 18, 2021 02:57
@taniwallach taniwallach self-requested a review March 19, 2021 00:02
@taniwallach taniwallach added this to the PG-2.16 milestone Mar 19, 2021
@drgrice1
Copy link
Member Author

@taniwallach: I don't really think this one needs that much testing. It is a pretty straightforward change.

Copy link
Member

@taniwallach taniwallach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this PR and openwebwork/webwork2#1258 active - the 3 files are all loaded properly when I tested Library/CSUOhio/appletDemonstrationProblems/DerivativeDraw11.pg a random OPL problem using AppletObjects.pl. That problem has a flash applet - so the applet itself does not work, but that was not what needed to be tested.

@taniwallach
Copy link
Member

Ready to merge once openwebwork/webwork2#1258 is merged.

@taniwallach
Copy link
Member

I'm recommending adding minor changes to the documentation in PG.pl via drgrice1#1 to address what @pstaabp reported in openwebwork/webwork2#1258 (comment) .

Copy link
Member

@taniwallach taniwallach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend the patch to the PG.pl documentation (in the comments regarding ADD_CSS_FILE and ADD_JS_FILE) be added, as they also relate to the changes made in openwebwork/webwork2#1258 and I don't see any reason to make a separate PR for that.

accept an additional argument that determines if the first argument is a
file located in the htdocs directory or an external url.  The
documentation is updated.  This documentation is now proper POD.
@drgrice1 drgrice1 requested a review from taniwallach March 21, 2021 17:28
Copy link
Member

@taniwallach taniwallach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my last commit I reversed the polarity of that second argument. So now if the argument is 0 (or not given) then it is assumed to be in the htdocs directory. Furthermore, I added that argument to the ADD_CSS_FILE method. This maintains the usage of the ADD_CSS_FILE method from before, and makes the ADD_JS_FILE usage consistent with that as you were expecting.

I just tested quickly with the revised version of this and the changes to webwork2 made in openwebwork/webwork2#1258 (the quote above is taken from the discussion there).

I think the revised default to assume additions come from htdocs is a good decision for both functions in PG. Thanks @drgrice1 and thanks for making the POD documentation.

I think this pair of PRs are ready to merge.

@pstaabp pstaabp merged commit 4eed4b7 into openwebwork:PG-2.16 Mar 22, 2021
@drgrice1 drgrice1 deleted the fix-applet-add-js-file branch March 22, 2021 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants