WeBWorK Problems

Editor in WeBWorK doesn't render formulas

Editor in WeBWorK doesn't render formulas

by Murphy Waggoner -
Number of replies: 1

Howdy,

I am trying to test out the code below using different seeds. I used to be able to do this in the editor, but now the formulas don't render in the editor. I can change the seed, but I can't see the value of r in the preview in order to check the answers.

Also, even if I select the answers and check them in the editor, I get no feedback on whether they were checked as correct or not. There is an overall response about

The attached is what I see in the editor after checking the answers. Note that r doesn't show up in the instruction and r = $r doesn't show up between the instruction and the radio buttons. There is an icon of sorts after the question, but it doesn't open to tell me anything about the answer.

Is this a known issue, or possibly a setting in my browser version of WeBWorK.

I have ww_version: 2.19 | pg_version 2.19 installed by my IT on a local server. I see the same thing as in the attached image on my PC on Chrome, Firefox, and Edge, and on my iPad on Google and Safari.

Please do not debug or critique the code below. It is only included here as an example of the code used to generate the image.WeBWorK Editor not rendering correctly

loadMacros(
    "PGstandard.pl",
    "parserRadioButtons.pl",
    "PGML.pl",
    "PGcourse.pl"
);
TEXT(beginproblem());
######################################
#  Setup
#Create the coefficient and choices
$r = random(-1, 1, 0.05);
@desc1 =  ("Weak or no relationship",
          "Weak relationship",
          "Moderate relationship",
          "Strong relationship",
          "Very stong relationship"
          );
@desc2 =  ("Indirect relationship",
          "No relationship",
          "Direct relationship");
@desc3 =  ("Linear relationship",
          "Nonlinear relationship",
          "Cannot determine from r");
#Calculate index of strength response and buttons
$index1 = int(4*abs($r))+1;
$mc1 = RadioButtons(
    [@desc1],
    $desc1[$index1],
    labels=>"ABC");
#Calculate index for direction and buttons
$index2 = int($r) ;
$mc2 = RadioButtons(
    [@desc2],
    $desc2[$index2],
    labels=>"ABC");
    
#There is only one possible answer for shape
$mc3 = RadioButtons(
    [@desc3],
    $desc3[2],
    labels=>"ABC");


######################################
#  Main text
BEGIN_PGML
For the value of [:r:] below, select the appropriate descriptors.
[:r=[$r]:]
*Strength of relationship*
[_]{$mc1}
*Direction of relationship*
[_]{$mc2}
*Shape of relationship*
[_]{$mc3}
END_PGML
######################################
#  Answers
$showPartialCorrectAnswers = 0;
ANS( $mc1->cmp() );
ANS( $mc2->cmp() );
ANS( $mc3->cmp() );
ENDDOCUMENT();       # This should be the last executable line in the problem.


In reply to Murphy Waggoner

Re: Editor in WeBWorK doesn't render formulas

by Alex Jordan -

You may need your server admin to change directory to /opt/webwork/pg/htdocs and run:

npm ci

And again in /opt/webwork/webwork2/htdocs. Then restart webwork2.

There have been several hotfixes to 2.19, and your server admin might also take this time to pull (to both repositories) before doing the above.