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