Annotation of loncom/interface/lonparmset.pm, revision 1.22
1.1 www 1: # The LearningOnline Network with CAPA
2: # Handler to set parameters for assessments
3: #
4: # (Handler to resolve ambiguous file locations
5: #
6: # (TeX Content Handler
7: #
8: # 05/29/00,05/30,10/11 Gerd Kortemeyer)
9: #
10: # 10/11,10/12,10/16 Gerd Kortemeyer)
11: #
1.20 www 12: # 11/20,11/21,11/22,11/23,11/24,11/25,11/27,11/28,
1.21 www 13: # 12/08,12/12,
1.22 ! www 14: # 16/01/01,02/08 Gerd Kortemeyer
1.1 www 15:
16: package Apache::lonparmset;
17:
18: use strict;
19: use Apache::lonnet;
20: use Apache::Constants qw(:common :http REDIRECT);
21: use GDBM_File;
1.4 www 22:
1.1 www 23:
1.2 www 24: my %courseopt;
25: my %useropt;
26: my %bighash;
27: my %parmhash;
28:
1.8 www 29: my @outpar;
30:
1.3 www 31: my @ids;
32: my %symbp;
1.10 www 33: my %mapp;
1.3 www 34: my %typep;
1.16 www 35: my %keyp;
1.17 www 36: my %defp;
1.16 www 37:
38: my %allkeys;
1.2 www 39:
40: my $uname;
41: my $udom;
42: my $uhome;
43:
44: my $csec;
45:
1.3 www 46: my $fcat;
47:
1.2 www 48: # -------------------------------------------- Figure out a cascading parameter
49:
50: sub parmval {
1.11 www 51: my ($what,$id,$def)=@_;
1.8 www 52: my $result='';
1.11 www 53: @outpar=();
1.2 www 54: # ----------------------------------------------------- Cascading lookup scheme
1.10 www 55:
1.3 www 56: my $symbparm=$symbp{$id}.'.'.$what;
1.10 www 57: my $mapparm=$mapp{$id}.'___(all).'.$what;
58:
1.2 www 59: my $seclevel=
1.10 www 60: $ENV{'request.course.id'}.'.['.
1.14 www 61: $csec.'].'.$what;
1.10 www 62: my $seclevelr=
63: $ENV{'request.course.id'}.'.['.
1.14 www 64: $csec.'].'.$symbparm;
1.10 www 65: my $seclevelm=
66: $ENV{'request.course.id'}.'.['.
1.14 www 67: $csec.'].'.$mapparm;
1.10 www 68:
1.2 www 69: my $courselevel=
70: $ENV{'request.course.id'}.'.'.$what;
1.10 www 71: my $courselevelr=
72: $ENV{'request.course.id'}.'.'.$symbparm;
73: my $courselevelm=
74: $ENV{'request.course.id'}.'.'.$mapparm;
1.2 www 75:
1.11 www 76: # -------------------------------------------------------- first, check default
77:
78: if ($def) { $outpar[11]=$def;
79: $result=11; }
80:
81: # ----------------------------------------------------- second, check map parms
82:
83: my $thisparm=$parmhash{$symbparm};
84: if ($thisparm) { $outpar[10]=$thisparm;
85: $result=10; }
86:
87: # --------------------------------------------------------- third, check course
88:
89: if ($courseopt{$courselevel}) { $outpar[9]=$courseopt{$courselevel};
90: $result=9; }
91:
92: if ($courseopt{$courselevelm}) { $outpar[8]=$courseopt{$courselevelm};
93: $result=8; }
94:
95: if ($courseopt{$courselevelr}) { $outpar[7]=$courseopt{$courselevelr};
96: $result=7; }
97:
98: if ($csec) {
99:
100: if ($courseopt{$seclevel}) { $outpar[6]=$courseopt{$seclevel};
101: $result=6; }
102:
103: if ($courseopt{$seclevelm}) { $outpar[5]=$courseopt{$seclevelm};
104: $result=5; }
105:
106: if ($courseopt{$seclevelr}) { $outpar[4]=$courseopt{$seclevelr};
107: $result=4; }
108:
109: }
110:
111: # ---------------------------------------------------------- fourth, check user
1.8 www 112:
113: if ($uname) {
1.11 www 114:
1.10 www 115: if ($useropt{$courselevel}) { $outpar[3]=$useropt{$courselevel};
116: $result=3; }
117:
1.11 www 118: if ($useropt{$courselevelm}) { $outpar[2]=$useropt{$courselevelm};
119: $result=2; }
1.2 www 120:
1.11 www 121: if ($useropt{$courselevelr}) { $outpar[1]=$useropt{$courselevelr};
122: $result=1; }
1.10 www 123:
1.11 www 124: }
1.2 www 125:
1.8 www 126: return $result;
1.2 www 127: }
128:
1.9 www 129: # ------------------------------------------------------------ Output for value
130:
131: sub valout {
132: my ($value,$type)=@_;
133: return
134: ($value?(($type=~/^date/)?localtime($value):$value):' ');
135: }
136:
1.5 www 137: # -------------------------------------------------------- Produces link anchor
138:
139: sub plink {
140: my ($type,$dis,$value,$marker,$return,$call)=@_;
141: return '<a href="javascript:pjump('."'".$type."','".$dis."','".$value."','"
1.8 www 142: .$marker."','".$return."','".$call."'".');">'.
1.22 ! www 143: &valout($value,$type).'</a><a name="'.$marker.'"></a>';
1.5 www 144: }
145:
1.1 www 146: # ================================================================ Main Handler
147:
148: sub handler {
149: my $r=shift;
150:
151: if ($r->header_only) {
152: $r->content_type('text/html');
153: $r->send_http_header;
154: return OK;
155: }
156:
157: # ----------------------------------------------------- Needs to be in a course
158:
159: if (($ENV{'request.course.fn'}) &&
160: (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'}))) {
1.2 www 161: # -------------------------------------------------------- Variable declaration
162:
163: %courseopt=();
164: %useropt=();
165: %bighash=();
166:
1.3 www 167: @ids=();
168: %symbp=();
169: %typep=();
1.2 www 170:
1.12 www 171: my $message='';
172:
173: $csec=$ENV{'form.csec'};
1.2 www 174: $udom=$ENV{'form.udom'};
1.17 www 175: unless ($udom) { $udom=$r->dir_config('lonDefDomain'); }
176:
1.12 www 177: my $id=$ENV{'form.id'};
178: if (($id) && ($udom)) {
179: $uname=(&Apache::lonnet::idget($udom,$id))[1];
180: if ($uname) {
181: $id='';
182: } else {
183: $message=
1.17 www 184: "<font color=red>Unknown ID '$id' at domain '$udom'</font>";
1.12 www 185: }
186: } else {
187: $uname=$ENV{'form.uname'};
188: }
1.2 www 189: unless ($udom) { $uname=''; }
190: $uhome='';
191: if ($uname) {
192: $uhome=&Apache::lonnet::homeserver($uname,$udom);
1.12 www 193:
194: if ($uhome eq 'no_host') {
1.3 www 195: $message=
1.17 www 196: "<font color=red>Unknown user '$uname' at domain '$udom'</font>";
1.3 www 197: $uname='';
1.12 www 198: } else {
199: $csec=&Apache::lonnet::usection(
200: $udom,$uname,$ENV{'request.course.id'});
201: if ($csec eq '-1') {
1.17 www 202: $message="<font color=red>".
203: "User '$uname' at domain '$udom' not in this course</font>";
1.12 www 204: $uname='';
205: $csec=$ENV{'form.csec'};
206: } else {
207: my %name=&Apache::lonnet::userenvironment($udom,$uname,
208: ('firstname','middlename','lastname','generation','id'));
209: $message="\n<p>\nFull Name: ".
210: $name{'firstname'}.' '.$name{'middlename'}
211: .$name{'lastname'}.' '.$name{'generation'}.
212: "<br>\nID: ".$name{'id'}.'<p>';
213: }
214: }
1.3 www 215: }
1.2 www 216:
1.3 www 217: unless ($csec) { $csec=''; }
1.12 www 218:
1.3 www 219: $fcat=$ENV{'form.fcat'};
220: unless ($fcat) { $fcat=''; }
1.2 www 221:
222: # ------------------------------------------------------------------- Tie hashs
223: if ((tie(%bighash,'GDBM_File',$ENV{'request.course.fn'}.'.db',
224: &GDBM_READER,0640)) &&
225: (tie(%parmhash,'GDBM_File',
226: $ENV{'request.course.fn'}.'_parms.db',&GDBM_READER,0640))) {
227:
1.14 www 228: # --------------------------------------------------------- Get all assessments
1.16 www 229: %allkeys=();
1.17 www 230: %defp=();
1.14 www 231: map {
232: if ($_=~/^src\_(\d+)\.(\d+)$/) {
233: my $mapid=$1;
234: my $resid=$2;
235: my $id=$mapid.'.'.$resid;
1.16 www 236: my $srcf=$bighash{$_};
237: if ($srcf=~/\.(problem|exam|quiz|assess|survey|form)$/) {
1.14 www 238: $ids[$#ids+1]=$id;
239: $typep{$id}=$1;
1.16 www 240: $keyp{$id}='';
241: map {
242: if ($_=~/^parameter\_(.*)/) {
243: my $key=$_;
244: my $allkey=$1;
1.17 www 245: $allkey=~s/\_/\./;
1.16 www 246: my $display=
247: &Apache::lonnet::metadata($srcf,$key.'.display');
248: unless ($display) {
249: $display=
250: &Apache::lonnet::metadata($srcf,$key.'.name');
251: }
252: $allkeys{$allkey}=$display;
1.17 www 253: if ($allkey eq $fcat) {
254: $defp{$id}=
1.20 www 255: &Apache::lonnet::metadata($srcf,$key);
1.17 www 256: }
1.16 www 257: if ($keyp{$id}) {
258: $keyp{$id}.=','.$key;
259: } else {
260: $keyp{$id}=$key;
261: }
262: }
263: } split(/\,/,
264: &Apache::lonnet::metadata($srcf,'keys'));
1.14 www 265: $mapp{$id}=
266: &Apache::lonnet::declutter($bighash{'map_id_'.$mapid});
267: $symbp{$id}=$mapp{$id}.
268: '___'.$resid.'___'.
1.16 www 269: &Apache::lonnet::declutter($srcf);
1.14 www 270: }
271: }
272: } keys %bighash;
273: # ---------------------------------------------------------- Anything to store?
274: if ($ENV{'form.pres_marker'}) {
275: my ($sresid,$spnam,$snum)=split(/\&/,$ENV{'form.pres_marker'});
1.15 www 276: $spnam=~s/\_/\./;
277: # ---------------------------------------------------------- Construct prefixes
1.14 www 278:
279: my $symbparm=$symbp{$sresid}.'.'.$spnam;
280: my $mapparm=$mapp{$sresid}.'___(all).'.$spnam;
281:
282: my $seclevel=
283: $ENV{'request.course.id'}.'.['.
284: $csec.'].'.$spnam;
285: my $seclevelr=
286: $ENV{'request.course.id'}.'.['.
287: $csec.'].'.$symbparm;
288: my $seclevelm=
289: $ENV{'request.course.id'}.'.['.
290: $csec.'].'.$mapparm;
291:
292: my $courselevel=
293: $ENV{'request.course.id'}.'.'.$spnam;
294: my $courselevelr=
295: $ENV{'request.course.id'}.'.'.$symbparm;
296: my $courselevelm=
297: $ENV{'request.course.id'}.'.'.$mapparm;
298:
299: my $storeunder='';
300: if (($snum==9) || ($snum==3)) { $storeunder=$courselevel; }
301: if (($snum==8) || ($snum==2)) { $storeunder=$courselevelm; }
302: if (($snum==7) || ($snum==1)) { $storeunder=$courselevelr; }
303: if ($snum==6) { $storeunder=$seclevel; }
304: if ($snum==5) { $storeunder=$seclevelm; }
305: if ($snum==4) { $storeunder=$seclevelr; }
1.15 www 306: $storeunder=&Apache::lonnet::escape($storeunder);
307:
308: my $storecontent=
309: $storeunder.'='.&Apache::lonnet::escape($ENV{'form.pres_value'}).'&'.
310: $storeunder.'.type='.&Apache::lonnet::escape($ENV{'form.pres_type'});
1.14 www 311:
1.15 www 312: my $reply='';
1.14 www 313: if ($snum>3) {
314: # ---------------------------------------------------------------- Store Course
1.15 www 315: $reply=&Apache::lonnet::critical('put:'.
316: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.':'.
317: $ENV{'course.'.$ENV{'request.course.id'}.'.num'}.':resourcedata:'.
318: $storecontent,
319: $ENV{'course.'.$ENV{'request.course.id'}.'.home'});
1.14 www 320: } else {
321: # ------------------------------------------------------------------ Store User
1.15 www 322: $reply=
323: &Apache::lonnet::critical('put:'.$udom.':'.$uname.':resourcedata:'.
324: $storecontent,$uhome);
325: }
326:
327: if ($reply=~/^error\:(.*)/) {
1.17 www 328: $message.="<font color=red>Write Error: $1</font>";
1.15 www 329: }
330: # ---------------------------------------------------------------- Done storing
331: }
1.2 www 332: # -------------------------------------------------------------- Get coursedata
333: my $reply=&Apache::lonnet::reply('dump:'.
334: $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}.':'.
335: $ENV{'course.'.$ENV{'request.course.id'}.'.num'}.':resourcedata',
336: $ENV{'course.'.$ENV{'request.course.id'}.'.home'});
337: if ($reply!~/^error\:/) {
338: map {
339: my ($name,$value)=split(/\=/,$_);
1.15 www 340: $courseopt{&Apache::lonnet::unescape($name)}=
341: &Apache::lonnet::unescape($value);
1.2 www 342: } split(/\&/,$reply);
343: }
344: # --------------------------------------------------- Get userdata (if present)
345: if ($uname) {
346: my $reply=
347: &Apache::lonnet::reply('dump:'.$udom.':'.$uname.':resourcedata',$uhome);
348: if ($reply!~/^error\:/) {
349: map {
350: my ($name,$value)=split(/\=/,$_);
1.15 www 351: $useropt{&Apache::lonnet::unescape($name)}=
352: &Apache::lonnet::unescape($value);
1.2 www 353: } split(/\&/,$reply);
354: }
355: }
1.14 www 356:
1.2 www 357: # ------------------------------------------------------------------- Sort this
1.17 www 358:
359: @ids=sort {
360: if ($fcat eq '') {
361: $a<=>$b;
362: } else {
363: $outpar[&parmval($fcat,$a,$defp{$a})]<=>
364: $outpar[&parmval($fcat,$b,$defp{$b})];
365: }
366: } @ids;
1.2 www 367: # ------------------------------------------------------------------ Start page
1.1 www 368: $r->content_type('text/html');
369: $r->send_http_header;
1.5 www 370: $r->print(<<ENDHEAD);
371: <html>
372: <head>
373: <title>LON-CAPA Assessment Parameters</title>
374: <script>
1.13 www 375:
1.5 www 376: function pclose() {
377: parmwin=window.open("/adm/rat/empty.html","LONCAPAparms",
378: "height=350,width=350,scrollbars=no,menubar=no");
379: parmwin.close();
380: }
381:
382: function pjump(type,dis,value,marker,ret,call) {
1.13 www 383: document.parmform.pres_marker.value='';
1.6 www 384: parmwin=window.open("/adm/rat/parameter.html?type="+escape(type)
385: +"&value="+escape(value)+"&marker="+escape(marker)
386: +"&return="+escape(ret)
387: +"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms",
1.5 www 388: "height=350,width=350,scrollbars=no,menubar=no");
389:
390: }
1.13 www 391:
392: function psub() {
393: pclose();
1.18 www 394: if (document.parmform.pres_marker.value!='') {
1.22 ! www 395: document.parmform.action+='#'+document.parmform.pres_marker.value;
1.13 www 396: document.parmform.submit();
397: } else {
398: document.parmform.pres_value.value='';
399: document.parmform.pres_marker.value='';
400: }
401: }
402:
1.5 www 403: </script>
404: </head>
405: <body bgcolor="#FFFFFF" onUnload="pclose()">
406: <h1>Set Assessment Parameters</h1>
1.8 www 407: <form method="post" action="/adm/parmset" name="parmform">
408: <h2>Course: $ENV{'course.'.$ENV{'request.course.id'}.'.description'}</h2>
409: <b>
410: Section/Group:
1.12 www 411: <input type="text" value="$csec" size="6" name="csec">
1.8 www 412: <br>
413: For User
1.12 www 414: <input type="text" value="$uname" size="12" name="uname">
415: or ID
416: <input type="text" value="$id" size="12" name="id">
1.8 www 417: at Domain
1.12 www 418: <input type="text" value="$udom" size="6" name="udom">
1.8 www 419: </b>
1.12 www 420: <input type="submit" value="Display">
1.13 www 421: <input type="hidden" value='' name="pres_value">
422: <input type="hidden" value='' name="pres_type">
423: <input type="hidden" value='' name="pres_marker">
1.5 www 424: ENDHEAD
1.17 www 425:
426: $r->print('<h2>'.$message.'</h2><p>Sort list by ');
1.8 www 427: $r->print('<select name="fcat" onChange="this.form.submit();">');
1.16 www 428: $r->print('<option value="">Enclosing Map</option>');
429: map {
430: $r->print('<option value="'.$_.'"');
431: if ($fcat eq $_) { $r->print(' selected'); }
432: $r->print('>'.$allkeys{$_}.'</option>');
433: } keys %allkeys;
1.8 www 434: $r->print('</select>');
1.10 www 435: # ----------------------------------------------------------------- Start Table
436: my $coursespan=$csec?8:5;
1.9 www 437: $r->print(<<ENDTABLEHEAD);
438: <p><table border=2>
1.11 www 439: <tr><td colspan=5></td>
1.10 www 440: <th colspan=$coursespan>Any User</th>
1.9 www 441: ENDTABLEHEAD
1.10 www 442: if ($uname) {
443: $r->print("<th colspan=3 rowspan=2>User $uname at Domain $udom</th>");
444: }
445: $r->print(<<ENDTABLETWO);
1.11 www 446: <th rowspan=3>Parameter in Effect</th></tr><tr><td colspan=5></td>
1.10 www 447: <th colspan=2>Resource Level</th>
448: <th colspan=3>in Course</th>
449: ENDTABLETWO
1.9 www 450: if ($csec) {
1.10 www 451: $r->print("<th colspan=3>in Section/Group $csec</th>");
1.9 www 452: }
1.10 www 453: $r->print(<<ENDTABLEHEADFOUR);
1.11 www 454: </tr><tr><th>Assessment URL and Title</th><th>Type</th>
1.10 www 455: <th>Enclosing Map</th><th>Part No.</th><th>Parameter Name</th>
1.11 www 456: <th>default</th><th>from Enclosing Map</th>
1.10 www 457: <th>general</th><th>for Enclosing Map</th><th>for Resource</th>
458: ENDTABLEHEADFOUR
459: if ($csec) {
460: $r->print('<th>general</th><th>for Enclosing Map</th><th>for Resource</th>');
461: }
462: if ($uname) {
463: $r->print('<th>general</th><th>for Enclosing Map</th><th>for Resource</th>');
464: }
465: $r->print('</tr><tr>');
1.19 www 466: my $defbgone='';
467: my $defbgtwo='';
1.3 www 468: map {
1.4 www 469: # ------------------------------------------------------ Entry for one resource
1.19 www 470: if ($defbgone eq '"E0E099"') {
471: $defbgone='"E0E0DD"';
472: } else {
473: $defbgone='"E0E099"';
474: }
475: if ($defbgtwo eq '"FFFF99"') {
476: $defbgtwo='"FFFFDD"';
477: } else {
478: $defbgtwo='"FFFF99"';
479: }
1.8 www 480: @outpar=();
1.5 www 481: my $rid=$_;
482: my $thistitle='';
1.16 www 483: my %name= ();
484: my %part= ();
485: my %display=();
486: my %type= ();
487: my %default=();
488: my $uri=&Apache::lonnet::declutter($bighash{'src_'.$rid});
489:
1.4 www 490: map {
1.16 www 491: $part{$_}=&Apache::lonnet::metadata($uri,$_.'.part');
492: $name{$_}=&Apache::lonnet::metadata($uri,$_.'.name');
493: $display{$_}=&Apache::lonnet::metadata($uri,$_.'.display');
494: unless ($display{$_}) { $display{$_}=''; }
495: $display{$_}.=' ('.$name{$_}.')';
1.20 www 496: $default{$_}=&Apache::lonnet::metadata($uri,$_);
1.16 www 497: $type{$_}=&Apache::lonnet::metadata($uri,$_.'.type');
498: $thistitle=&Apache::lonnet::metadata($uri,$_.'.title');
499: } split(/\,/,$keyp{$rid});
500:
1.11 www 501: my $totalparms=scalar keys %name;
1.21 www 502: my $isdef=1;
503: unless ($totalparms) { $totalparms=1; $isdef=0; }
1.19 www 504: $r->print('<td bgcolor='.$defbgone.
505: ' rowspan='.$totalparms.'><tt><font size=-1>'.
1.16 www 506: join(' / ',split(/\//,$uri)).
507: '</font></tt><p><b>'.
1.5 www 508: $bighash{'title_'.$rid});
509: if ($thistitle) {
510: $r->print(' ('.$thistitle.')');
511: }
1.11 www 512: $r->print('</b></td>');
1.19 www 513: $r->print('<td bgcolor='.$defbgtwo.
514: ' rowspan='.$totalparms.'>'.$typep{$rid}.'</td>');
515: $r->print('<td bgcolor='.$defbgone.
516: ' rowspan='.$totalparms.'><tt><font size=-1>'.
1.10 www 517: join(' / ',split(/\//,$mapp{$rid})).'</font></tt></td>');
1.21 www 518: if ($isdef) {
1.11 www 519: map {
520: my $result=&parmval($part{$_}.'.'.$name{$_},$rid,$default{$_});
521:
1.19 www 522: $r->print("<td bgcolor=".$defbgtwo.
523: ">$part{$_}</td><td bgcolor=".$defbgone.
524: ">$display{$_}</td>");
1.16 www 525: my $thismarker=$_;
526: $thismarker=~s/^parameter\_//;
527: my $mprefix=$rid.'&'.$thismarker.'&';
1.13 www 528:
1.19 www 529: $r->print('<td bgcolor='.
530: (($result==11)?'"#AAFFAA"':'#FFDDDD').'>'.
1.12 www 531: &valout($outpar[11],$type{$_}).'</td>');
1.19 www 532: $r->print('<td bgcolor='.
533: (($result==10)?'"#AAFFAA"':'#FFDDDD').'>'.
1.12 www 534: &valout($outpar[10],$type{$_}).'</td>');
1.13 www 535:
1.19 www 536: $r->print('<td bgcolor='.
537: (($result==9)?'"#AAFFAA"':$defbgone).'>'.
1.13 www 538: &plink($type{$_},$display{$_},$outpar[9],$mprefix.'9',
539: 'parmform.pres','psub').'</td>');
1.19 www 540: $r->print('<td bgcolor='.
541: (($result==8)?'"#AAFFAA"':$defbgone).'>'.
1.13 www 542: &plink($type{$_},$display{$_},$outpar[8],$mprefix.'8',
543: 'parmform.pres','psub').'</td>');
1.19 www 544: $r->print('<td bgcolor='.
545: (($result==7)?'"#AAFFAA"':$defbgone).'>'.
1.13 www 546: &plink($type{$_},$display{$_},$outpar[7],$mprefix.'7',
547: 'parmform.pres','psub').'</td>');
548:
1.9 www 549: if ($csec) {
1.19 www 550: $r->print('<td bgcolor='.
551: (($result==6)?'"#AAFFAA"':$defbgtwo).'>'.
1.13 www 552: &plink($type{$_},$display{$_},$outpar[6],$mprefix.'6',
553: 'parmform.pres','psub').'</td>');
1.19 www 554: $r->print('<td bgcolor='.
555: (($result==5)?'"#AAFFAA"':$defbgtwo).'>'.
1.13 www 556: &plink($type{$_},$display{$_},$outpar[5],$mprefix.'5',
557: 'parmform.pres','psub').'</td>');
1.19 www 558: $r->print('<td bgcolor='.
559: (($result==4)?'"#AAFFAA"':$defbgtwo).'>'.
1.13 www 560: &plink($type{$_},$display{$_},$outpar[4],$mprefix.'4',
561: 'parmform.pres','psub').'</td>');
1.9 www 562: }
1.13 www 563:
1.9 www 564: if ($uname) {
1.19 www 565: $r->print('<td bgcolor='.
566: (($result==3)?'"#AAFFAA"':$defbgone).'>'.
1.13 www 567: &plink($type{$_},$display{$_},$outpar[3],$mprefix.'3',
568: 'parmform.pres','psub').'</td>');
1.19 www 569: $r->print('<td bgcolor='.
570: (($result==2)?'"#AAFFAA"':$defbgone).'>'.
1.13 www 571: &plink($type{$_},$display{$_},$outpar[2],$mprefix.'2',
572: 'parmform.pres','psub').'</td>');
1.19 www 573: $r->print('<td bgcolor='.
574: (($result==1)?'"#AAFFAA"':$defbgone).'>'.
1.13 www 575: &plink($type{$_},$display{$_},$outpar[1],$mprefix.'1',
576: 'parmform.pres','psub').'</td>');
1.9 www 577: }
1.13 www 578:
1.19 www 579: $r->print(
580: '<td bgcolor=#CCCCFF>'.&valout($outpar[$result],$type{$_}).'</td>');
1.5 www 581: $r->print("</tr>\n<tr>");
1.11 www 582: } sort keys %name;
1.21 www 583: } else {
584: $r->print("</tr>\n<tr>");
585: }
1.4 www 586: # -------------------------------------------------- End entry for one resource
1.3 www 587: } @ids;
1.8 www 588: $r->print('</table></form></body></html>');
1.1 www 589: untie(%bighash);
1.2 www 590: untie(%parmhash);
1.1 www 591: }
592: } else {
593: # ----------------------------- Not in a course, or not allowed to modify parms
594: $ENV{'user.error.msg'}=
1.7 www 595: "/adm/parmset:opa:0:0:Cannot modify assessment parameters";
1.1 www 596: return HTTP_NOT_ACCEPTABLE;
597: }
598: return OK;
599: }
600:
601: 1;
602: __END__
603:
604:
605:
606:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>