-
-
Notifications
You must be signed in to change notification settings - Fork 77
PG 2.20 Release Candidate #1231
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
Merged
+36,629
−21,535
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…write Fix a vulnerability in the Rserve code.
This requires a change to the `Statistics::R::IO::Rserve` package. The vulnerability is directly in that package as its `get_file` method allows the caller to pass an arbitrary local file name, and it will retrieve the remove file and save it to that file as long as the serve has write permission to do so. I have submitted a pull request to the GitHub repository for the `Statistics::R::IO` package that would work to preven that, and also emailed the author directly but have received no response. Furthermore, the package has not had any changes since 2017. So at this point I think that we are going to need to consider the `Statistics::R::IO` package unmaintained and move on from that package. As such this pull request adds PG's own implementation. It is pretty much the `Statistics::R::IO::Rserve` package, but all of the other things that aren't needed by WeBWorK and PG are removed. Since this is part of PG the `get_file` method can save to the requested file name using the `WeBWorK::PG::IO::saveDataFile` method which refuses to save anything outside of the html temporary directory. Note that this implementation does not use `Class::Tiny` or `Class::Tiny::Antler`, so those modules should be removed from the modules that are share to the safe compartment. That is done in the `conf/pg_config.dist.yml` file, but a separate pull request will be needed to do this for webwork2. It is not critical, the package is not dangerous to have shared. Just not needed. There are unit tests for both the `Rserve` package and the `RserveClient.pl` macro. Some of the tests require an R connection. Those tests are skipped if that is not available. The `r-base-core` and `r-cran-rserve` Ubuntu packages have been added to the docker build and the GitHub unit test action. Rserve is started by a docker entrypoint script, and in the GitHub action so that the tests are run in the docker container and the GitHub action.
Fix a typo in a GraphTool class name.
When creating the TeX output for DragNDrop hardcopy, update the logic to test if \linewidth is smaller than a configurable length, default of 300pt, to determine if multicols should be used or not. This removes the dependency on \nocolumns, and any layout which has a current \linewidth that is greater than or equal to the configured size will use multicols. This is done by defining a custom if statement \ifdndcolumns, then setting that to false/true depending on if \linewidth is less than $self->{multicolsWidth}, which defaults to 300pt.
The 'unload' event listener is deprecated, in addition since all javascript is stopped when the window unloads, it is unnecessary to also disconnect the mutation observer when the window unloads. This removes all the unload event listeners.
Change DragNDrop TeX logic on when to use multicols.
When creating the TeX output for DragNDrop hardcopy, update the logic to test if \linewidth is smaller than a configurable length, default of 300pt, to determine if multicols should be used or not. This removes the dependency on \nocolumns, and any layout which has a current \linewidth that is greater than or equal to the configured size will use multicols. This is done by defining a custom if statement \ifdndcolumns, then setting that to false/true depending on if \linewidth is less than $self->{multicolsWidth}, which defaults to 300pt.
A new approach in the makeZero method of Parser::BOP to turn each operand into an object of the correct type with nothing but zeros as entries, and then returns a product of the results. If it doesn't know how to make an all-zero version, it leaves it as multiplication by zero. This is used in the reduction rules '0*x' and 'x*0' to return a zero object of the product. Then differentiation of variables uses this process to take derivatives of variables treated as constants to allow taking derivatives of variables that represent Points, Vectors, and Matrices. Error messages are added if attempting to take a derivative of variables that are not numbers. This also corrects an issue to allow taking the derivative of a formula with a single variable without explicitly stating the variable via `$MO->D`. Fixes #1239.
Remove unload event listener from JavaScript.
Implement makeZero() for matrices (and other types).
The 'unload' event listener is deprecated, in addition since all javascript is stopped when the window unloads, it is unnecessary to also disconnect the mutation observer when the window unloads. This removes all the unload event listeners.
A new approach in the makeZero method of Parser::BOP to turn each operand into an object of the correct type with nothing but zeros as entries, and then returns a product of the results. If it doesn't know how to make an all-zero version, it leaves it as multiplication by zero. This is used in the reduction rules '0*x' and 'x*0' to return a zero object of the product. Then differentiation of variables uses this process to take derivatives of variables treated as constants to allow taking derivatives of variables that represent Points, Vectors, and Matrices. Error messages are added if attempting to take a derivative of variables that are not numbers. This also corrects an issue to allow taking the derivative of a formula with a single variable without explicitly stating the variable via `$MO->D`. Fixes #1239.
PGplot is a new method for generating dynamic graphs and can be used as a replacement for WWPlot and PGgraphmacros.pl. PGplot is a method to create a plot object and store information about a plot in multiple data objects. Since PGplot just stores data about the plot, the data can then be used to create multiple different outputs. Currently only TikZ pgfplots and GD (for testing) are supported.
This renames the PGplot object to Plots, and moves all the code from macros/ to lib/. This adds a new macro plots.pl that loads the core Plots::Plot object via the Plot method.
Mostly unpacking function calls, blessing objects in a single line, fixing perl calls, along with other code cleanup suggestions.
- answerUtils.pl -- seems to be old-style answers-- used in 1 OPL problem - contextPeriodic.pl - no code in it. Built into MathObjects.pl. - parserMultiPart.pl -replaced with Multianswer - parserQuotedString.pl - not documented and not in OPL - parserUtils.pl - old-style PG constants. Used only in 9 OPL problems. - PGcomplesmacros.pl: funcitonality built-in to mathobjects. Used in old-style problems. - PGcomplexmacros2.pl not used in OPL -- functionality may be in MathObject. - PGnumericevaluators - old style (pre-Mathobject) answer evaluators. Note: still listed in a lot of problems. > 1000 - PGsequentialmacros.pl - precursor to Scaffold.pl - weightedGrader.pl - this functionality is now built-in to the standard grader.
* Add 'JSXGraph' output for JSXgraph for html, which falls back to 'Tikz' output for hardcopy. This is now the default output. * Unless perl subroutines are used, JSXGraph will pass the functions to the client for generation. Generates faster and smoother graphs. * Standardize various output options to be consistent between JSXGraph and Tikz, such as which marks are available. * Update the Plots::Data function object to store MathObjects instead of perl subroutines. Only swap to perl subroutines when generating the data set from the function. This gives an option to just use the string of the function to pass data generation to the client via JSXGraph. * Since 'JSXGraph' doesn't support custom ticks list, make tick_delta the standard shown in examples. * POD cleanup and various other code cleanups discovered while testing changes. * Remove copyright from start of files. * Remove old pgplot name in favor of plots. * Added 'tikz_smooth' option to function graphs with tikz. By default this is on for functions and off for other datasets. * Added continue_left and continue_right options for graphing functions with JSXGraph for the function to continue either left of the minimum or right of the maximum. Allows for zooming and panning the graph. * Add JSXGraphOpts options to pass a hash reference of options to the various JSXGraph objects. * Added code so JSXGraph can fill between curves. * Use fill_min/fill_max vs fill_range to define a range to fill. * Add aria description and title to JSXGraph. Ensure plot options sent to the image function update the plots object.
These options control if ticks numbers are shown or if tick lines are shown. This allows disabling all ticks if needed.
* Refactors how functions are stored to allow using two variable functions for vector fields. * Adds the ability to use function strings with PGF formulas for TikZ output. This is now the default with TikZ output, instead of generating the points using perl. In addition this allows generation of vector fields with TikZ. * Add the add_vectorfield function to the Plots::Plot object to allow creating of vector fields for both JSXGraph and Tikz output. * Update VectorField2D.pl to use this if provided a Plots::Plot object.
* Save a single copy of the current context in the Plots::Plot object, then pass it to all functions to use to create their math objects. This avoids modifying the actual context and a single copy is used vs each function needing to create their own copy. * Since f(x) = 0 is a valid function, function string tests need to explicitly test that the string is not '', vs just testing it is true. * Disable highlighting of elements on mouse over by default. * Use JSX.merge to merge user options jsx_options vs having them have to supply all options for sub hashes. * Name the options for TikZ and JSXGraph, tikz_options and jsx_options to match style of other options. * Remove the title from the graph, the title option now only sets the ARIA label. * Add a CSS file htdocs/js/Plots/plots.scss to control the style of the JSXGraph box. * Add an option jsx_navigation that turns on zooming and panning, and also shows the navigation buttons. Disabled by default. * Update the $plots->axes->set and $plots->axes->get methods to send anything that doesn't start with an x or y to the $plots->axes->style. This allows configuring the axes in a single call. In addition pass all options sent to the Plots() method to $plots->axes->set, so the axes can be configured with the initial call to Plots(). * POD updates. * Fix calls to `$main` by wrapping them in an eval statement.
Also, don't add prefixed css (like `-webkit-border-radius`). Autoprefixer adds any of those that are needed. Note that this one is not added because it actually isn't needed anymore (unless we really want to support really old browsers).
Add a white background to pgplot TikZ output.
pdfplot doesn't included a 'background' layer used for the framed background, which causes a conflict with fillbetween. This redefines the `standard` and `axis on top` layers and adds the background layer so it can be used to draw the framed background.
Since JSXGraph didn't support custom ticks as well, remove it. Now the only way to configure the ticks is either via tick_num or tick_delta. Also in JSXGraph only show zero on the axis if the axis is not located at zero, or if jsx_navigation is set.
Clean up the `addToPreamble` call.
66% of minimum 1% translated source file: 'pg.pot' on 'el'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format
…f13c61 Updates for file lib/WeBWorK/PG/Localize/pg.pot in el [Manual Sync]
…0048f2 Updates for file lib/WeBWorK/PG/Localize/pg.pot in he_IL [Manual Sync]
…9bc1ea Updates for file lib/WeBWorK/PG/Localize/pg.pot in cs_CZ [Manual Sync]
…cb1668 Updates for file lib/WeBWorK/PG/Localize/pg.pot in es [Manual Sync]
…80e0bf Updates for file lib/WeBWorK/PG/Localize/pg.pot in ko [Manual Sync]
…5ad772 Updates for file lib/WeBWorK/PG/Localize/pg.pot in ru_RU [Manual Sync]
…9dfc2b Updates for file lib/WeBWorK/PG/Localize/pg.pot in de [Manual Sync]
…0385d9 Updates for file lib/WeBWorK/PG/Localize/pg.pot in fr [Manual Sync]
…e30cf1 Updates for file lib/WeBWorK/PG/Localize/pg.pot in zh_HK [Manual Sync]
…362c87 Updates for file lib/WeBWorK/PG/Localize/pg.pot in hu [Manual Sync]
…1266f2 Updates for file lib/WeBWorK/PG/Localize/pg.pot in tr [Manual Sync]
…30f926 Updates for file lib/WeBWorK/PG/Localize/pg.pot in zh_CN [Manual Sync]
Restructire the POD of macros (ui)
Restructire the POD of macros (parsers)
Restructire the POD of macros (graph)
Restructire the POD of macros (core)
…allaneous Restructire the POD of macros (miscallaneous)
…ith-units Fix the `DiffCalc/AnswerWithUnits.pg` sample problem.
Restructire the POD of macros (answers)
Restructire the POD of macros (math)
…-graph-tool Fix a warning in the `TriangleGraphTool.pg` sample problem.
Reverted comment changes
…exts Restructire the POD of macros (contexts)
only use parentheses (not brackets) for Formula strings
somiaj
approved these changes
Jul 22, 2025
Alex-Jordan
approved these changes
Jul 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Re-target pull requests that you want in the release for this branch.