Skip to content

Scaffold section with PopUp breaks subsequent MathObjects #881

Open
@dlglin

Description

@dlglin

This was first reported in #880.

As far as I can tell if a PopUp is used in a scaffold section, then any MathObjects that are defined after the end of that section don't get created properly.

Consider the following example:

DOCUMENT();

loadMacros(
   "PGstandard.pl",     # Standard macros for PG language
   "MathObjects.pl",
   "PGML.pl",
   "parserPopUp.pl",
   "scaffold.pl",
   #"source.pl",        # allows code to be displayed on certain sites.
   "PGcourse.pl",      # Customization file for the course
);

$a = PopUp(["yes","no"],0);
Scaffold::Begin();

Section::Begin();
$two=Real(2);
BEGIN_PGML
[_____]{$a}
END_PGML
$three=Real(3);
Section::End();
$four=Real(4);
Section::Begin();
BEGIN_PGML
2=[_]{$two}

3=[_]{$three}

4=[_]{$four}
END_PGML
Section::End();

Scaffold::End();
$five = Real(5);
BEGIN_PGML
5=[_]{$five}
END_PGML

ENDDOCUMENT();

The answers up to 3 are evaluated correctly, but 4 and 5 are marked wrong even though those values are shown as the correct answers.

It seems to be that some interaction of the PopUp display followed by Section::End() is causing this.

An available workaround is to define all variables before the start of the scaffold.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions