--- rat/lonratparms.pm 2002/05/30 13:54:15 1.11 +++ rat/lonratparms.pm 2003/09/29 14:31:00 1.16 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Set parameters inside of the RAT # -# $Id: lonratparms.pm,v 1.11 2002/05/30 13:54:15 www Exp $ +# $Id: lonratparms.pm,v 1.16 2003/09/29 14:31:00 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -44,10 +44,12 @@ package Apache::lonratparms; use strict; use Apache::Constants qw(:common); +use Apache::lonhtmlcommon(); +use Apache::lonlocal; sub handler { my $r = shift; - $r->content_type('text/html'); + &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; return OK if $r->header_only; @@ -73,6 +75,28 @@ sub handler { } } +# -------------------------------------- Additional parms for certain resources + + if ($uri=~/\.(sequence|page)\.meta$/) { + $content{'parameter_randompick'}=''; + $type{'parameter_randompick'}='int_pos'; + $display{'parameter_randompick'}='Randomly pick number of resources'; + + $content{'parameter_randompickseed'}=''; + $type{'parameter_randompickseed'}='int_pos'; + $display{'parameter_randompickseed'}= + 'Random seed for randomly picking number of resources (optional, only set if you know what you are doing)'; + } else { + $content{'parameter_mapalias'}=''; + $type{'parameter_mapalias'}='string'; + $display{'parameter_mapalias'}='Resource alias name for conditions'; + } + if ($uri=~/\.(problem|exam|quiz|assess|survey|form|library)\.meta$/) { + $content{'parameter_hiddenparts'}=''; + $type{'parameter_hiddenparts'}='string'; + $display{'parameter_hiddenparts'}= + 'A comma separted list of Part Ids to not display.'; + } # ---------------------------------------------------------- Current Parameters foreach (split(/\:/,$ENV{'form.parms'})) { @@ -82,6 +106,13 @@ sub handler { } # --------------------------------------------------- Print input screen header + my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); + my $bodytag=&Apache::loncommon::bodytag('Set Resource Parameters in Map'); + my %lt=&Apache::loncommon::texthash('pa' => 'Parameter', + 'de' => 'Default', + 'va' => 'Value', + 'se' => 'Set'); + $r->print(< @@ -94,14 +125,7 @@ sub handler { parmwin.close(); } - function pjump(type,dis,value,marker,ret,call) { - parmwin=window.open("/adm/rat/parameter.html?type="+escape(type) - +"&value="+escape(value)+"&marker="+escape(marker) - +"&return="+escape(ret) - +"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms", - "height=350,width=350,scrollbars=no,menubar=no"); - - } + $pjump_def function stpr() { eval("document.parameters."+document.parameters.pres_marker.value+ @@ -125,15 +149,16 @@ ENDHEADER } - -

Set Resource Parameters in Map

+$bodytag
- + ENDDOCUMENT + %display=&Apache::lonlocal::texthash(%display); + my $enter=&mt('Enter'); foreach (keys(%content)) { my $cur=$content{$_}; # Should if(defined($value{$_})) be if(exists($value{$_})) ? @@ -142,14 +167,14 @@ ENDDOCUMENT +$enter'); } $r->print( - '
ParameterDefaultValueSet?
$lt{'pa'}$lt{'de'}$lt{'va'}$lt{'se'}?
$display{$_}
$_
 $content{$_}   -Enter print(' checked'); } $r->print('>

'); + '
'); return OK; }