-
-
Notifications
You must be signed in to change notification settings - Fork 77
Move the WeBWorK::PG module to PG and improve PG's local configuration. #709
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
Conversation
Note that the added tests use the Test2::Suite (via the Test2::V0 bundle). So pull request #702 is needed to regain uniformity for the tests. |
5064edb
to
2e48778
Compare
I'm starting to dig into this. First of all, it looks like we'll need to update the database tables in the admin course. Overall, things look great. I have some problem sets for testing over the past year or so and old Flash Applets give the following error: |
Yes, to test this you will need to upgrade database tables. This flash applets error is fixed. You will need to reset the branch (or delete it and check it out again) to get the changes. |
Odd. Still seeing this and have tried deleting and clearly back on both of these branches. |
On the chromatic problems, On the latter two you listed above, I'm getting the following errors:
|
Make sure you reset the pg pull request to fix the flash issue, not this one. Edit: Oops, this is the pg pull request. |
I am not seeing the chromatic errors. |
What seed do you have for the chromatic problems? Maybe it is seed specific. |
2e48778
to
edbd639
Compare
Okay, I didn't actually commit the changes to AppletObjects.pl. Now they are in. Sorry. I changed seeds, and now I am seeing the use of uninitialized values for the last chromatic problem. I will look into it. |
Applets is fixed now. :) |
Also, wanted to note, that in the |
edbd639
to
31aa255
Compare
The chromatic errors are fixed. It was a faulty initialization. |
31aa255
to
b572c9b
Compare
Yeah, the t directory needs to be cleaned up. TODO |
6ac2100
to
5884136
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly inconsequential feedback from initial read-through. Testing forthcoming.
fb5fe42
to
f2e0ed8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After more testing, all of the chromatic tests work again. Overall, things look good.
e1f076e
to
59a0478
Compare
81b9834
to
92f7883
Compare
This now includes the improved warning handling that we discussed. |
Uhh, did not mean to close with comment. |
5a4ac48
to
2baaec1
Compare
2baaec1
to
33dca85
Compare
Remove the ALWAYS_SHOW_HINT_PERMISSION_LEVEL and ALWAYS_SHOW_SOLUTION_PERMISSION_LEVEL settings. Whether hints and solutions are shown is now determined by the front end. The pg flag/variable $showHint has been removed. The front end has complete control on when hints are shown. Not the problem author. Also the options to use knowls for solutions and hints have been removed. Always use knowls for solutions and hints. Showing the various pieces of debugging information for a problem is now controlled with translation options. The front end is responsible for converting permissions into these debugging options. The VIEW_PROBLEM_DEBUGGING_INFO special pg environment variable was removed and is one of these debugging options. Many unnecessary PG environment variables have been removed. One of these is the session key. Remove reduced scoring entirely from PG. That is the responsibility of the front end to implement. Pg now has not dates and and no permissions. The color.c file has been removed. The method in that file has been reimplemented in Chromatic.pm using perl. It is perhaps a bit slower, but not significantly in the scope of rendering a problem. This can be tested with the problems Library/NAU/setGraphTheory/FindChromaticNumber.pg, Library/NAU/setGraphTheory/FindRoomColor.pg, and Library/NAU/setGraphTheory/RoomSchedule.pg which happen to be all known problems that use the Chromatic module. The image generator has been rewritten to remove the dvipng_align hack and to allow the usage of sqlite for a database backend for storing dvipng depths. Note that PGalias no longer uses the course name, user login, set number, and problem number for generating resource UUID's. It now only uses the problem seed, psvn, and problemUUID. It is the caller's responsibility of ensuring that problemUUID guarantees the necessary uniqueness.
The t/macros/load_macros.t file tests that all macros load without errors or warnings. There is one macro that will not work in this test and it is skipped. That is the answerDiscussion.pl macro. It requires a file that is not part of the PG distribution. It also has invalid `defined(@array)` calls. Warnings found in other macro files were fixed. The PG_module_list.pl macro was deleted. That is clearly obsolete and will not work. There are also some tests added in t/pg_problems that test that rendering with the WeBWorK::PG module works and demonstrate how to use it in unit tests.
AppletObjects.pl macro caused by extending the Applet package in the macro. Instead of extending the Applet package, a derived package (PGApplet) is created and used in the macro. The GeogebraWebApplet package needs to derive from the PGApplet package, and so it needs to be moved to the macro. Also, the Applet.pm package no longer derives from the PGcore package. It doesn't need to as it uses none of the PGcore module methods.
The server really should not be checking urls in this way. If an invalid url is given, let the error come out in the browser. This is the correct way to deal with this.
Many subroutines are redefined in macros. In addition if multiple WeBWorK::PG::Translator instances are created in the same process, the safe compartment is not entirely isolated between instances, and this causes redefine warnings if a macro is loaded in both instances. This is due to a memory leak somewhere and needs to be fixed.
back to the original file in which the error occurred.
33dca85
to
7acd793
Compare
Update the renderer for the restructuring of PG in openwebwork/pg#709
Remove the ALWAYS_SHOW_HINT_PERMISSION_LEVEL and ALWAYS_SHOW_SOLUTION_PERMISSION_LEVEL settings. Whether hints and solutions are shown is now determined by the front end.
The pg flag/variable $showHint has been removed. The front end has complete control on when hints are shown. Not the problem author.
Also the options to use knowls for solutions and hints have been removed. Always use knowls for solutions and hints.
Showing the various pieces of debugging information for a problem is now controlled with translation options. The front end is responsible for converting permissions into these debugging options. The VIEW_PROBLEM_DEBUGGING_INFO special pg environment variable was removed and is one of these debugging options.
Many unnecessary PG environment variables have been removed. One of these is the session key.
Remove reduced scoring entirely from PG. That is the responsibility of the front end to implement.
Pg now has no dates and and no permissions.
The color.c file has been removed. The method in that file has been reimplemented in Chromatic.pm using perl. It is perhaps a bit slower, but not significantly in the scope of rendering a problem. This can be tested with the problems
Library/NAU/setGraphTheory/FindChromaticNumber.pg,
Library/NAU/setGraphTheory/FindRoomColor.pg, and
Library/NAU/setGraphTheory/RoomSchedule.pg
which happen to be all known problems that use the Chromatic module.
The image generator has been rewritten to remove the dvipng_align hack and to allow the usage of sqlite for a database backend for storing dvipng depths.
Note that PGalias no longer uses the course name, user login, set number, and problem number for generating resource UUID's. It now only uses the problem seed, psvn, and problemUUID. It is the caller's responsibility of ensuring that problemUUID guarantees the necessary uniqueness.
Some unit tests were added for this.
The t/macros/load_macros.t file tests that all macros load without errors or warnings. There is one macro that will not work in this test and it is skipped. That is the answerDiscussion.pl macro. It requires a file that is not part of the PG distribution. It also has invalid
defined(@array)
calls.Warnings found in other macro files were fixed.
The PG_module_list.pl macro was deleted. That is clearly obsolete and will not work.
There are also some tests added in t/pg_problems that test that rendering with the WeBWorK::PG module works and demonstrate how to use it in unit tests.
There was also a "memory bleed" issue that was found with the Applet.pm module and the AppletObjects.pl macro caused by extending the Applet package in the macro. Instead of extending the Applet package, a derived package (PGApplet) is created and used in the macro. The GeogebraWebApplet package needs to derive from the PGApplet package, and so it needs to be moved to the macro. Also, the Applet.pm package no longer derives from the PGcore package. It doesn't need to as it uses none of the PGcore module methods. A similar issue occurs with the tableau.pl macro, but that was not fixed. So see the issue here, add a
for my $i (0 .. 1)
loop around the code inside the subtest in t/macros/load_macros.t. When the tableau.pl macro is loaded the second time, a warning will be issued.