Comments (8)
This is not an old issue. It is new to WW2.18. It breaks one of the oldest WW problems (Problem 2 in Set 0) but I thought the problem was corrupted and fixed it by accident. Another problem actually was corrupted (missing ;) I could not get the minimal problem above to work, but the following (please forgive my old technique) works in WW2.17 but fails in WW2.18.
DOCUMENT();
loadMacros("PGstandard.pl");
BEGIN_TEXT
Enter 1:
$BR{ ans_rule(1) }
END_TEXT
$ans =1;
ANS(std_num_cmp($ans));
ENDDOCUMENT();
Note that in the installation guide I said:
Note that most of these sets date from the early days of WeBWorK in the 1990's and the problems they contain, while they still work, are not examples of current good programing practices. For current programing methods, look at e.g. https://webwork.maa.org/wiki/Category:PGM. Further, Problem 12 in setMAAtutorial (file htmllinksexample.pg) contains a simple error which is typical of errors you might make in authoring your own problems. WeBWorK tries to tell you what the error is and you can use the Edit button to edit and save the problem. Problem 2 in set0 (file prob1a.pg) contains more subtle errors. The Open Problem Library (OPL) contains over 37,000 problems the vast majority of which are error free.
from pg.
This seems to be due to #863. If you add a space in the TeX string on line 319 of PGbasicmacros.pl, then hardcopy generation succeeds. However, it also adds a space in the output which is not desired. This seems to be another case of EV3P parsing something in an odd way.
from pg.
Quick note that my MWE was missing MathObjects.pl
.
DOCUMENT();
loadMacros("PGstandard.pl", "MathObjects.pl");
BEGIN_TEXT
$DOLLAR\{ ans_rule(1) \}
END_TEXT
ANS(Real(1)->cmp);
ENDDOCUMENT();
from pg.
So what is happening is that "<<END_OF_EVALUATION_STRING\n$DOLLAR{\\answerRule[AnSwEr0001]{3}}\nEND_OF_EVALUATION_STRING\n"
is being passed to PG_restricted_eval
by the EV3P
method. So that is the perl code
<<END_OF_EVALUATION_STRING
$DOLLAR{\\answerRule[AnSwEr0001]{3}}
END_OF_EVALUATION_STRING
Perl is interpreting that to mean the hash key of the %DOLLAR
hash indexed by \\answerRule[AnSwEr0001]{3}
. Since the %DOLLAR
hash is not defined, it is an error.
from pg.
Yeah, I added MathObjects.pl
.
from pg.
It seems that if you change line 319 to TeX => "\\mbox{\\answerRule[$name]{$tcol}}"
it fixes the problem. This seems like it should work. Do you see any problems with that? Note that all of the answer rule methods that add this \\answerRule
in this way will need to be fixed.
from pg.
Note that the \\mbox
addition also works with Library/Indiana/Indiana_setSeries5IntegralTest/ur_sr_5_11.pg
(the problem @pstaabp mentioned in #863 that results in the answer rule output being placed inside the option brackets of an \item
.
from pg.
I'm not getting this to happen on develop. #915 and related PRs for develop fixed this.
from pg.
Related Issues (20)
- Bug when a matrix Math Object is reused as an answer HOT 10
- PGML.pl has lines that should have been removed. HOT 1
- checkboxlist within a RadioMultiAnswer HOT 4
- Using upToConstant with complex numbers HOT 4
- keyboard issue with GraphTool HOT 8
- inconsistency in multiple choice macros HOT 4
- run-perltidy deletes .bak files
- Error answers now are escaped when they shouldn't be. HOT 1
- Cropping from pgfplots is not always working for final SVG output HOT 13
- variables declared with `my` lead to errors HOT 1
- student answers get spaces normalized
- iframeResizer, feedback popover, and mqeditor HOT 16
- Updating AnswerFormatHelp.pl HOT 5
- Viewing all correct answers at the same time HOT 4
- PTX "image" tag getting changed to "img" HOT 5
- error with brace and x HOT 9
- PG editor not decoding as expecting HOT 1
- macros/graph/PGnauGraphics.pl doesn't use unique name, which can break tests. HOT 1
- securtiy issues with braces HOT 2
- braces around math HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg.