[ww-bugs] Bug 3449: New: Possible issue with PGML

bugzilla-daemon at webwork.maa.org bugzilla-daemon at webwork.maa.org
Thu Sep 17 02:09:23 EDT 2015


http://bugs.webwork.maa.org/show_bug.cgi?id=3449

           Summary: Possible issue with PGML
           Product: PG
           Version: develop
          Platform: Macintosh
        OS/Version: Mac OS
            Status: NEW
          Severity: major
          Priority: P5
         Component: macros
        AssignedTo: gage at math.rochester.edu
        ReportedBy: alex.jordan at pcc.edu
                CC: dpvc at union.edu
        Web browser Firefox
           version:
    Browser version 40.0.3
            number:


I think we may have found an issue with PGML. A problem of ours used to work,
but now it does not. It fails with both webwork2 and pg on 2.11, but also with
webwork2 and pg on develop.

I've pared down the example to the code below. It looks to me like the first
answer is in the Currency context, and declared in the PGML block. The second
answer is left until outside the PGML block (because before I pared it down, it
was a more complicated answer checker.) The second answer is checked in a
different context (which I've switched to Numeric for simplicity). This seems
to cause problems for the first answer checker. It throws an error message
indicating it does not know what a Currency object is. It seems to be using the
Numeric context to evaluate both.

Error message after the code.


DOCUMENT();

loadMacros(
  "PGstandard.pl",       #Always needed
  "MathObjects.pl",      #Almost always needed
  "PGML.pl",             #Almost always needed
  "contextCurrency.pl",
);

Context("Currency");      

BEGIN_PGML

    Enter $1 here: [__________]{Currency(1)}.

    Enter 1 here: [___________].

END_PGML

Context("Numeric");
ANS(Compute(1)->cmp());

ENDDOCUMENT();


The error message is:


Error messages

    No such package 'Value::Currency' at line 454 of (eval 4456)

Call stack

The information below can help locate the source of the problem.

    in WeBWorK::PG::Local::new called at line 50 of
/opt/webwork/webwork2/lib/WeBWorK/PG.pm
    in WeBWorK::PG::new called at line 910 of
/opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm
    in WeBWorK::ContentGenerator::Problem::pre_header_initialize called at line
184 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
    in WeBWorK::ContentGenerator::go called at line 382 of
/opt/webwork/webwork2/lib/WeBWorK.pm

-- 
Configure bugmail: http://bugs.webwork.maa.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the webwork-bugs mailing list