-ENDHEAD3
-
- if (!$have_assesments) {
- $r->print(''.&mt('There are no assesment parameters in this course to set.').' ');
- } else {
- $r->print(<
-$sections
-
-$lt{'fu'}
-
-$lt{'oi'}
-
-$lt{'ad'}
-$chooseopt
-
+
ENDHEAD
- }
}
+
sub print_row {
- my ($r,$which,$part,$name,$rid,$default,$defaulttype,$display,$defbgone,
+ my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone,
$defbgtwo,$parmlev,$uname,$udom,$csec)=@_;
# get the values for the parameter in cascading order
# empty levels will remain empty
@@ -596,7 +538,7 @@ sub print_row {
}
my $parm=$$display{$which};
- if ($parmlev eq 'full' || $parmlev eq 'brief') {
+ if ($parmlev eq 'full') {
$r->print('
');
- if ($parmlev eq 'full' || $parmlev eq 'brief') {
+ if ($parmlev eq 'full') {
my $sessionval=&Apache::lonnet::EXT('resource.'.$$part{$which}.
- '.'.$$name{$which},$symbp{$rid});
-
-# this doesn't seem to work, and I don't think is correct
-# my $sessionvaltype=&Apache::lonnet::EXT('resource.'.$$part{$which}.
-# '.'.$$name{$which}.'.type',$symbp{$rid});
-# this seems to work
+ '.'.$$name{$which},$$symbp{$rid});
my $sessionvaltype=$typeoutpar[$result];
if (!defined($sessionvaltype)) { $sessionvaltype=$$defaulttype{$which}; }
$r->print('
'.
@@ -696,6 +621,7 @@ sub print_td {
$r->print('
'."\n");
}
+
=pod
=item B: Given the course data hash, extractResourceInformation extracts lots of information about the course's resources into a variety of hashes.
@@ -736,10 +662,7 @@ sub extractResourceInformation {
my $keyp = shift;
my $allparms = shift;
my $allparts = shift;
- my $allkeys = shift;
my $allmaps = shift;
- my $fcat = shift;
- my $defp = shift;
my $mapp = shift;
my $symbp = shift;
my $maptitles=shift;
@@ -761,25 +684,26 @@ sub extractResourceInformation {
foreach (split(/\,/,&Apache::lonnet::metadata($srcf,'allpossiblekeys'))) {
if ($_=~/^parameter\_(.*)/) {
my $key=$_;
- my $allkey=$1;
- $allkey=~s/\_/\./g;
- if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq
- 'parm') {
- next; #hide hidden things
+# Hidden parameters
+ if (&Apache::lonnet::metadata($srcf,$key.'.hidden') eq 'parm') {
+ next;
}
my $display= &Apache::lonnet::metadata($srcf,$key.'.display');
my $name=&Apache::lonnet::metadata($srcf,$key.'.name');
my $part= &Apache::lonnet::metadata($srcf,$key.'.part');
+#
+# allparms is a hash of parameter names
+#
my $parmdis = $display;
- $parmdis =~ s|(\[Part.*)$||g;
- my $partkey = $part;
- $partkey =~ tr|_|.|;
- $$allparms{$name} = $parmdis;
- $$allparts{$part} = "[Part $part]";
- $$allkeys{$allkey}=$display;
- if ($allkey eq $fcat) {
- $$defp{$id}= &Apache::lonnet::metadata($srcf,$key);
- }
+ $parmdis =~ s/\[Part.*$//g;
+ $$allparms{$name}=$parmdis;
+#
+# allparts is a hash of all parts
+#
+ $$allparts{$part} = "Part: $part";
+#
+# Remember all keys going with this resource
+#
if ($$keyp{$id}) {
$$keyp{$id}.=','.$key;
} else {
@@ -802,6 +726,148 @@ sub extractResourceInformation {
}
}
+
+##################################################
+##################################################
+
+sub parmmenu {
+ my ($r,$allparms,$pscat)=@_;
+ my $tempkey;
+ $r->print(<
+ function checkall(value, checkName) {
+ for (i=0; i
+ENDSCRIPT
+ $r->print();
+ $r->print("\n
');
- if (($prevvisit) || ($pschp) || ($pssymb)) {
- $submitmessage = &mt("Update Course Assessment Parameter Display");
- } else {
- $submitmessage = &mt("Set/Modify Course Assessment Parameters");
- }
- $r->print('');
-
-# my @temp_psprt;
-# foreach my $t (@psprt) {
-# push(@temp_psprt, grep {eval (/^$t\./ || ($_ == $t))} (keys %allparts));
-# }
-
-# @psprt = @temp_psprt;
+ $r->print(' ');
my @temp_pscat;
map {
@@ -1167,13 +1084,13 @@ sub assessparms {
@pscat = @temp_pscat;
- if (($prevvisit) || ($pschp) || ($pssymb)) {
+ if (($env{'form.prevvisit'}) || ($pschp) || ($pssymb)) {
# ----------------------------------------------------------------- Start Table
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat;
my $csuname=$env{'user.name'};
my $csudom=$env{'user.domain'};
- if ($parmlev eq 'full' || $parmlev eq 'brief') {
+ if ($parmlev eq 'full') {
my $coursespan=$csec?8:5;
$r->print('
');
$r->print('
');
@@ -1310,7 +1227,7 @@ ENDTABLEHEADFOUR
undef $firstrow;
}
- &print_row($r,$_,\%part,\%name,$rid,\%default,
+ &print_row($r,$_,\%part,\%name,\%symbp,$rid,\%default,
\%type,\%display,$defbgone,$defbgtwo,
$parmlev,$uname,$udom,$csec);
}
@@ -1319,7 +1236,7 @@ ENDTABLEHEADFOUR
} # end foreach ids
# -------------------------------------------------- End entry for one resource
$r->print('
');
- } # end of brief/full
+ } # end of full
#--------------------------------------------------- Entry for parm level map
if ($parmlev eq 'map') {
my $defbgone = '"E0E099"';
@@ -1418,7 +1335,7 @@ ENDMAPONE
foreach (sort keys %name) {
$r->print('