Installation

Upgrade to 2.19: displaying tables and correct answers

Upgrade to 2.19: displaying tables and correct answers

by Peter Lert -
Number of replies: 0

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.