Forums

Search results: 169

Thank you for your reply

I did this in order to be sure to modify the right thing

In /opt/webwork/pg/lib/WeBWorK/PG/Translator.pm

if ($ansCount > 1 ) {
                $problem_result{msg} = maketext('I2n order to get credit for this problem all answers must be correct.') ;
        }

I modified the fr.po, I restarted the apache, refreshed the page but I still have In order to get credit for this problem all answers must be correct.

I checked on the DB and I did not find anything too.


WeBWorK Problems -> Issue with contextPercent.pl

by Kyle Besing -

After an update of the Ubuntu distribution running out WeBWorK server, I have encountered the following error for a few of our problems. I have tried making the change to the XMLRPC/Lite.pm file mentioned here to try to deal with a possible issue with UTF-8 to no avail. Does anyone know what might be causing this?


Thanks,

Kyle

WeBWorK Error

WeBWorK has encountered a software error while attempting to process this problem. It is likely that there is an error in the problem itself. If you are a student, report this error message to your professor to have it corrected. If you are a professor, please consult the error output below for more information.

Error messages

ERRORS from evaluating PG file:
Error detected while loading [PG]/macros/contextPercent.pl: PG_macro_file_eval detected error at line 124 of file [PG]/lib/PGloadfiles.pm Malformed UTF-8 character (fatal) at line 1 of (eval 8503), chunk 1. The calling package is PGloadfiles Died within PGloadfiles::compile_file called at line 172 of [PG]/lib/PGloadfiles.pm from within PGloadfiles::loadMacros called at line 581 of [PG]/macros/PG.pl from within main::loadMacros called at line 24 of (eval 8256)

Error details

        Problem2
1. ERROR caught by Translator while processing problem file:Library/PCC/BasicMath/MeanMedianMode/MeanMedianMode230.pg
****************
ERRORS from evaluating PG file: 
Error detected while loading [PG]/macros/contextPercent.pl: PG_macro_file_eval detected error at line 124 of file [PG]/lib/PGloadfiles.pm Malformed UTF-8 character (fatal) at line 1 of (eval 8503), chunk 1. The calling package is PGloadfiles Died within PGloadfiles::compile_file called at line 172 of [PG]/lib/PGloadfiles.pm from within PGloadfiles::loadMacros called at line 581 of [PG]/macros/PG.pl from within main::loadMacros called at line 24 of (eval 8256)
****************
------Input Read 1 # WeBWorK problem written by Carl Yao 2 # Portland Community College 3 # 4 # Given a bar graph with two colors of bars, find the mean of two groups of data. 5 # 6 # Last edited by Carl Yao on 12/20/13 7 # 8 # ENDDESCRIPTION 9 10 ## DBCCSS('6.SP') 11 ## DBsubject(Statistics) 12 ## DBchapter(Exploratory data analysis/descriptive statistics) 13 ## DBsection(Summary statistics) 14 ## Institution(PCC) 15 ## Author(Carl Yao) 16 ## Level(2) 17 ## MO(1) 18 ## KEYWORDS('mean','application','bar graph') 19 20 ############################################## 21 22 DOCUMENT(); 23 24 loadMacros( 25 "PGstandard.pl", 26 "PGgraphmacros.pl", 27 "MathObjects.pl", 28 "PGML.pl", 29 "contextPercent.pl", 30 "parserPopUp.pl", 31 "PCCmacros.pl", 32 "PGcourse.pl" 33 ); 34 35 ############################################## 36 37 sub drawSquare { 38 my ($x,$y,$color) = @_; 39 $xside = ($xmax-$xmin)/40; 40 $yside = ($ymax-$ymin)/40; 41 $picture->moveTo($x,$y); 42 $picture->lineTo($x, $y-$yside, $color, 1); 43 $picture->lineTo($x+$xside, $y-$yside, $color, 1); 44 $picture->lineTo($x+$xside, $y, $color, 1); 45 $picture->lineTo($x, $y, $color, 1); 46 $picture->fillRegion([ $x+$xside/2, $y-$yside/2, $color ]); 47 } 48 49 sub sortSB { 50 my $ref_array = shift; 51 my $num = @$ref_array; 52 for my $i (0..$num-2) { 53 for my $j ($i+1..$num-1) { 54 if (${$ref_array}[$i]>${$ref_array}[$j]) { 55 (${$ref_array}[$i],${$ref_array}[$j]) = (${$ref_array}[$j],${$ref_array}[$i]); 56 } 57 } 58 } 59 } 60 61 ############################################## 62 63 Context("LimitedNumeric"); 64 65 $numBars = 4; 66 $maxLimit = 30; 67 68 @terms = ("Fall","Winter","Spring","Summer"); 69 @numMale = (); 70 @numFemale = (); 71 72 do { 73 74 $totalMale = 0; 75 $totalFemale = 0; 76 77 for my $i (0..$numBars-1) { 78 $numMale[$i] = int($maxLimit/2)+random(-1,1,2)*random(1,int($maxLimit/3),1); 79 $numFemale[$i] = $maxLimit - $numMale[$i]; 80 81 $totalMale = $totalMale+$numMale[$i]; 82 $totalFemale = $totalFemale+$numFemale[$i]; 83 } 84 85 $meanMale = $totalMale/$numBars; 86 $meanFemale = $totalFemale/$numBars; 87 88 @numMaleSorted = @numMale; 89 sortSB(~~@numMaleSorted); 90 @numFemaleSorted = @numFemale; 91 sortSB(~~@numFemaleSorted); 92 93 $orderedMale = ""; 94 $orderedFemale = ""; 95 for my $i (0..$numBars-1) { 96 $orderedMale = $orderedMale."`$numMaleSorted[$i]`, "; 97 $orderedFemale = $orderedFemale."`$numFemaleSorted[$i]`, "; 98 } 99 chop($orderedMale);chop($orderedMale); 100 chop($orderedFemale);chop($orderedFemale); 101 102 $medianMale = 103 ($numMaleSorted[int($numBars/2)-1]+$numMaleSorted[int($numBars/2)])/2; 104 $medianFemale = 105 ($numFemaleSorted[int($numBars/2)-1]+$numFemaleSorted[int($numBars/2)])/2; 106 107 } until ( (($meanMale>$meanFemale) && ($medianMale<$medianFemale)) || (($meanMale<$meanFemale) && ($medianMale>$medianFemale)) ); 108 109 $popup = PopUp(["?", "mean", "median"], "mean"); 110 111 $yCover = $maxLimit; 112 $ystep = $yCover/6; 113 $xstep = 1; 114 115 $xmin = -$xstep; #The viewing window 116 $xmax = $numBars+2*$xstep; 117 $ymin = -$ystep; 118 $ymax = $yCover+$ystep; 119 120 $picture = init_graph($xmin,$ymin,$xmax,$ymax, 121 pixels=>[400,400]); 122 $picture->lb('reset'); 123 124 $picture->moveTo(0,0); 125 $picture->lineTo($xmax-$xstep/2, 0, 'black',3); 126 $picture->moveTo(0,0); 127 $picture->arrowTo(0, $ymax-$ystep/2, 'black',3); 128 129 for my $i (0..$yCover/$ystep) { 130 $picture->stamps( closed_circle(0,$i*$ystep,'blue') ); 131 $mark = $i*$ystep; 132 $picture->lb( new Label(-$xstep/2,$i*$ystep,"$mark",'black','center','middle')); 133 } 134 135 $picture->lb( new Label($xmax-$xstep/3,-$ystep/4,"terms",'black','right','middle')); 136 $picture->lb( new Label($xstep/4,$ymax-$ystep/3,"number of students",'black','left','middle')); 137 138 drawSquare($numBars-1,$ymax-$ystep/3,'red'); 139 $picture->lb( new Label($numBars-1+$xstep/3,$ymax-$ystep/3,"male students",'red','left','top')); 140 drawSquare($numBars-1,$ymax-$ystep*2/3,'green'); 141 $picture->lb( new Label($numBars-1+$xstep/3,$ymax-$ystep*2/3,"female students",'green','left','top')); 142 143 $alt = "This graph has two sets of bar graphs comparing male and female students in a certain class. "; 144 for my $i (0..$numBars-1) { 145 $picture->lb( new Label(($i+1)*$xstep,-$ystep/4, 146 $terms[$i],'black','center','middle')); 147 148 $picture->moveTo(($i+1-0.4)*$xstep,0); 149 $picture->lineTo(($i+1-0.4)*$xstep,$numMale[$i],'red',1); 150 $picture->lineTo(($i+1)*$xstep,$numMale[$i],'red',1); 151 $picture->lineTo(($i+1)*$xstep,0,'red',1); 152 $picture->fillRegion([ ($i+1-0.2)*$xstep,$numMale[$i]/2,'red' ]); 153 $picture->lb( new Label(($i+1-0.2)*$xstep,$numMale[$i]+$ystep/4, 154 "$numMale[$i]",'red','center','middle')); 155 156 $picture->moveTo(($i+1+0.4)*$xstep,0); 157 $picture->lineTo(($i+1+0.4)*$xstep,$numFemale[$i],'green',1); 158 $picture->lineTo(($i+1)*$xstep,$numFemale[$i],'green',1); 159 $picture->lineTo(($i+1)*$xstep,0,'green',1); 160 $picture->fillRegion([ ($i+1+0.2)*$xstep,$numFemale[$i]/2,'green' ]); 161 $picture->lb( new Label(($i+1+0.2)*$xstep,$numFemale[$i]+$ystep/4, 162 "$numFemale[$i]",'green','center','middle')); 163 164 $alt = $alt."In $terms[$i] Term, this class had $numMale[$i] male students and $numFemale[$i] female students. "; 165 } 166 chop($alt); 167 168 ############################################## 169 170 TEXT(beginproblem()); 171 $refreshCachedImages = 1; 172 173 BEGIN_TEXT 174 175 This bar graph compares male and female student enrollment in a certain class at a community college in a certain school year. $PAR 176 177 $BCENTER 178 \{ image(insertGraph( $picture ), tex_size=>400, height=>400, width=>400, extra_html_tags => 'alt = "$alt" title = "$alt"') \} 179 $ECENTER 180 $PAR 181 182 END_TEXT 183 BEGIN_PGML 184 185 Answer the following questions. 186 187 *Question 1:* In these [`4`] terms, the mean number of male students in this class was [__________]{$meanMale}. 188 189 *Question 2:* In these [`4`] terms, the mean number of female students in this class was [__________]{$meanFemale}. 190 191 *Question 3:* In these [`4`] terms, the median of male students in this class was [__________]{$medianMale}. 192 193 *Question 4:* In these [`4`] terms, the median of female students in this class was [__________]{$medianFemale}. 194 195 *Question 5:* If you want to know, in all [`4`] terms, there are more male or female students, should you compare the mean or median? 196 197 [@$popup->menu()@]* 198 199 END_PGML 200 201 ############################################## 202 203 ANS( $popup->cmp() ); 204 205 $midM1 = $numMaleSorted[$numBars/2-1]; 206 $midM2 = $numMaleSorted[$numBars/2]; 207 $outputM = "There are two numbers in the middle: `$midM1` and `$midM2`. The median is the mean of these two numbers: `\frac{$midM1+$midM2}{2}=$medianMale`."; 208 209 $midF1 = $numFemaleSorted[$numBars/2-1]; 210 $midF2 = $numFemaleSorted[$numBars/2]; 211 $outputF = "There are two numbers in the middle: `$midF1` and `$midF2`. The median is the mean of these two numbers: `\frac{$midF1+$midF2}{2}=$medianFemale`."; 212 213 if ($meanMale>$meanFemale) { 214 $output1 = "The mean of male students is bigger than that of female students, so more male students attended this class in all four terms. Notice that the median of female students is actually bigger than that of male students."; 215 } else { 216 $output1 = "The mean of female students is bigger than that of male students, so more female students attended this class in all four terms. Notice that the median of male students is actually bigger than that of female students."; 217 } 218 219 ############################################## 220 221 BEGIN_PGML_SOLUTION 222 223 ####Question 1 224 225 To find the mean number of male students in this class, we first add up the number of male students in all [`4`] terms: 226 227 [`` [@$numMale[0]@] + [@$numMale[1]@] + [@$numMale[2]@] + [@$numMale[3]@] = [$totalMale] ``] 228 229 Now we can find the mean by dividing the sum by the number of terms ([`4`]): 230 231 [`` \text{mean} = \frac{[$totalMale]}{4} = [$meanMale] ``] 232 233 *Solution:* In these [`4`] terms, the mean number of male students in this class was [`[$meanMale]`]. 234 235 ---- 236 237 ####Question 2 238 239 To find the mean number of female students in this class, we first add up the number of female students in all [`4`] terms: 240 241 [`` [@$numFemale[0]@] + [@$numFemale[1]@] + [@$numFemale[2]@] + [@$numFemale[3]@] = [$totalFemale] ``] 242 243 Now we can find the mean by dividing the sum by the number of terms ([`4`]): 244 245 [`` \text{mean} = \frac{[$totalFemale]}{4} = [$meanFemale] ``] 246 247 *Solution:* In these [`4`] terms, the mean number of female students in this class was [`[$meanFemale]`]. 248 249 ---- 250 251 ####Question 3 252 253 To find the median number of male students, we first need to order the number of male students in all [`4`] terms: 254 255 [$orderedMale] 256 257 [$outputM] 258 259 *Solution:* In these [`4`] terms, the median of male students in this class was [`[$medianMale]`]. 260 261 ---- 262 263 ####Question 4 264 265 To find the median number of female students, we first need to order the number of female students in all [`4`] terms: 266 267 [$orderedFemale] 268 269 [$outputF] 270 271 *Solution:* In these [`4`] terms, the median of female students in this class was [`[$medianFemale]`]. 272 273 ---- 274 275 ####Question 5 276 277 To compare the total number of male and female students in all [`4`] terms, we should compare the mean. The median is not accurate because some numbers were not considered; as a comparison, each number is used when the mean is calculated. 278 279 [$output1] 280 281 Don't think that the median is not useful. When there are outliers (very big or small numbers compared to most numbers in the group), the median is better than mean. That's why in newspapers, you will more than likely see "the median house price" than "the mean house price," etc. 282 283 END_PGML_SOLUTION 284 285 ENDDOCUMENT();

I was able to use the directions here

https://michaelgage.blogspot.com/2015/06/whether-writing-full-text-book-or-just.html

to successfully embed WW problems from my server in a web page. A couple of questions:

(1) In the iframe code you pass a randomization seed using "&problemSeed=123567890". Is there a way to get the randomization to change whenever you refresh the page, or is there a way to have a button on the problem to change the randomization?

(2) The account I created to do all this (see the instructions above) has login_proctor permissions. I find that as long as one knows the file system path to the pg file, they can use this account to view the entire problem. Is there a way to impose a restriction so that this user can only view problem files in a certain directory or directories?

(3) Can I somehow change or add to the list of parameters in the iframe code so that the solution to the problem is only visible after a certain number of attempts, instead of being immediately accessible?

--Keir
I did the patch and restarted my webservers. Now when I hit the randomize button I get ... quite an error message (see below). Perhaps I can try to avoid the not equals sign.

--Keir

WebworkClient Errors
Errors:
not well-formed (invalid token) at line 1, column 7480, byte 7482 at /usr/lib/x86_64-linux-gnu/perl5/5.30/XML/Parser.pm line 187. PG_ANSWERS_HASHAnSwEr0001responseresponse_orderAnSwEr0001responsesAnSwEr0001answergroup_labelAnSwEr0001ans_labelAnSwEr0001ans_evaldebugevaluatorsCODE referencepre_filtersCODE referencerh_ansstudentsMustReduceUnions1showTypeWarnings1ignoreStrings1correct_valueparser::PopUp referencecorrect_ans_latex_string\text{=}ans_labelignoreInfinity1showUnionReduceWarnings1original_student_anserror_flagtypeValue (PopUp)score0showEqualErrors1error_messagecorrect_ans=student_anstypeMatchValue::Realpreview_latex_stringans_messagepreview_text_stringpost_filtersCODE referenceactive1AnSwEr0002ans_labelAnSwEr0002responseanswergroup_labelAnSwEr0002response_orderAnSwEr0002responsesAnSwEr0002active1ans_evalevaluatorsCODE referencedebugpre_filtersCODE referenceCODE referencecmp_prefilterpost_filtersCODE referenceCODE referencecmp_postfilterrh_ansshowTypeWarnings1correct_valueValue::Formula referenceignoreStrings1studentsMustReduceUnions1upToConstant0correct_ans_latex_string2showDomainErrors1ans_labelignoreInfinity1showUnionReduceWarnings1error_flagoriginal_student_anstypeValue (Formula)score0showEqualErrors1correct_ans2error_messagestudent_anspreview_latex_stringpreview_text_stringans_messageAnSwEr0003ans_evaldebugevaluatorsCODE referencepre_filtersCODE referencerh_anspreview_text_stringans_messagepreview_latex_stringtypeMatchValue::Realstudent_anscorrect_ansâ error_messageshowEqualErrors1score0typeValue (PopUp)original_student_anserror_flagshowUnionReduceWarnings1ignoreInfinity1ans_labelcorrect_ans_latex_string{\verbâ }showTypeWarnings1correct_valueparser::PopUp referenceignoreStrings1studentsMustReduceUnions1post_filtersCODE referenceactive1responseanswergroup_labelAnSwEr0003responsesAnSwEr0003response_orderAnSwEr0003ans_labelAnSwEr0003AnSwEr0004ans_evalrh_ansshowEqualErrors1score0correct_ans-2error_messagepreview_latex_stringstudent_anspreview_text_stringans_messageignoreStrings1showTypeWarnings1correct_valueValue::Formula referencestudentsMustReduceUnions1upToConstant0ans_labelshowDomainErrors1correct_ans_latex_string-2error_flagoriginal_student_ansignoreInfinity1showUnionReduceWarnings1typeValue (Formula)post_filtersCODE referenceCODE referencecmp_postfilterpre_filtersCODE referenceCODE referencecmp_prefilterevaluatorsCODE referencedebugactive1responseresponse_orderAnSwEr0004responsesAnSwEr0004answergroup_labelAnSwEr0004ans_labelAnSwEr0004AnSwEr0005ans_labelAnSwEr0005responseanswergroup_labelAnSwEr0005responsesAnSwEr0005response_orderAnSwEr0005active1ans_evalevaluatorsCODE referencedebugpre_filtersCODE referencepost_filtersCODE referencerh_anscorrect_ans_latex_string{\verbâ }ans_labelignoreStrings1correct_valueparser::PopUp referenceshowTypeWarnings1studentsMustReduceUnions1typeValue (PopUp)showUnionReduceWarnings1ignoreInfinity1error_flagoriginal_student_anserror_messagecorrect_ansâ score0showEqualErrors1preview_text_stringans_messagetypeMatchValue::Realstudent_anspreview_latex_stringAnSwEr0006ans_evalrh_anstypeValue (Formula)showUnionReduceWarnings1ignoreInfinity1error_flagoriginal_student_anscorrect_ans_latex_string2showDomainErrors1ans_labelcorrect_valueValue::Formula referenceshowTypeWarnings1ignoreStrings1upToConstant0studentsMustReduceUnions1preview_text_stringans_messagestudent_anspreview_latex_stringcorrect_ans2error_messagescore0showEqualErrors1post_filtersCODE referenceCODE referencecmp_postfilterpre_filtersCODE referenceCODE referencecmp_prefilterevaluatorsCODE referencedebugactive1responseanswergroup_labelAnSwEr0006response_orderAnSwEr0006responsesAnSwEr0006ans_labelAnSwEr0006AnSwEr0007ans_evalpost_filtersCODE referencerh_ansshowEqualErrors1score0error_messagecorrect_ans=preview_latex_stringtypeMatchValue::Realstudent_anspreview_text_stringans_messagecorrect_valueparser::PopUp referenceignoreStrings1showTypeWarnings1studentsMustReduceUnions1ans_labelcorrect_ans_latex_string\text{=}original_student_anserror_flagshowUnionReduceWarnings1ignoreInfinity1typeValue (PopUp)pre_filtersCODE referenceevaluatorsCODE referencedebugactive1responseanswergroup_labelAnSwEr0007response_orderAnSwEr0007responsesAnSwEr0007ans_labelAnSwEr0007AnSwEr0008responseanswergroup_labelAnSwEr0008responsesAnSwEr0008response_orderAnSwEr0008ans_labelAnSwEr0008ans_evalpost_filtersCODE referencerh_anspreview_text_stringans_messagepreview_latex_stringtypeMatchValue::Realstudent_anserror_messagecorrect_ansANYshowEqualErrors1score0typeValue (String)error_flagoriginal_student_ansshowUnionReduceWarnings1ignoreInfinity1ans_labelcorrect_ans_latex_string\text{ANY}correct_valueValue::String referenceshowTypeWarnings1ignoreStrings1studentsMustReduceUnions1pre_filtersCODE referencedebugevaluatorsCODE referenceactive1AnSwEr0009ans_evalrh_ansstudent_anstypeMatchValue::Realpreview_latex_stringans_messagepreview_text_stringscore0showEqualErrors1correct_ans=error_messageignoreInfinity1showUnionReduceWarnings1error_flagoriginal_student_anstypeValue (PopUp)studentsMustReduceUnions1correct_valueparser::PopUp referenceshowTypeWarnings1ignoreStrings1correct_ans_latex_string\text{=}ans_labelpost_filtersCODE referenceevaluatorsCODE referencedebugpre_filtersCODE referenceactive1responseresponse_orderAnSwEr0009responsesAnSwEr0009answergroup_labelAnSwEr0009ans_labelAnSwEr0009AnSwEr0010ans_labelAnSwEr0010responseresponsesAnSwEr0010response_orderAnSwEr0010answergroup_labelAnSwEr0010active1ans_evalpost_filtersCODE referenceCODE referencecmp_postfilterrh_ansans_messagepreview_text_stringstudent_anspreview_latex_stringerror_messagecorrect_ans2score0showEqualErrors1typeValue (Formula)showUnionReduceWarnings1ignoreInfinity1error_flagoriginal_student_ansshowDomainErrors1correct_ans_latex_string2ans_labelstudentsMustReduceUnions1upToConstant0ignoreStrings1correct_valueValue::Formula referenceshowTypeWarnings1pre_filtersCODE referenceCODE referencecmp_prefilterdebugevaluatorsCODE referenceAnSwEr0011ans_evalpost_filtersCODE referencerh_ansscore0showEqualErrors1correct_ans=error_messagestudent_anstypeMatchValue::Realpreview_latex_stringans_messagepreview_text_stringstudentsMustReduceUnions1correct_valueparser::PopUp referenceignoreStrings1showTypeWarnings1correct_ans_latex_string\text{=}ans_labelshowUnionReduceWarnings1ignoreInfinity1error_flagoriginal_student_anstypeValue (PopUp)evaluatorsCODE referencedebugpre_filtersCODE referenceactive1responseanswergroup_labelAnSwEr0011response_orderAnSwEr0011responsesAnSwEr0011ans_labelAnSwEr0011AnSwEr0012ans_labelAnSwEr0012responseanswergroup_labelAnSwEr0012response_orderAnSwEr0012responsesAnSwEr0012active1ans_evalrh_anspreview_latex_stringstudent_anspreview_text_stringans_messageshowEqualErrors1score0error_messagecorrect_ans-2error_flagoriginal_student_ansshowUnionReduceWarnings1ignoreInfinity1typeValue (Formula)ignoreStrings1showTypeWarnings1correct_valueValue::Formula referencestudentsMustReduceUnions1upToConstant0ans_labelshowDomainErrors1correct_ans_latex_string-2post_filtersCODE referenceCODE referencecmp_postfilterevaluatorsCODE referencedebugpre_filtersCODE referenceCODE referencecmp_prefilteranswersflagsANSWER_ENTRY_ORDERAnSwEr0001AnSwEr0002AnSwEr0003AnSwEr0004AnSwEr0005AnSwEr0006AnSwEr0007AnSwEr0008AnSwEr0009AnSwEr0010AnSwEr0011AnSwEr0012KEPT_EXTRA_ANSWERSAnSwEr0001AnSwEr0002AnSwEr0003AnSwEr0004AnSwEr0005AnSwEr0006AnSwEr0007AnSwEr0008AnSwEr0009AnSwEr0010AnSwEr0011AnSwEr0012recordSubmittedAnswers1showHint1showPartialCorrectAnswers1PROBLEM_GRADER_TO_USEshowHintLimit1commenthintExists0solutionExists1refreshCachedImages0showpartialCorrectAnswers1problem_resulterrorsuserIDklockridcompute_time 0 wallclock secs ( 0.19 usr + 0.00 sys = 0.19 CPU)debug_messagestextPHNjcmlwdCB0eXBlPSJ0ZXh0L3gtbWF0aGpheC1jb25maWciPgogICAgICAgICAgICAgICAgICBN YXRoSmF4Lkh1Yi5Db25maWcoewogICAgICAgICAgICAg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IiBjbGFzcz0idGV4Mmph eF9pZ25vcmUiPnNlbGVjdDwvb3B0aW9uPgo8b3B0aW9uIHZhbHVlPSI9IiBjbGFzcz0idGV4Mmph eF9pZ25vcmUiPj08L29wdGlvbj4KPG9wdGlvbiB2YWx1ZT0i4omgIiBjbGFzcz0idGV4MmpheF9p Z25vcmUiPuKJoDwvb3B0aW9uPgo8L3NlbGVjdD4gPGlucHV0IHR5cGU9dGV4dCBjbGFzcz0iY29k ZXNoYXJkIiBzaXplPTUgbmFtZT0iQW5Td0VyMDAxMiIgaWQ9IkFuU3dFcjAwMTIiIGFyaWEtbGFi ZWw9ImFuc3dlciAxMiAiIGRpcj0iYXV0byIgYXV0b2NvbXBsZXRlPSJvZmYiIGF1dG9jb3JyZWN0 PSJvZmYiIGF1dG9jYXBpdGFsaXplPSJvZmYiIHNwZWxsY2hlY2s9ImZhbHNlIiB2YWx1ZT0iIj4K PGlucHV0IHR5cGU9aGlkZGVuIG5hbWU9InByZXZpb3VzX0FuU3dFcjAwMTIiIHZhbHVlPSIiPgo8 L2Rpdj4KPGRpdiBzdHlsZT0ibWFyZ2luLXRvcDoxZW0iPjwvZGl2Pgo8L2Rpdj4K session_keygSkr8At4yLwp9mSbpOQvGI1hE6tPQ7ctheader_textproblem_statewarning_messages
------The current problem set number setNumber is not defined
------The current problem number probNum is not definedinternal_debug_messagescourseIDmath212f2012WARNINGSV0FSTklOR1MKCjxici8+TW9yZTxici8+Cg== at /opt/webwork/webwork2/lib/WebworkClient.pm line 302.

End Errors
WeBWorK error
An error occured while processing your request. For help, please send mail to this site's webmaster (webmaster@localhost), including all of the following information as well as what what you were doing when the error occured.

Thu Jun 11 14:17:02 2020

Warning messages
Error messages
xmlrpcCall to renderProblem returned no result for
Call stack
The information below can help locate the source of the problem.

in WeBWorK::ContentGenerator::instructorXMLHandler::content called at line 233 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
in WeBWorK::ContentGenerator::go called at line 386 of /opt/webwork/webwork2/lib/WeBWorK.pm
Request information
Method POST
URI /webwork2/instructorXMLHandler
HTTP Headers
Sec-Fetch-Dest empty
X-Requested-With XMLHttpRequest
Accept-Language en-US,en;q=0.9
Cookie WeBWorKCourseAuthen.math212f2012=klockrid%09gSkr8At4yLwp9mSbpOQvGI1hE6tPQ7ct%091591899416; qa_noticed=1; username-gettysburgmath-org-8888="2|1:0|10:1590183835|32:username-XXX-org-8888|44:OGM1M2VmYmU4NmY5NGE4OWIxODBhNjJlNTY0YzE1YjM=|e8dc5529c5fd88e707d3080cac270ebc09eb701c648b1d7d310eb255fa565725"
Connection keep-alive
Accept */*
Content-Type application/x-www-form-urlencoded; charset=UTF-8
Accept-Encoding gzip, deflate, br
Content-Length 390

WeBWorK Main Forum -> Gateway quiz issues

by Michael Gage -

Tue May 05 00:45:39 2020: Request 9985 was acted upon.
Transaction: Ticket created by lttcxyang12@gmail.com
      Queue: Hosting
    Subject: Technical Issues
      Owner: Nobody
 Requestors: lttcxyang12@gmail.com
  

Hello!
I hope this email finds you well. I am writing to hopefully get some
assistance with some technical issues regarding a WebWork course. I am
currently taking MAT 170 at ASU with Professor Firrozzaman, and I have
experienced a weird bug with the last couple of proctor password protected
tests.

When I go to click "grade test" it clears all my answers and brings me back
to the screen that asks me to enter the password. I have tried
numerous times- whether it be logging out of webwork, restarting my
computer, refreshing the page, but the timer for the test still runs, and I
am unable to submit my test.
If there is anything that I can do to fix this problem, please let me know
as soon as possible.
Thank you all so much for your time and help, and I hope you have a
wonderful evening.


--
Lucy Yang
ASU Architecture

The most important thing is to set MaxConnectionsPerChild to something greater than 0 (i.e. not unlimited). I use 100, but 50 is also a good choice if you're running a lot of gateway quizzes.
With 32GB of RAM you can probably leave MaxRequestWorkers at 150, but if you continue to run into trouble that would be the value to lower.

In terms of students logging off, that should make no difference to WW performance. The server is only working when a page is loaded, so a student having an active session shouldn't have any effect.

The idle time before a student is logged out is controlled by the variable $sessionKeyTimeout, which defaults to 30 minutes. You can increase that by overriding this variable in localOverrides.conf. Just note that it is measured in seconds, so to set the timeout to 60 minutes you would use
$sessionKeyTimeout = 60*60;

It's worth noting that the timeout resets every time a page is loaded, so if a student clicks "preview answers" it will refresh their session. It's also worth encouraging the students to preview often when working on a gateway quiz because this saves their answers to the database, which means they can be restored if the student has computer problems, and also can be accessed if a student doesn't submit in time.
I tried the Gateway quiz with a short quiz I had used to test timing for students in class of 45 - to see if that many students wold slow the Webwork server. I had included an interactive graphics problem, (move vectors to the correct location on a graph).
The graphics part was coded using Geogebra. The problem was that the answers to the graphics part were not recorded. The answers to the submit a number and use the drop-down menu for multiple choice worked OK. But the answer was recorded as if the graphics were totally wrong. The problem worked well when given in a short timed test as a homework type. But the same problem as a Gateway quiz didn't record the graphics answers - it drew the graph and allowed movement of the vectors OK, but when the student submitted no record of the graphic input.

The code is below

## DESCRIPTION
# Problem for 'NCSU ECE451 Lu'.
# WeBWorK problem written by H. J. Trussell, <hjt@ncsu.edu>
# ENDDESCRIPTION

## DBsubject(Electrical Engineering)
## DBchapter(CHAPTER 3 The Synchronous Machine)
## DBsection(NA)
## Institution(North Carolina State University)
## Autho(H. J. Trussell)
## TitleText1('Fundamentals of Applied Electromagnetics')
## AuthorText1('John Grainger, Jr.', 'William Stevenson ')
## EditionText1('1')
## Problem1('3.3')
## Keywords('three-phase synchronous generator')
## Resources()

DOCUMENT();

loadMacros("PG.pl",
"PGstandard.pl", # Standard macros for PG language
"MathObjects.pl",
"PGinfo.pl",
"AppletObjects.pl",
"PGcourse.pl", # Customization file for the course
"parserPopUp.pl",
"AnswerFormatHelp.pl",
"answerHints.pl",
);

TEXT(beginproblem());

Context("Complex");
Context()->flags->set(
tolerance => 0.01,
tolType => "absolute",
);

Context()->variables->are(t=>'Real');
Context()->{format}{number} = "%.4f#";

#Initialize values, to be changed for each question
$Xd = Real(random(1,1.5,0.1)); # pu
#$Va_Mag = Real(random(1,2,0.2)); # V
$Va_Mag = Real(1.0); # V
$Va_Ang = 0;
$Ia1_Mag = Real(random(1,2,0.2)); # A
$Ia1_Ang = Real(random(20,40,5)); # degrees
$Ia2_Mag = Real(random(1,2,0.2)); # A
$Ia2_Ang = 0; # degrees
$Ia3_Mag = Real(random(1,2,0.2)); # A
$Ia3_Ang = -$Ia1_Ang; # degrees

# default values for checking
#$Xd = Real(1.65); $Va_Mag = Real(1); $Ia1_Mag = Real(1); $Ia1_Ang = Real(30); #$Ia2_Mag = Real(1); $Ia3_Mag = Real(1);

# Answer calculation
$Ia1_Ang_rad = Compute($Ia1_Ang*pi/180);
$Ei1 = Compute($Va_Mag*exp(j*$Va_Ang) + $Ia1_Mag*$Xd*exp(j* ($Ia1_Ang_rad + pi/2)));
$I_Xd_prod = Compute($Ia1_Mag*$Xd);
$I_Xd_Ang = Compute($Ia1_Ang + 90);
$Ei1_Mag = Compute(abs($Ei1));
$Ei1_Ang = Compute(arg($Ei1));
$Ei1_Ang_deg = Compute($Ei1_Ang*180/pi);

$Ia2_Ang_rad = Compute($Ia2_Ang*pi/180);
$Ei2 = Compute($Va_Mag*exp(j*$Va_Ang) + $Ia2_Mag*$Xd*exp(j* ($Ia2_Ang_rad + pi/2)));
$I_Xd_prod2 = Compute($Ia2_Mag*$Xd);
$I_Xd_Ang2 = Compute($Ia2_Ang + 90);
$Ei2_Mag = Compute(abs($Ei2));
$Ei2_Ang = Compute(arg($Ei2));
$Ei2_Ang_deg = Compute($Ei2_Ang*180/pi);

$Ia3_Ang_rad = Compute($Ia3_Ang*pi/180);
$Ei3 = Compute($Va_Mag*exp(j*$Va_Ang) + $Ia3_Mag*$Xd*exp(j* ($Ia3_Ang_rad + pi/2)));
$I_Xd_prod3 = Compute($Ia3_Mag*$Xd);
$I_Xd_Ang3 = Compute($Ia3_Ang + 90);
$Ei3_Mag = Compute(abs($Ei3));
$Ei3_Ang = Compute(arg($Ei3));
$Ei3_Ang_deg = Compute($Ei3_Ang*180/pi);

$Xd_Ang_rad_1 = Compute($Ia1_Ang_rad + pi/2);
$answer1 = Real(60*60/(4/2));
$popupA = PopUp(["?", "increase", "decrease","remain the same"], "decrease");

$popupB = PopUp(["?", "increase", "decrease","remain the same"], "increase");



$answer = Compute("($Ia1_Mag,$Ia1_Ang_rad,$Ei1_Mag,$Ei1_Ang)");
@tol=(0.5,pi/60); # Magnitude Tolerance 0.1, Angular Tolerance 3 degrees
@type=(0,1,0,1,0,1); #0 for magnitude value, 1 for angular value in degrees


######################################
# Create link to applet:
###################################
# You can name your applet (anything reasonable :-) )
# Adjust the height and width as desired
# Paste the geogebra parameters in at the bottom of the page just above the
# command end command
# so that they don't get in the way
###################################

$appletName = "ggbfoo";
$applet = GeogebraWebApplet(
code => "geogebra.GeoGebraApplet",
archive => "geogebra.jar",
codebase => findAppletCodebase("geogebra.jar"),
appletName => $appletName,
appletId => $appletName,
submitActionAlias => 'getAppletValues', # default actionAlias
initializeActionAlias => '', # default actionAlias
setStateAlias => 'setXML',
getStateAlias => 'getXML',
setConfigAlias => '',
getConfigAlias => '',
returnFieldName => '',
width => 700, # may want to modify width
height => 700, # may want to modify height
# mayscript => "true",
debugMode => 0, # set debugMode to 0 for no debug
# to 1 to make xml representation visible
# to 2 to add alerts detailing progression
# through the applet
onInit => 'ggbOnInit',
type => 'geogebraweb',
submitActionScript => qq{ getQE('answerBox').value = getAppletValues() },
selfLoading => 1,
params => GEOGEBRA_PARAMS(),# paste parameters in
);


##################################
# Setup GeogebraWebApplet --
###################################
###############################################
#
# For persistence of GeoGebra applet state
# when answers are submitted or page is refreshed.
# Uses JavaScript interface to GeoGebra.

HEADER_TEXT(
qq!
<script language="javascript">
function ggbOnInit(param) {
if (param == "$appletName") {
applet_loaded(param,1); // report that applet is ready.
ww_applet_list[param].safe_applet_initialize(2);
}
}

</script>
<noscript>For this question to work properly, you must enable JavaScript, or use another browser (or computer) on which JavaScript works.</noscript>
!);

#######################################################
#
# For setting initial values in GeoGebra from WeBWorK
# Uses JavaScript interface to GeoGebra.
TEXT( MODES(TeX=>'', HTML=><<END_SCRIPT ) );
<script language="javascript">
function setAppletCoefficients() {
var applet=getApplet("$appletName"); // alert("Updating coefficients");
if (typeof(applet)!="undefined") {
if (typeof(applet.setValue)!="undefined") {
////////////////////////////////////////////////////////////////
// List the values of the parameters to be set in the applet here

} else {
setTimeout("setAppletCoefficients()", 1000);
}
} else {
setTimeout("setAppletCoefficients()",1000);
}
}
ww_applet_list["$appletName"].setConfig = function() {setAppletCoefficients()};

</script>

END_SCRIPT

HEADER_TEXT( MODES(TeX=>'', HTML=><<END_SCRIPT ) );

<script language="javascript">
function getAppletValues() {
console.log("getAppletValues() entered");
// get a handle for the applet object
var applet = $appletName;
var Iam = applet.getValue("Iam");
var Iaang= applet.getValue("Iaang");
var Eim = applet.getValue("Eim");
var Eiang= applet.getValue("Eiang");
return(Iam + ',' +Iaang +','+Eim + ',' +Eiang);
}
</script>
END_SCRIPT


BEGIN_TEXT
Find the rotor speed of a 4-pole generator to generate 60Hz 3-phase power: $BR
a) Speed is \{ans_rule(10)\} \(RPM\) \{AnswerFormatHelp("numbers") \} $BR
b) A generator is supplying a 100 MW load. If we increase the load to 105MW, the system frequency (i.e., the rotor speed) will \{$popupA->menu()\} $BR
c)A generator is supplying a 100MW load with a power factor at 1.0. If the power factor drops to 0.9 lagging (power is still 100 MW), the excitation current (\( I_f\)) will \{$popupB->menu()\} $PAR
In the graph below, move point C (\(E_i\)) to (0.44,1.20). Move the red vector (\(Ia\)) to (1.09,0.51). You can move each phasor by clicking on its arrow head and dragging it around. The vector values indicated beside the vectors are represented in polar coordinates, as are the answers in the answer-checker. $BR
END_TEXT
Context()->normalStrings;

###################################
#insert applet into body -- this does not need to be changed
# except to adjust the insertion of the reinitialize_button or
# a hidden AnswerBox
###################################
TEXT($PAR, MODES(TeX=>'geogebraweb code',
HTML=>$applet->insertAll(
debug =>0,
reinitialize_button => 1,
includeAnswerBox=>1,
)));

TEXT( "run SetConfig", q!<script language="javascript">setConfig()</script> !) if $inputs_ref->{ "${appletName}_state"} =~ "restart_applet";

##############################
$showPartialCorrectAnswers = 1;
#ANS($Ei1->cmp());
#ANS($Ei2->cmp());
#ANS($Ei3->cmp());

ANS($answer1->cmp());
ANS($popupA->cmp());
ANS($popupB->cmp());

# NAMED_ANS( 'answerBox' => $answer->cmp(ordered=>1) );

NAMED_ANS( 'answerBox' =>$answer->
cmp(list_checker => sub {
my ($correct,$student,$ansHash,$value) = @_;
my $n = scalar(@$student); # number of student answers
my $score = 0; # number of correct student answers
my @errors = (); # stores error messages
my $i; # loop counters
#
# Loop though the student answers
##
for ($i = 0; $i < $n; $i++) {
my $err,$errt;
my $ith = Value::List->NameForNumber($i+1);
my $p = $student->[$i]; # i-th student answer
my $a = $p->value;
my $q = $correct->[$i]; # i-th student answer
my $b = $q->value;
if ($type[$i]==0){
$err=abs($a-$b)
}
if ($type[$i]==1){
$errt=abs($a-$b);
$err=min($errt,360-$errt);
}

if ($err<$tol[$type[$i]] ) {$score++} else {
push(@errors,"Your $ith point is not correct") unless $ansHash->{isPreview}
}
}
return ($score,@errors);
}));

##############################
# Solution

Context()->texStrings;
BEGIN_SOLUTION;

$PAR
$BBOLD SOLUTION $EBOLD
$PAR
\( E_i \angle 0^{ \circ } = V_a \angle 0^{ \circ } + I_a \angle \theta \times X_d \angle 90^{ \circ } \) $BR
\( = $Va_Mag \angle 0^{ \circ } + $Ia1_Mag \angle \theta \times $Xd \angle 90^{ \circ } \) $BR
\( = $Va_Mag \angle 0^{ \circ } + $I_Xd_prod \angle (90^{ \circ } + \theta) \) $PAR

a) \(\theta = $Ia1_Ang^{ \circ } \) $BR
\( E_i = $Va_Mag \angle 0^{ \circ } + $I_Xd_prod \angle $I_Xd_Ang ^{ \circ }\) $BR
\( E_i = $Ei1 = $Ei1_Mag \angle $Ei1_Ang_deg^{ \circ } \) per unit $PAR

b) \(\theta = $Ia2_Ang^{ \circ } \) $BR
\( E_i = $Va_Mag \angle 0^{ \circ } + $I_Xd_prod2 \angle $I_Xd_Ang2 ^{ \circ }\) $BR
\( E_i = $Ei2 = $Ei2_Mag \angle $Ei2_Ang_deg^{ \circ } \) per unit $PAR

c) \(\theta = $Ia3_Ang^{ \circ } \) $BR
\( E_i = $Va_Mag \angle 0^{ \circ } + $I_Xd_prod3 \angle $I_Xd_Ang3 ^{ \circ }\) $BR
\( E_i = $Ei3 = $Ei3_Mag \angle $Ei3_Ang_deg^{ \circ } \) per unit $PAR

END_SOLUTION
Context()->normalStrings;


sub GEOGEBRA_PARAMS {
my $result = {
showResetIcon=>"false" ,
enableRightClick=>"false" ,
enableLabelDrags=>"false",
showMenuBar=>"false" ,
showToolBar=>"false",
showAlgebraInput=>"false",
useBrowserForJS=>"true",
allowRescaling=>"false",
enableShiftDragZoom=>"false",
#geogebra work sheet link https://ggbm.at/stSsYPfV
ggbbase64=>"UEsDBBQACAgIAHJlUU0AAAAAAAAAAAAAAAAXAAAAZ2VvZ2VicmFfZGVmYXVsdHMyZC54bWztmltv2zYUx5/XT0HoaXuILcl27ARRirTAsAJpGixBsVdaOpa50KRGUrGcT1+KlHWpL3MUd04z5yHUkXkRf/+jw0NJF++zGUWPICThLHC8jusgYCGPCIsDJ1WTk5Hz/vLdRQw8hrHAaMLFDKvAGeQ1y3ba6vTPRvk5nCSBEwucTHUXDkooVnmbwOGTCSUMHIQySc4Zv8EzkAkO4S6cwgxf8xAr09lUqeS8253P553lsB0u4m4cq04mIwfpS2YycIqDc91do9G8Z6r7rut1//p8bbs/IUwqzEI9vp5OBBOcUiX1IVCYAVNILRIInIQTphxE8Rho4NzmFvp1IgB+c1DRSFNynct3v1zIKZ8jPv4bQn1OiRTKdsbo5nX0zx855QKJwPE9B8V5a12OdXnma1o0meLAcW1tihcg0COm5RmcKh6aDszZCaYSlnX1UJ95BPaXflGfkZnBiKQCLYQeSiYAkTmyU/SMKAsjcK2/kHMRSZQFzg2+cdCiKJ9saaoYOHfkqRhyUD+rFhRqV37RLbjuRjiCBFikKzUwe60wnw0N5rwY2+IIeQvk0yPkTZC951P+wups/WOc2KcLf2J/QqyvuY64d0S8T8RN/+3/P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CUMENT();
With help from my LMS specialist, I managed to get LTI enabled for WW this year. The link redirects nicely from Blackboard, and appears to create accounts properly for student-level users. However, on first login (first click on the link), a warning shows up, and spams a large amount of information to screen. Reading it, I don't see what the error actually is.

If the user then refreshes, the warning goes away, and the WW interface appears to work correctly. Assignments show up, and everything proceeds.

Warning reproduced here, with a few personal identifiers removed for privacy. Any thoughts on what might be happening?

WeBWorK Warnings

WeBWorK has encountered warnings while processing your request. If this occured when viewing a problem, it was likely caused by an error or ambiguity in that problem. Otherwise, it may indicate a problem with the WeBWorK system itself. If you are a student, report these warnings to your professor to have them corrected. If you are a professor, please consult the warning output below for more information.

Warning messages

  • ===== parameters received =======
  • tool_consumer_instance_description => Trent University
  • oauth_timestamp => 1567178935
  • oauth_consumer_key => ########
  • ext_launch_id => f76487d2-c705-4eb0-b21b-6c0666c0398c
  • roles => urn:lti:role:ims/lis/Instructor
  • oauth_version => 1.0
  • resource_link_title => Assignments for MATH 1051H - Login to 2019FA-MATH-1051H
  • oauth_callback => about:blank
  • tool_consumer_info_product_family_code => BlackboardLearn
  • ext_launch_presentation_css_url => ####,####
  • tool_consumer_instance_name => Trent University
  • oauth_nonce => 238585042538122
  • custom_student_id => ######
  • tool_consumer_info_version => 3700.7.0-rel.27+ce363ca
  • lis_person_name_full => Wesley Burr
  • oauth_signature => u0vTAJcY9dTgA3PCsGUmiAtHlHc=
  • lti_version => LTI-1p0
  • tool_consumer_instance_contact_email => admin@trentu.blackboard.com
  • lti_message_type => basic-lti-launch-request
  • lis_person_name_given => Wesley
  • ext_lms => bb-3700.7.0-rel.27+ce363ca
  • user_id => ####
  • oauth_signature_method => HMAC-SHA1
  • context_label => MATH-1051H-A-2019FA-PTBO
  • context_id => 28567d5abc8848a1a8e1dd03c717ce51
  • launch_presentation_return_url => https://trentu.blackboard.com/webapps/blackboard/execute/blti/launchReturn?course_id=_21698_1&content_id=_567651_1&toGC=false&launch_id=f76487d2-c705-4eb0-b21b-6c0666c0398c&link_id=_567651_1&launch_time=1567178935193
  • launch_presentation_locale => en-US-Trent
  • lis_person_contact_email_primary => ####@trentu.ca
  • resource_link_id => _567651_1
  • lis_person_sourcedid => #####
  • custom_tc_profile_url => https://trentu.blackboard.com/learn/api/v1/lti/profile?lti_version=LTI-1p0
  • launch_presentation_document_target => window
  • custom_caliper_federated_session_id => https://caliper-mapping.cloudbb.blackboard.com/v1/sites/0282b138-ab98-4eb0-8f63-9568b4756247/sessions/46E65784B38F830C810350FB74351F76
  • tool_consumer_instance_guid => f15628e23538475ca69eab852cb80ef5
  • lis_person_name_family => Burr
  • custom_caliper_profile_url => https://trentu.blackboard.com/learn/api/v1/telemetry/caliper/profile/_567651_1
  • context_title => MATH-1051H-A-2019FA-PTBO Non-Calculus Statistics I:
  • =========== summary ============ at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced.pm line 213.
  • User id is |wesleyburr|
  • User mail address is |####|
  • Student id is |#####|
  • preferred_source_of_username is |lis_person_contact_email_primary|
  • preferred_source_of_student_id is |undefined|
  • ================================
  • The following path was reconstructed by WeBWorK. It should match the path in the LMS: at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced.pm line 380.
  • https://math.trentu.ca/webwork2/2019FA-MATH1051H/ at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced.pm line 381.

Request information

Time Fri Aug 30 15:28:55 2019
Method POST
URI /webwork2/2019FA-MATH1051H/
Canvas to Webwork Authentication Failure Resolved!

The issue was a new security feature that Canvas has added to their LTI connection. In years past an instructor could renew their Webwork subscription and then copy their Canvas course content over and re-use the same Consumer Key and consumer secret without any consequence of repeated use of the same names.

Now, with this Canvas security feature, copies of course content that are re-used by the same instructor or shared with another instructor will have the word "Fake" overwritten on the key, and "Secret has not changed" on the consumer secret.

To refresh the LTI connection one can either change the name of both, or one could use the same name again, provided that a new name is put in place and saved, then followed up with the old names for Key and Consumer secret and saved again.

What makes it tough for the instructor is that we are not permitted to access to see all this, so you might need to prompt your local Canvas tech to make the change for re-used course content using an LTI.

Whew, Tim