--- loncom/interface/lonparmset.pm 2000/11/22 12:16:03 1.4
+++ loncom/interface/lonparmset.pm 2000/11/23 20:20:39 1.5
@@ -9,7 +9,7 @@
#
# 10/11,10/12,10/16 Gerd Kortemeyer)
#
-# 11/20,11/21,11/22 Gerd Kortemeyer
+# 11/20,11/21,11/22,11/23 Gerd Kortemeyer
package Apache::lonparmset;
@@ -97,6 +97,15 @@ sub bycat {
}
}
+# -------------------------------------------------------- Produces link anchor
+
+sub plink {
+ my ($type,$dis,$value,$marker,$return,$call)=@_;
+ return ''.
+ (($type=~/^date/)?localtime($value):$value).'';
+}
+
# ================================================================ Main Handler
sub handler {
@@ -190,8 +199,29 @@ sub handler {
# ------------------------------------------------------------------ Start page
$r->content_type('text/html');
$r->send_http_header;
- $r->print(
- '
Set Assessment Parameters
');
+ $r->print(<
+
+LON-CAPA Assessment Parameters
+
+
+
+Set Assessment Parameters
+ENDHEAD
$r->print("Course: $ENV{'course.'.
$ENV{'request.course.id'}.'.description'}
");
if ($csec) {
@@ -203,22 +233,46 @@ sub handler {
if ($uhome eq 'no_host') {
$r->print($message);
}
- $r->print('');
+ $r->print("\n\n");
map {
- $r->print('
');
# ------------------------------------------------------ Entry for one resource
+ my $rid=$_;
+ my $thistitle='';
+ my @part=(0,1,1);
+ my @name=('deadline','sig','tol');
+ my @display=('Deadline','Significant Figures','Tolerance');
+ my @type=('date','int','tolerance');
my %metadata=&Apache::lonmeta::unpackagemeta(
- &Apache::lonnet::getfile('/home/httpd/html/'.$bighash{'src_'.$_}.'.meta'),1);
+&Apache::lonnet::getfile('/home/httpd/html/'.$bighash{'src_'.$rid}.'.meta'),1);
map {
- if ($_=~/^parameter\_(\d+)\_(\w+)\_\_dis\_\_(.+)$/) {
- my $part=$1;
- my $name=$2;
- my $display=$3;
- my $type=$metadata{$_};
+ if ($_=~/^parameter\_(\d+)\_(\w+)$/) {
+ $part[$#part+1]=$1;
+ $name[$#name+1]=$2;
+ ($type[$#type+1],$display[$#display+1])=
+ split(/\_\_dis\_\_/,$metadata{$_});
+ unless ($display[$#display]) {
+ $display[$#display]=$name[$#name];
+ }
+ }
+ if ($_ eq 'title') {
+ $thistitle=$metadata{$_};
}
} keys %metadata;
+ my $totalparms=$#name+1;
+ $r->print(''.
+ $bighash{'src_'.$rid}.' '.
+ $bighash{'title_'.$rid});
+ if ($thistitle) {
+ $r->print(' ('.$thistitle.')');
+ }
+ $r->print(' | ');
+ my $i;
+ for ($i=0;$i<$totalparms;$i++) {
+ $r->print("$part[$i] | $display[$i] | ");
+ $r->print(''.&plink($type[$i],$display[$i],'987684455').' | ');
+ $r->print("
\n");
+ }
# -------------------------------------------------- End entry for one resource
- $r->print('
');
} @ids;
$r->print('
');
untie(%bighash);