Forums

Search results: 169

Hi everyone,

We are encountering the following error in several problems where answers must be selected from a radio button or a popup menu:

----------------

PG question processing error messages

PG warning messages

Error in Translator.pm::process_answers: Answer AnSwEr0001: Unrecognized evaluator type |HASH|
Answer evaluator AnSwEr0001 was not executed due to errors.

----------------

Since upgrading our server to version 2.19, we’ve been facing several issues that were not present prior to the upgrade. We may need to rebuild the server to resolve these issues.

Below is a sample code for a problem that triggers this error. 

Thanks in advance.

DOCUMENT();

loadMacros(

  "PGgraphmacros.pl",

  "PGstandard.pl",

  "MathObjects.pl",

  "PGML.pl",

  "parserRadioButtons.pl",

  "contextFraction.pl",

  "PCCgraphMacros.pl",

  "pccTables.pl",

  "PGcourse.pl",

);

 

##############################################

 

Context("Point");

$refreshCachedImages=1;

 

#These two arrays store the coordinates of the intersections.

#(x[0],y[0]) is the correct solution in the correct graph.

#(x[1],y[1]), (x[2],y[2]), (x[3],y[3]) are incorrect solutions.

#(x[4],y[4]) is used in the solution.

@x=();

@y=();

 

# This array stores the y-intercepts of lines.

# b[0][0] and b[0][1] are y-intercepts of lines in the correct graph.

# b[i][0] and b[i][1] are y-intercepts of lines in wrong graphs.

# b[i][2] stores whether the second line is vertical or horizontal (used

# in graph's alt and title.

# b[4][0] and b[4][1] are used in solution.

@b=([],[],[],[],[]); 

 

#Set the correct solution.

$x[0] = non_zero_random(-3,3,1);

do {$y[0] = non_zero_random(-3,3,1);} until ($y[0]!=$x[0]);

$intersection = Compute("($x[0],$y[0])");

 

Context("Fraction");

Context()->noreduce("(-x)-y","(-x)+y");

 

#Set both lines in the correct solution graph

do {$b[0][0]=$y[0]+non_zero_random(2,4,1)*random(-1,1,2);}

  until ($y[0] != (($y[0]-$b[0][0])/$x[0]*$y[0]+$b[0][0])); #prevents duplicate graphs

$b[0][1]=$y[0];

$b[0][2]="horizontal";

 

#Set wrong solutions

do {$x[1] = $x[0]+random(-1,1,2);} until ($x[1]!=0);

$y[1] = $y[0];

$b[1][0]=$b[0][0];

$b[1][1]=$b[0][1];

$b[1][2]="horizontal";

 

$b[2][0]=$b[0][0];

$x[2] = $y[0];

$y[2] = ($y[0]-$b[0][0])/$x[0]*$y[0] + $b[0][0];

$b[2][2]="vertical";

 

$b[3][0]=$b[0][0];

$x[3] = $x[0];

$y[3] = $y[0];

$b[3][2]="vertical";

 

#$x[4] and $y[4] are used in solution.

$x[4] = $x[0];

$y[4] = $y[0];

$b[4][0]=$b[0][0];

$b[4][1]=$b[0][1];

$b[4][2]=$b[0][2];

 

#Dump out the correct answer's slope's rise and run. 

#These will be used in the solution.

$m0Correct = Fraction($y[0]-$b[0][0],$x[0])->reduce;

@temp = $m0Correct->value;

$m0Rise = @temp[0];

$m0Run = @temp[1];

 

$m1Correct = 0;

 

#Create a hash and its inverse that randomizes the order of the four graphs.

%scramble = ();

%inverse = ();

for my $i (0..3) {

  do {$temp = list_random(0..3)} until !(grep(/^$temp$/,values %scramble) );

  $scramble{$i} = $temp;

  $inverse{$temp} = $i;

};

 

$scramble{4} = 4;

$inverse{4} = 4;

 

$xmin = -10;

$xmax = -$xmin;

$ymin = -10;

$ymax = -$ymin;

 

#These two variables decide how many labels are on each axis.

$xmark = ceil($xmax/10);

$ymark = ceil($ymax/10);

 

@gr=();

 

#$gr[0] through $gr[3] are options; $gr[4] is used in solution.

for ($i=0;$i<=4;$i++) {

   $gr[$i] = init_graph($xmin,$ymin,$xmax,$ymax,

   axes=>[0,0],

   grid=>[$xmax-$xmin,$ymax-$ymin],

   size=>[xPixels(),yPixels()]

   );

   $gr[$i]->lb('reset');

   for ($j=-$xmax+$xmark;$j<$xmax;$j=$j+$xmark) {

      $gr[$i]->lb( new Label($j,  -0.1, $j,'black','center','top'));

   }

   for ($j=-$ymax+$ymark;$j<$ymax;$j=$j+$ymark) {

      if (Real($j) == 0) {next;}

      $gr[$i]->lb( new Label(0,  $j,' '.$j,'black','left','middle'));

   }

   $gr[$i]->lb( new Label($xmin, $ymax, ' '.$ALPHABET[$inverse{$i}], 'black', 'left', 'top')) unless ($i==4);

   $m1 = ($y[$i]-$b[$i][0])/$x[$i];

   add_functions($gr[$i], "$m1*x+$b[$i][0] for x in <$xmin,$xmax> using color:red and weight:1");

 

   if (($i==0) || ($i==1) || ($i==4)) {

      $m2 = ($y[$i]-$b[$i][1])/$x[$i];

      add_functions($gr[$i], "$m2*x+$b[$i][1] for x in <$xmin,$xmax> using color:blue and weight:1");

   }

 

   if ($i==2) {

      $gr[$i]->moveTo($y[0],$ymin);

      $gr[$i]->lineTo($y[0],$ymax,'blue',2);

   }

 

   if ($i==3) {

      $gr[$i]->moveTo($x[0],$ymin);

      $gr[$i]->lineTo($x[0],$ymax,'blue',2);

   }

 

   $ALTtags[$i]="Graph $ALPHABET[$inverse{$i}]: This is a graph of two lines intersecting at ($x[$i],$y[$i]). One line is $b[$i][2].";

}

 

pop(@ALTtags);

push(@ALTtags,"This is a graph of two lines intersecting at ($x[4],$y[4]). One line is $b[4][2].");

 

 

$radio = RadioButtons(

  ["A","B","C","D"],

  $ALPHABET[$inverse{0}], # correct answer

  order => ["A","B","C","D"],

);

 

#for display purposes

$func0 = Compute("$m0Correct*x+ $b[0][0]")->reduce;

$horiY = $y[0];

 

##############################################

 

TEXT(beginproblem());

 

BEGIN_PGML

 

Solve the system of equations by graphing. Choose the graph that represents the two given line equations, and then enter the solution. 

 

    [``

  \left\{\begin{aligned}

  y &=  [$func0] \\

  y &=  [$horiY] \\

\end{aligned}

  \right.

    ``]

 

[@EnlargeImageStatementPGML()@]** 

 

    The correct graph is graph    

    [@$radio->buttons()@]*

 

The solution of this system, written as an ordered pair, is [_______________].

 

END_PGML

 

Context()->texStrings;

BEGIN_TEXT

$PAR

$BCENTER

\{ 

LayoutTable([[image( insertGraph($gr[$scramble{0}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{0}]" title = "$ALTtags[$scramble{0}]"'  ),

image( insertGraph($gr[$scramble{1}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{1}]" title = "$ALTtags[$scramble{1}]"'  ),

],

[image( insertGraph($gr[$scramble{2}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{2}]" title = "$ALTtags[$scramble{2}]"'  ),

image( insertGraph($gr[$scramble{3}]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{3}]" title = "$ALTtags[$scramble{3}]"'  )

]], allcellcss => "padding:20pt;")

 

\}

$ECENTER

$PAR

 

 

END_TEXT

 

Context()->normalStrings;

 

##############################################

 

ANS( $radio->cmp() );

ANS( $intersection->cmp() );

 

#Graph the intersection in solution.

$gr[4]->stamps( closed_circle($x[0],$y[0],'black') );

$gr[4]->lb( new Label($x[0],$y[0]," ($x[0],$y[0])",'black','left','top'));

 

#Graph slope triangle in the first line.

$gr[4]->moveTo(0,$b[0][0]);

$xCor=0;

$yCor=$b[0][0];

$xStep = $x[0]>0 ? $m0Run : -$m0Run;

$yStep = ($y[0]-$yCor)>0 ? abs($m0Rise) : -abs($m0Rise);

do {

   $xCor += $xStep;

   $gr[4]->lineTo($xCor,$yCor,'red',2);

   $yCor += $yStep;

   $gr[4]->lineTo($xCor,$yCor,'red',2);

} until ($xCor==$x[0]);

 

 

Context()->texStrings;

BEGIN_SOLUTION

$PAR

To solve a system of linear equations by graphing, one way is to first graph each line's \(y\)-intercept, and then draw slope triangles until we find the intersection. If we use a method where we connect two points using a straightedge, slight inaccuracies in the placement of the straightedge can lead to very inaccurate solutions.$PAR

For this problem, the first equation is given in slope-intercept form. We can graph its \(y\)-intercept, and then draw slope triangles. 

$PAR

The second line is horizontal.

$PAR

See solution in the graph:

$PAR

$BCENTER

\{ image( insertGraph($gr[4]), width=>xScreen(), height=>yScreen(), tex_size=>TeXscalar(), extra_html_tags=>'alt = "$ALTtags[$scramble{4}]" title = "$ALTtags[$scramble{4}]"'  ) \}

$ECENTER

$PAR

The solution to this system of equations is \( ($x[0],$y[0]) \). \{ $radio->correct_ans() \} is the correct answer.

$PAR

 

END_SOLUTION

Context()->normalStrings;

 

ENDDOCUMENT();

 

 


I am not aware of any local changes to the OPL. We always make copies inside courses if  we want modifications.

"git status" returns

Refresh index: 100% (85631/85631), done.

On branch v2024-08-14

Untracked files:

  (use "git add <file>..." to include in what will be committed)

TABLE-DUMP/

nothing added to commit but untracked files present (use "git add" to track)


I see the file OPL-tables.sql in the TABLE-DUMP directory.

The only thing I can add is that I'm seeing both of these errors (the "unable to retrieve permissions" and the database aborted connections) on my production server, though they are not that frequent, and so far I haven't heard of any student that has not been able to log in (I suspect that in my case when a student runs into such an error they refresh the page and are able to log in, so they don't bother to report it).

You've already tried most of the things that I would suggest based on the suspicion that this has to do with collisions of database requests.  The one thing that wasn't mentioned in your previous post was confirming that clients is set to 1.  I suspect that you left that alone since the documentation explicitly says not to change it.

The one thing that I will mention from my system is that I have been seeing processed being killed by the out-of-memory killer because they are taking up too much RAM.  Increasing "accepts" in the config will exacerbate this, as the memory used by an individual process will increase with each new connection that it accepts.  It's possible that this is completely unrelated, but it's another thing that has been happening on my server.

I'm looking at the code now. One thing to know about is that images are cached. The first time you run the problem for a given user for a given seed, it creates an image. After that, this same image will be shown even though perl's hash randomization is changing the underlying numbers. Near the top of the problem you can put `$refreshCachedImages = 1;` while debugging. But you should remove that when done so the server doesn't build the same tikz image on every run when it's the same user+seed.

If you change line 109 to:

for $k (lex_sort(keys %edges)) {

and line 140 to:

$edges{$k} = (random_subset(1, lex_sort(keys %canbe)))[0];

then I start getting consistency. That is, wrap lex_sort() around each place you are making an array of keys for some hash, so the array has a consistent order when it's used each run.

Since I was searching for 'keys', I also saw line 108:  `keys %edges;`. I don't think this line does anything. It might be sending the keys array out into the ether.

We recently installed v2.19 and are working to upgrade from v2.16. Some issues we are seeing in testing are related to display of tables and display of correct answers. Any clues about how to fix them would be GREATLY appreciated. Details below.

[Note: just after posting this I also learned that help boxes are not working - there's no response when clicked. Sounds related?]

I used a modification of the "enter pi" sample PGML problem, combined with a code snippet from an OPL problem (wriitten using PG), to illustrate the issues. My code is here:

    #############
    DOCUMENT();
    loadMacros(
        "PGstandard.pl",    # Standard macros for PG language
        "PGML.pl",          # PGML markup and Math Objects
        "PGcourse.pl",      # Customization file for the course
    );
    $pi = Real("pi");
    $y1=random(5, 20, 1);
    $y2=random(21, 50 , 1);
    $y3=random(51, 80 ,1);
    $y4=random(81,100, 1);
    $y5=random(101, 120, 1);
    @row1_1= ("\(t\) (seconds)", "0", "1", "2", "3", "4", "5");
    @row1_2= ("\(s\) (feet)", 0, $y1, $y2, $y3, $y4, $y5);
    BEGIN_PGML
    Enter a value for [`\pi`].
    [_]{$pi}{5}  
    showCorrectAnswers = [$showCorrectAnswers]  
    showSolutions = [$showSolutions]  
    displayMode = [$displayMode]
    END_PGML
    TEXT(beginproblem());
    BEGIN_TEXT
    \{&begintable(scalar(@row1_1)+1)\}
    \{&row(@row1_1)\}
    \{&row(@row1_2)\}
    \{&endtable()\}
    END_TEXT
    BEGIN_PGML_SOLUTION
    You could type [|pi|]* or [|3.14|]*, or [|22/7|]*,
    among other options.
    END_PGML_SOLUTION
    ENDDOCUMENT();
    #############

When this code is in the Problem Editor, no answer is entered, and the Show Correct Answer button is clicked the output is:

(Similar results obtain when an answer is entered - the entered answer remains showing in the answer box). It's also the case that the Solution link generates no response.

Using Generate Hardcopy the pdf shows the table correctly, along with the correct answer (showCorrectAnswers=2 because I am using an admin account?):

Setting the display mode in the editor to tex produces this output (showCorrectAnswers=0 because the problem must reload to display tex mode):

    {\pgmlSetup
    Enter a value for \(\pi\).
    \vskip\baselineskip
    {\answerRule[AnSwEr0001]{3}}
    \vskip\baselineskip
    showCorrectAnswers = 0\pgmlBreak
    showSolutions = 1\pgmlBreak
    displayMode = TeX
    \vskip\baselineskip
    \par}%

    \par\smallskip\begin{center}\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline

    \(t\) (seconds) &0 &1 &2 &3 &4 &5 \\ \hline 

    \(s\) (feet) &0 &15 &30 &60 &91 &107 \\ \hline 


    \end {tabular}\end{center}\par\smallskip



    %%% BEGIN SOLUTION
    \par\smallskip{\bf Solution: }
    {\pgmlSetup
    You could type {\tt{}pi} or {\tt{}3.14}, or {\tt{}22/7},
    among other options.
    \par}%
    \par\medskip
    %%% END SOLUTION
Enter a value for \(\pi\).
\vskip\baselineskip
{\answerRule[AnSwEr0001]{3}}
\vskip\baselineskip
showCorrectAnswers = 0\pgmlBreak
showSolutions = 1\pgmlBreak
displayMode = TeX
\vskip\baselineskip
\par}% \par\smallskip\begin{center}\begin{tabular}{|c|c|c|c|c|c|c|c|} \hline \(t\) (seconds) &0 &1 &2 &3 &4 &5 \\ \hline \(s\) (feet) &0 &15 &30 &60 &91 &107 \\ \hline \end {tabular}\end{center}\par\smallskip %%% BEGIN SOLUTION
\par\smallskip{\bf Solution: }
{\pgmlSetup
You could type {\tt{}pi} or {\tt{}3.14}, or {\tt{}22/7},
among other options.
\par}%
\par\medskip
%%% END SOLUTION 

With the code in Undefined Set:Problem 1 and loaded as in an assignment, the Show Correct Answers button gets the same result as shown above for the code in the editor, except showCorrectAnswers=2 as in the pdf output. Debug output for PG Info and Answer Hash Info is below (with the parser-related answer hash omitted, since the lengthy list is essentially all "too deep")

    Form variables

    AnSwEr0001  =>  
    MaThQuIlL_AnSwEr0001    =>  
    displayMode =>  
    effectiveUser   =>  Peter.Lert
    key =>  NEgRZwEbPDc5AZeudU3P17xiT39PPYno
    num_attempts    =>  2000
    passwd  =>  
    previous_AnSwEr0001 =>  
    problemSeed =>  
    showAnsHashInfo =>  1
    showCorrectAnswers  =>  Show Correct Answers
    showOldAnswers  =>  1
    showPGInfo  =>  1
    sourceFilePath  =>  issueSampleProblem.pg
    startTime   =>  1726331176
    user    =>  Peter.Lert

    Environment variables

    AnswerDateAMPM  =>  pm
    AnswerDateDay   =>  14
    AnswerDateDayOfWeek =>  Saturday
    AnswerDateDayOfWeekAbbrev   =>  Sat
    AnswerDateHour12    =>  12
    AnswerDateHour24    =>  12
    AnswerDateMinute    =>  56
    AnswerDateMonthAbbrev   =>  Sep
    AnswerDateMonthNumber   =>  09
    AnswerDateMonthWord =>  September
    AnswerDateTime12    =>  12:56pm
    AnswerDateTime24    =>  12:56
    AnswerDateTimeZone  =>  EDT
    AnswerDateYear2Digit    =>  24
    AnswerDateYear4Digit    =>  2024
    CAPA_GraphicsDirectory  =>  /opt/webwork/courses/testXX/templates/Contrib/CAPA/CAPA_Graphics/
    CAPA_Graphics_URL   =>  /webwork2_files/CAPA_Graphics/
    CAPA_MCTools    =>  /opt/webwork/courses/testXX/templates/Contrib/CAPA/macros/CAPA_MCTools/
    CAPA_Tools  =>  /opt/webwork/courses/testXX/templates/Contrib/CAPA/macros/CAPA_Tools/
    DueDateAMPM =>  pm
    DueDateDay  =>  14
    DueDateDayOfWeek    =>  Saturday
    DueDateDayOfWeekAbbrev  =>  Sat
    DueDateHour12   =>  12
    DueDateHour24   =>  12
    DueDateMinute   =>  56
    DueDateMonthAbbrev  =>  Sep
    DueDateMonthNumber  =>  09
    DueDateMonthWord    =>  September
    DueDateTime12   =>  12:56pm
    DueDateTime24   =>  12:56
    DueDateTimeZone =>  EDT
    DueDateYear2Digit   =>  24
    DueDateYear4Digit   =>  2024
    MathJaxURL  =>  undef
    OpenDateAMPM    =>  pm
    OpenDateDay =>  14
    OpenDateDayOfWeek   =>  Saturday
    OpenDateDayOfWeekAbbrev =>  Sat
    OpenDateHour12  =>  12
    OpenDateHour24  =>  12
    OpenDateMinute  =>  56
    OpenDateMonthAbbrev =>  Sep
    OpenDateMonthNumber =>  09
    OpenDateMonthWord   =>  September
    OpenDateTime12  =>  12:56pm
    OpenDateTime24  =>  12:56
    OpenDateTimeZone    =>  EDT
    OpenDateYear2Digit  =>  24
    OpenDateYear4Digit  =>  2024
    PERSISTENCE_HASH    =>  
    PERSISTENCE_HASH_UPDATED    =>  
    PRINT_FILE_NAMES_FOR    =>  [ admin, support, professor ]
    PRINT_FILE_NAMES_PERMISSION_LEVEL   =>  10
    PROBLEM_GRADER_TO_USE   =>  avg_problem_grader
    QUIZ_PREFIX =>  
    Rserve  =>  
    host    =>  vm95.math.umb.edu
    __files__   =>  
    (eval 4510) =>  issueSampleProblem.pg
    (eval 4685) =>  /opt/webwork/pg/macros/core/PGstandard.pl
    (eval 4686) =>  /opt/webwork/pg/macros/core/PGbasicmacros.pl
    (eval 4693) =>  /opt/webwork/pg/macros/core/PGanswermacros.pl
    (eval 4694) =>  /opt/webwork/pg/macros/math/PGnumericevaluators.pl
    (eval 4702) =>  /opt/webwork/pg/macros/answers/PGfunctionevaluators.pl
    (eval 4714) =>  /opt/webwork/pg/macros/answers/PGstringevaluators.pl
    (eval 4715) =>  /opt/webwork/pg/macros/answers/PGmiscevaluators.pl
    (eval 4721) =>  /opt/webwork/pg/macros/core/PGauxiliaryFunctions.pl
    (eval 4722) =>  /opt/webwork/pg/macros/core/PGcommonFunctions.pl
    (eval 4723) =>  /opt/webwork/pg/macros/math/customizeLaTeX.pl
    (eval 4724) =>  /opt/webwork/pg/macros/core/PGML.pl
    (eval 4726) =>  /opt/webwork/pg/macros/core/MathObjects.pl
    (eval 4727) =>  /opt/webwork/pg/macros/core/Parser.pl
    (eval 4728) =>  /opt/webwork/pg/macros/core/Value.pl
    (eval 4730) =>  /opt/webwork/pg/macros/parsers/parserCustomization.pl
    (eval 4731) =>  /opt/webwork/pg/macros/ui/niceTables.pl
    (eval 4734) =>  /opt/webwork/pg/macros/contexts/contextTypeset.pl
    (eval 4736) =>  /opt/webwork/pg/macros/parsers/parserQuotedString.pl
    (eval 4737) =>  /opt/webwork/pg/macros/PGcourse.pl
    pg  =>  /opt/webwork/pg
    root    =>  /opt/webwork/webwork2
    tmpl    =>  /opt/webwork/courses/testXX/templates
    ansEvalDefaults =>  
    answersOpenAfterDueDate =>  2880
    assignOpenPriorToDue    =>  14400
    enableReducedScoring    =>  0
    functRelPercentTolDefault   =>  0.5
    numAbsTolDefault    =>  0.02
    numRelPercentTolDefault =>  1
    reducedScoringPeriod    =>  2880
    reducedScoringValue =>  0.85
    answerDate  =>  1726332977
    answerPrefix    =>  
    answersAvailable    =>  
    answersOpenAfterDueDate =>  2880
    assignOpenPriorToDue    =>  14400
    convertFullWidthCharacters  =>  0
    courseName  =>  testXX
    debuggingOptions    =>  
    show_answer_group_info  =>  1
    show_answer_hash_info   =>  1
    show_pg_info    =>  1
    show_resource_info  =>  1
    view_problem_debugging_info =>  1
    defaultDisplayMatrixStyle   =>  [s]
    displayMode =>  HTML_MathJax
    dueDate =>  1726332977
    effectivePermissionLevel    =>  20
    enableReducedScoring    =>  0
    entryAssist =>  MathQuill
    external_data   =>  
    feedback_button_name    =>  Email Instructor
    forceScaffoldsOpen  =>  1
    forceShowAttemptResults =>  1
    formattedAnswerDate =>  September 14, 2024, 12:56:17 PM EDT
    formattedDueDate    =>  September 14, 2024, 12:56:17 PM EDT
    formattedOpenDate   =>  September 14, 2024, 12:56:17 PM EDT
    formattedReducedScoringDate =>  December 31, 1969, 7:00:00 PM EST
    functAbsTolDefault  =>  0.001
    functLLimitDefault  =>  0.0000001
    functMaxConstantOfIntegration   =>  1E8
    functNumOfPoints    =>  3
    functRelPercentTolDefault   =>  0.5
    functULimitDefault  =>  0.9999999
    functVarDefault =>  x
    functZeroLevelDefault   =>  1E-14
    functZeroLevelTolDefault    =>  1E-12
    grader  =>  avg_problem_grader
    htmlDirectory   =>  /opt/webwork/courses/testXX/html/
    htmlPath    =>  [ ., /opt/webwork/courses/testXX/html, /opt/webwork/webwork2/htdocs ]
    htmlURL =>  /webwork2_course_files/testXX/
    imagegen    =>  undef
    imagesPath  =>  [ ., /opt/webwork/courses/testXX/html/images, /opt/webwork/webwork2/htdocs/images ]
    inputs_ref  =>  
    AnSwEr0001  =>  
    MaThQuIlL_AnSwEr0001    =>  
    displayMode =>  
    effectiveUser   =>  Peter.Lert
    key =>  NEgRZwEbPDc5AZeudU3P17xiT39PPYno
    num_attempts    =>  2000
    passwd  =>  
    previous_AnSwEr0001 =>  
    problemSeed =>  
    showAnsHashInfo =>  1
    showCorrectAnswers  =>  Show Correct Answers
    showOldAnswers  =>  1
    showPGInfo  =>  1
    sourceFilePath  =>  issueSampleProblem.pg
    startTime   =>  1726331176
    user    =>  Peter.Lert
    isInstructor    =>  1
    language    =>  en
    language_subroutine =>  CODE
    latexImageConvertOptions    =>  
    input   =>  
    density =>  300
    output  =>  
    quality =>  100
    latexImageSVGMethod =>  dvisvgm
    localHelpURL    =>  /pg_files/helpFiles/
    macrosPath  =>  [ ., /opt/webwork/courses/testXX/templates/macros, /opt/webwork/pg/macros, /opt/webwork/pg/macros/answers, /opt/webwork/pg/macros/capa, /opt/webwork/pg/macros/contexts, /opt/webwork/pg/macros/core, /opt/webwork/pg/macros/graph, /opt/webwork/pg/macros/math, /opt/webwork/pg/macros/misc, /opt/webwork/pg/macros/parsers, /opt/webwork/pg/macros/ui, /opt/webwork/pg/macros/deprecated, /opt/webwork/courses/testXX/templates/Contrib/CAPA/macros/CAPA_Tools, /opt/webwork/courses/testXX/templates/Contrib/CAPA/macros/CAPA_MCTools, /opt/webwork/libraries/UMass-Boston/macros ]
    mathViewLocale  =>  mv_locale_us.js
    needs_grading   =>  
    numAbsTolDefault    =>  0.02
    numFormatDefault    =>  
    numOfAttempts   =>  2000
    numRelPercentTolDefault =>  1
    numZeroLevelDefault =>  1E-14
    numZeroLevelTolDefault  =>  1E-12
    num_of_correct_ans  =>  1000
    num_of_incorrect_ans    =>  1000
    onTheFlyImageSize   =>  400
    openDate    =>  1726332977
    parseAlternatives   =>  0
    pastDue =>  
    permissionLevel =>  20
    pgMacrosDir =>  /opt/webwork/pg/macros
    probFileName    =>  issueSampleProblem.pg
    probNum =>  1
    problemPostamble    =>  
    HTML    =>  
    TeX =>  
    problemPreamble =>  
    HTML    =>  
    TeX =>  
    problemSeed =>  123456
    problemUUID =>  Peter.Lert-testXX-setUndefined_Set-prob1
    problemValue    =>  
    processAnswers  =>  1
    psvn    =>  123
    questionNumber  =>  1
    r_source    =>  undef
    recitationName  =>  
    recitationNumber    =>  
    recorded_score  =>  0
    reducedScoringDate  =>  undef
    reducedScoringPeriod    =>  2880
    reducedScoringValue =>  0.85
    refreshMath2img =>  1
    sectionName =>  
    sectionNumber   =>  
    server_root_url =>  https://xxx.xxx.xxx.xxx
    setDescription  =>  undef
    setNumber   =>  Undefined_Set
    setOpen =>  
    showAttemptAnswers  =>  0
    showAttemptPreviews =>  
    showAttemptResults  =>  1
    showCorrectAnswers  =>  2
    showFeedback    =>  1
    showHints   =>  1
    showMessages    =>  
    showSolutions   =>  1
    show_answer_group_info  =>  1
    show_answer_hash_info   =>  1
    show_pg_info    =>  1
    show_resource_info  =>  1
    sourceFilePath  =>  issueSampleProblem.pg
    specialPGEnvironmentVars    =>  
    CAPA_GraphicsDirectory  =>  /opt/webwork/courses/testXX/templates/Contrib/CAPA/CAPA_Graphics/
    CAPA_Graphics_URL   =>  /webwork2_files/CAPA_Graphics/
    CAPA_MCTools    =>  /opt/webwork/courses/testXX/templates/Contrib/CAPA/macros/CAPA_MCTools/
    CAPA_Tools  =>  /opt/webwork/courses/testXX/templates/Contrib/CAPA/macros/CAPA_Tools/
    PRINT_FILE_NAMES_FOR    =>  [ admin, support, professor ]
    PRINT_FILE_NAMES_PERMISSION_LEVEL   =>  10
    Rserve  =>  
    host    =>  xxx.xxx.xxx.xxx
    convertFullWidthCharacters  =>  0
    entryAssist =>  MathQuill
    latexImageConvertOptions    =>  
    input   =>  
    density =>  too deep
    output  =>  
    quality =>  too deep
    latexImageSVGMethod =>  dvisvgm
    onTheFlyImageSize   =>  400
    parseAlternatives   =>  0
    problemPostamble    =>  
    HTML    =>  
    TeX =>  
    problemPreamble =>  
    HTML    =>  
    TeX =>  
    useOldAnswerMacros  =>  1
    use_javascript_for_live3d   =>  1
    waiveExplanations   =>  0
    studentID   =>  
    studentLogin    =>  Peter.Lert
    studentName =>  Peter Lert
    tempDirectory   =>  /opt/webwork/webwork2/htdocs/tmp/testXX/
    tempURL =>  /webwork2_files/tmp/testXX/
    templateDirectory   =>  /opt/webwork/courses/testXX/templates/
    useBaseTenLog   =>  0
    useMathQuill    =>  1
    useMathView =>  
    useOldAnswerMacros  =>  1
    use_javascript_for_live3d   =>  1
    use_opaque_prefix   =>  0
    use_site_prefix =>  
    view_problem_debugging_info =>  1
    waiveExplanations   =>  0
    webworkDocsURL  =>  https://webwork.maa.org/

    Context flags

    allowBadFunctionInputs  =>  0
    allowBadOperands    =>  0
    allowEmptyStrings   =>  1
    allowMissingFunctionInputs  =>  0
    allowMissingOperands    =>  0
    allowWrongArgCount  =>  0
    checkUndefinedPoints    =>  0
    convertFullWidthCharacters  =>  0
    formatStudentAnswer =>  evaluated
    granularity =>  1000
    ignoreEndpointTypes =>  0
    ijk =>  0
    ijkAnyDimension =>  1
    infiniteWord    =>  infinity
    limits  =>  [ -2, 2 ]
    max_adapt   =>  1E8
    max_undefined   =>  undef
    num_points  =>  5
    parseAlternatives   =>  0
    reduceConstantFunctions =>  1
    reduceConstants =>  1
    reduceSets  =>  1
    reduceSetsForComparison =>  1
    reduceUnions    =>  1
    reduceUnionsForComparison   =>  1
    resolution  =>  undef
    showExtraParens =>  1
    tolExtraDigits  =>  1
    tolTruncation   =>  1
    tolType =>  relative
    tolerance   =>  0.01
    useBaseTenLog   =>  0
    useFuzzyReals   =>  1
    useMathQuill    =>  1
    zeroLevel   =>  1E-14
    zeroLevelTol    =>  1E-12

    new AnSwEr0001: AnswerEvaluator=HASH(0x55d09fcd6418) -- ans:
    AnswerHash
    _filter_name    =>  dereference_array_ans
    ans_label   =>  AnSwEr0001
    ans_message =>  
    correct_ans =>  3.14159
    correct_ans_latex_string    =>  3.14159
    correct_value   => context  => ...
                       data    =>  [ 3.14159265358979 ]
                       equation => ...
    done    =>  1
    error_flag  =>  undef
    error_message   =>  
    ignoreInfinity  =>  1
    ignoreStrings   =>  1
    original_student_ans    =>  
    preview_latex_string    =>  undef
    preview_text_string =>  undef
    score   =>  0
    showEqualErrors =>  1
    showTypeWarnings    =>  1
    showUnionReduceWarnings =>  1
    student_ans =>  
    studentsMustReduceUnions    =>  1
    type    =>  Value (Real)

Thanks again to everyone for help.

I'm not sure if this was part of your question, but if you make it possible for instructors to log in to the course with a username/password, you have to also make the login screen availabe to students. That may or may not be frustrating to a student who does not know their WeBWorK username or has no password (because their account was created with LTI). They can enter from Canvas, then time out, and when they refresh the page they are at the login screen with no indication that they should actually go back to Canvas.

Something else to consider. You could ask your Canvas admin team for a special Canvas course that is just for you to administer WeBWorK from. You could then use this course to put LTI links that lead into the various WeBWorK courses that you need to enter. This should work, assuming you already have a user account in each of those WeBWorK courses.

Thanks for the message. I see the logs in the usual spot, yes. No messages about grades previous over the last 4 days.

I set the `debug_lti_grade_passback = 1` conf in `authen_LTI.conf`, and the refresh interval to 60 seconds. I do get some messages. There's a series of

  • LTI Mass Update: Queueing grade update for all sets and users.
which is appearing in both the logs and on the pages for the courses. This slowly proceeds through specific pages, which may just be users who are loading those specific pages and getting the message? It seems almost random what's triggering and not. But then the message went away for one specific course where I can see both Blackboard and WeBWorK at the same time, and no grades have been updated. 

Any idea what exact mechanism the queueing takes on, and whether it logs to webwork2.log? With a 60 second timing, I would have expected more messages, and maybe some failures, if it wasn't working?

The grades will refresh if students visit the assignment again after the refresh period.

I have a related problem. During the summer semesters grades are due a day after the final exam, in less than 24 hours. Our grade pass is set to refresh grades every 24 hours. It also requires that a student visits the homework assignment. Sometimes what happens is that students don't go to the homework anymore (especially if Blackboard closes access for them after the semester ends) and the grades are not refreshed. I see that by comparing grades in WeBWorK and Blackboard.
In these cases I "enter student preview" in Blackboard and visit the assignment myself so that grade transfer is re-initiated. It takes a few minutes.

Ah, a nice simple fix -- thank you!

I ended up needing to run "npm ci" twice.  The first time was using Ubuntu 22.04's node package, which is still at version 12, and I got syntax errors.  I ended up installing the official node 18 binaries from nodejs.org and using those, but apparently I did that after I'd started the webwork2 service and didn't think to restart it.

Thanks again!

You need to restart the webwork2 app.  Run "sudo systemctl restart webwork2" for this.

What is happening is that you have run "npm ci" after starting the webwork2 app initially, and changed the static-assets.json file.  Since the server has already loaded the old version of that file (or failed to load it if you hadn't run "npm ci" before starting the server), any worker that has not been restarted since the app started will not get the correct minimized file names.  When you refresh the page in the browser you might get lucky and use a worker that has been restarted, or not.  If a worker that has been restarted is used, you get the correct link.  Otherwise it falls back to the original filename without the minimized hash.

When you restart the app, all workers are restarted and the issue will be fixed.

This is expected behavior.  It is tantamount to needing to restart apache2 prior to webwork 2.18.  In fact exactly the same behavior could be observed with webwork 2.17 in this scenario.