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

PG 2.18 #814

Merged
merged 504 commits into from
Jul 20, 2023
Merged

PG 2.18 #814

merged 504 commits into from
Jul 20, 2023

Conversation

drgrice1
Copy link
Member

This is the release candidate. Pull requests that are desired to be in the release should be target on this branch.

drgrice1 and others added 12 commits April 16, 2023 11:21
The primary advantage of this perl script over the previous shell script
is that it used File::Find instead of relying on the extglob, globstar,
and nullglob shell options.  Those options are not supported by all
shells.

If this script is run with no arguments, then it does the same thing
that the previous shell script did, and runs perltidy on all .pm, .pl,
and .t files in the PG_ROOT directory.

If file names are passed on the command line, then perltidy is only
executed on the passed filenames.  Another advantage of this script over
the previous shell script.

The script enforces the use of the .perltidyrc file in the PG_ROOT
directory.  It also makes the default for -bext to be '/', which means
that backup files are created with the .bak extension, and deleted if no
errors occur.  That can be overridden if backups are desired.  Other
that those things, all options accepted by perltidy are also accepted by
this script.

One other thing that this script does is enforces that the version of
perltidy used is version 20220613 or newer.  Older versions have an
issue with the -vxl='q' option.
Note that there is no long form like --verbose.
and to allow update and get operations. The webwork2 side
will now store this in a special field.
Includes changes and suggestions from Dr. Glenn Rice.
See: #809
Update the drag handlers for the graphtool graph objects.
Help messages are displayed as the user interacts with the graph tool.

The bootstrap tooltips have been removed.  Instead those use the new
help message box.  The tooltip messages are also bit more descriptive of
the tool.

Instead of bootstrap modal dialogs for confirming object deletion or
clearing the board, a sort of dialog in the content of the message box
is used.

Button styles were added to replace the bootstrap button styles.

This makes the graph tool no longer dependent on bootstrap.
When clicked the button disables help for all graphtool graphs.  The
setting is saved in local storage and so persists.  If clicked again,
then help is enabled.
Switch back to the reverted new method for the mq-editor toolbar focus.
Add a dynamic help system to the graph tool.
Update mathview to not use jQuery and to use modern javascript.
Replace bin/run-perltidy with bin/run-perltidy.pl
Convert LaTeX hardcopy to use the exam document class
@drgrice1 drgrice1 changed the title Pg 2.18 PG 2.18 Apr 20, 2023
drgrice1 and others added 17 commits April 21, 2023 15:26
Pull requests to the release candidate should run at least.
Run workflows on all pull requests.  Not just those to main or develop.
The timeout that sets the toolbar opacity to 1 to start the css
transition to its visible state can be called when the toolbar has
already been removed.  To see this click in a MathQuill input, then
click on some other application beside the browser while the toolbar is
still visible (and the toolbar will disappear), and then click somewhere
in the browser window but not in the MathQuill input.  You will see a
console error.  It is rather minor and doesn't hinder functionality, but
still don't want a console error.
This option changes the way coordinate hints are shown.  By default the
coordinates are displayed as decimal numbers accurate to five decimal
places.  If this is set to 'fraction', then those decimals will be
converted and displayed as fractions.  If this is set to 'mixed', then
those decimals will be converted and displayed as mixed numbers.  For
example, if the snapSizeX is set to 1/3, then what would be displayed as
4.66667 with the default 'decimal' setting, would be instead be
displayed as 14/3 with the 'fraction' setting, and '4 2/3' with the
'mixed' setting.  Note that these fractions are typeset by MathJax.
These do the same as the coordinateHintsType option but only for one
coordinate.  By default these are undefined.  If undefined then the
coordinateHintsType option is used for the coordinate.
This adds a button to the essay textarea that when clicked opens a
collapse below the text area.  The collapse contains a MathQuill entry
box and an insert button.  The user can type equations in the MathQuill
entry, and then click "Insert" to inject latex wrapped in `\(` and `\)`
into the essay textarea at the current cursor location.

This is perhaps not quite as nice as the usual MathQuill answer box for
regular input type text answers, but at least provides something for
essay type answers.  This is vaguely similar to what MathView does for
essay type answers.

Note that PG already adds hidden latex MaThQuIlL_AnSwEr00?? blanks for
essay answers.  Previously those were ignored as the corresponding
AnSwEr00?? blank is not of type text and doesn't have the codeshard
class.  That hidden field is used to identify the textareas in
combination with the latexentryfield class that essay answers have.
However, unlike regular text type inputs nothing is actually saved in
the hidden latex field.
cursor when the textarea does not have focus and the equation editor
does.
anything into the essay textarea when 'Insert' is clicked.
This removes the third-party-assets.json file, and the contents of that
file are no longer added to the static-assets.json file.  Instead the
frontend (webwork2 or otherwise) should load the package.json file and
use that to determine how to serve any file located in node_modules.

Note that a version tag is added to mathquill in the package.json file
to lock the specific commit of mathquill to use.  The tag for PG-2.18 is
WeBWorK-2.18.  Previously a tag for 2.17 was added.  If a hotfix is
needed for mathquill, then we will append a subversion to ensure that
browser caching is avoided.
Bump yaml and cssnano (#820 for the release candidate)
Add a coordinateHintsType option to the graph tool.
Give essay answers a MathQuill equation editor.
Revised handling of PERSISTENCE_HASH data
pstaabp and others added 28 commits July 6, 2023 15:28
…le things more dynamically.

Instead of reading macro files from the YAML file, use
POD::Simple::Search to locate them.  All macro files that contain POD
will be in the list it creates.

Instead of saving sample problem metadata in a YAML file, that is
retrieved on the fly.  Reading metadata is fast.  pandoc is what slows
parsing down.  Since reading metadata doesn't do that part, it is fast.

The module now only deals with the things that are shared by the
parse-problem-doc.pl script (no more prob), and webwork2's rendering.
Update WeightedGrader.pg and fix DraggableSubsets.pg
PGalias.pm does not emit a warning if `probFileName` is not set.
Furthermore, if it is not set, then it does not attempt to search for
resources in the directory containing the problem file. It still
searches the other locations in the htmlPath or imagesPath arrays.  Note
that for webwork2 these come from the `$pg{directories}{htmlPath}` and
`$pg{directories}{imagesPath}` settings defined in defaults.conf and
include the course's html url and the webwork2 htdocs url.  For the
standalone renderer these are defined in `conf/pg_config.yml`.

Also, PGresource.pm does not emit a warning in this case either.
PGresource.pm doesn't actually need it for anything other than in a
string for the unique id.  The empty string will work fine for this
(which is what PGresource.pm gets from PGalias.pm for this).

With the following links you will see warnings with the current PG-2.18
branch, and not with this pull request.

Here is a html2xml link with a uri encoded TikZ problem for testing:
`http://localhost:3005/webwork2/html2xml?courseID=anonymous&userID=anonymous&course_password=anonymous&answersSubmitted=0&showSolutions=1&displayMode=MathJax&outputformat=simple&problemSeed=2&uriEncodedProblemSource=DOCUMENT%28%29%3B%0A%0AloadMacros%28%27PGstandard.pl%27%2C%20%27PGML.pl%27%2C%20%27PGtikz.pl%27%29%3B%0A%0A%24a%20%3D%20random%28-10%2C%209%29%3B%0A%24b%20%3D%20random%28-10%2C%209%29%3B%0A%0A%24graph_image%20%3D%20createTikZImage%28%29%3B%0A%24graph_image-%3EtikzLibraries%28%27arrows.meta%27%29%3B%0A%24graph_image-%3EtikzOptions%28%27x%3D0.6cm%2Cy%3D0.6cm%27%29%3B%0A%0A%24graph_image-%3EBEGIN_TIKZ%0A%5Ctikzset%7B%3E%3D%7BStealth%5Bscale%3D1.8%5D%7D%7D%0A%5Cfilldraw%5Bdraw%3Dblue%2Cfill%3Dwhite%2Crounded%20corners%3D14pt%2Cthick%2Cuse%20as%20bounding%20box%5D%20%28-11%2C-11%29%20rectangle%20%2811%2C11%29%3B%0A%5Cbegin%7Bscope%7D%0A%09%5Cclip%5Brounded%20corners%3D14pt%5D%20%28-11%2C-11%29%20rectangle%20%2811%2C11%29%3B%0A%09%5Cdraw%5Bline%20width%3D0.2pt%2Ccolor%3Dgray%2Cstep%3D1%5D%20%28-11%2C-11%29%20grid%20%2811%2C11%29%3B%0A%5Cend%7Bscope%7D%0A%5Chuge%0A%5Cdraw%5B%3C-%3E%2Cthick%5D%20%28-11%2C0%29%20--%20%2811%2C0%29%20node%5Babove%20left%2Couter%20sep%3D2pt%5D%7B%5C%28x%5C%29%7D%3B%0A%5Cdraw%5B%3C-%3E%2Cthick%5D%20%280%2C-11%29%20--%20%280%2C11%29%20node%5Bbelow%20right%2Couter%20sep%3D2pt%5D%7B%5C%28y%5C%29%7D%3B%0A%5Cforeach%20%5Cx%20in%20%7B-10%2C-8%2C...%2C-2%2C2%2C4%2C...%2C10%7D%20%5Cdraw%5Bthin%5D%20%28%5Cx%2C5pt%29%20--%20%28%5Cx%2C-5pt%29%20node%5Bbelow%5D%7B%5C%28%5Cx%5C%29%7D%3B%0A%5Cforeach%20%5Cy%20in%20%7B-10%2C-8%2C...%2C-2%2C2%2C4%2C...%2C10%7D%20%5Cdraw%5Bthin%5D%20%285pt%2C%5Cy%29%20--%20%28-5pt%2C%5Cy%29%20node%5Bleft%5D%7B%5C%28%5Cy%5C%29%7D%3B%0A%5Cfilldraw%5Bred%5D%20%28%24a%2C%24b%29%20circle%5Bradius%3D5pt%5D%3B%0A%25%20this%20is%20a%20comment%0A%5Cnode%20at%20%283%2C-3%29%7B%5C%28~~%5C%2450%2C000%5C%29%7D%3B%0AEND_TIKZ%0A%0ABEGIN_PGML%0A%5B%40%20image%28insertGraph%28%24graph_image%29%2C%20width%20%3D%3E%20300%2C%20tex_size%20%3D%3E%201000%29%20%40%5D%2A%0AEND_PGML%0A%0AENDDOCUMENT%28%29%3B`

You will need to change the server name, courseID, userID, and
course_password,

Here is a render_rpc link with a uri encoded TikZ problem for testing:
`http://localhost:3005/webwork2/render_rpc?courseID=anonymous&user=anonymous&passwd=anonymous&answersSubmitted=0&showSolutions=1&displayMode=MathJax&outputformat=simple&problemSeed=2&uriEncodedProblemSource=DOCUMENT%28%29%3B%0A%0AloadMacros%28%27PGstandard.pl%27%2C%20%27PGML.pl%27%2C%20%27PGtikz.pl%27%29%3B%0A%0A%24a%20%3D%20random%28-10%2C%209%29%3B%0A%24b%20%3D%20random%28-10%2C%209%29%3B%0A%0A%24graph_image%20%3D%20createTikZImage%28%29%3B%0A%24graph_image-%3EtikzLibraries%28%27arrows.meta%27%29%3B%0A%24graph_image-%3EtikzOptions%28%27x%3D0.6cm%2Cy%3D0.6cm%27%29%3B%0A%0A%24graph_image-%3EBEGIN_TIKZ%0A%5Ctikzset%7B%3E%3D%7BStealth%5Bscale%3D1.8%5D%7D%7D%0A%5Cfilldraw%5Bdraw%3Dblue%2Cfill%3Dwhite%2Crounded%20corners%3D14pt%2Cthick%2Cuse%20as%20bounding%20box%5D%20%28-11%2C-11%29%20rectangle%20%2811%2C11%29%3B%0A%5Cbegin%7Bscope%7D%0A%09%5Cclip%5Brounded%20corners%3D14pt%5D%20%28-11%2C-11%29%20rectangle%20%2811%2C11%29%3B%0A%09%5Cdraw%5Bline%20width%3D0.2pt%2Ccolor%3Dgray%2Cstep%3D1%5D%20%28-11%2C-11%29%20grid%20%2811%2C11%29%3B%0A%5Cend%7Bscope%7D%0A%5Chuge%0A%5Cdraw%5B%3C-%3E%2Cthick%5D%20%28-11%2C0%29%20--%20%2811%2C0%29%20node%5Babove%20left%2Couter%20sep%3D2pt%5D%7B%5C%28x%5C%29%7D%3B%0A%5Cdraw%5B%3C-%3E%2Cthick%5D%20%280%2C-11%29%20--%20%280%2C11%29%20node%5Bbelow%20right%2Couter%20sep%3D2pt%5D%7B%5C%28y%5C%29%7D%3B%0A%5Cforeach%20%5Cx%20in%20%7B-10%2C-8%2C...%2C-2%2C2%2C4%2C...%2C10%7D%20%5Cdraw%5Bthin%5D%20%28%5Cx%2C5pt%29%20--%20%28%5Cx%2C-5pt%29%20node%5Bbelow%5D%7B%5C%28%5Cx%5C%29%7D%3B%0A%5Cforeach%20%5Cy%20in%20%7B-10%2C-8%2C...%2C-2%2C2%2C4%2C...%2C10%7D%20%5Cdraw%5Bthin%5D%20%285pt%2C%5Cy%29%20--%20%28-5pt%2C%5Cy%29%20node%5Bleft%5D%7B%5C%28%5Cy%5C%29%7D%3B%0A%5Cfilldraw%5Bred%5D%20%28%24a%2C%24b%29%20circle%5Bradius%3D5pt%5D%3B%0A%25%20this%20is%20a%20comment%0A%5Cnode%20at%20%283%2C-3%29%7B%5C%28~~%5C%2450%2C000%5C%29%7D%3B%0AEND_TIKZ%0A%0ABEGIN_PGML%0A%5B%40%20image%28insertGraph%28%24graph_image%29%2C%20width%20%3D%3E%20300%2C%20tex_size%20%3D%3E%201000%29%20%40%5D%2A%0AEND_PGML%0A%0AENDDOCUMENT%28%29%3B`

You will need to change the server name, courseID, user, and passwd.
Take care of this before the release so that at release time at least
the message about needing to update the browserslist db is not shown.
Initial checkin of sample problems and parsing script
Don't require that probFileName be set.
use the hidden #enter_key_submit button for enter key hits
@drgrice1 drgrice1 merged commit e258ae2 into main Jul 20, 2023
@drgrice1 drgrice1 deleted the PG-2.18 branch July 20, 2023 19:32
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.

4 participants