-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 +591,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 +674,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,15 +715,15 @@ 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;
my $uris=shift;
+ my $keyorder=shift;
+ my $defkeytype=shift;
+ my $keyordercnt=100;
my $navmap = Apache::lonnavmaps::navmap->new();
my @allres=$navmap->retrieveResources(undef,undef,1,undef,1);
@@ -761,30 +740,40 @@ 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;
+ $$defkeytype{$name}=&Apache::lonnet::metadata($srcf,$key.'.type');
+#
+# 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 {
$$keyp{$id}=$key;
}
+#
+# Put in order
+#
+ unless ($$keyorder{$key}) {
+ $$keyorder{$key}=$keyordercnt;
+ $keyordercnt++;
+ }
+
}
}
$$mapp{$id}=
@@ -802,6 +791,289 @@ sub extractResourceInformation {
}
}
+
+##################################################
+##################################################
+
+sub isdateparm {
+ my $type=shift;
+ return (($type=~/^date/) && (!($type eq 'date_interval')));
+}
+
+sub parmmenu {
+ my ($r,$allparms,$pscat,$keyorder)=@_;
+ my $tempkey;
+ $r->print(<
+ function checkall(value, checkName) {
+ for (i=0; i
+ENDSCRIPT
+ $r->print();
+ $r->print("\n
');
} else {
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 +1448,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"';
@@ -1366,7 +1495,7 @@ ENDTABLEHEADFOUR
# When storing information, store as part 0
# When requesting information, request from full part
#-------------------------------------------------------------------
- foreach (split(/\,/,$keyp{$rid})) {
+ foreach (&keysplit($keyp{$rid})) {
my $tempkeyp = $_;
my $fullkeyp = $tempkeyp;
$tempkeyp =~ s/_\w+_/_0_/;
@@ -1416,12 +1545,11 @@ ENDMAPONE
$r->print('
\n");
}
$r->print("");
} # end each map
@@ -1453,7 +1581,7 @@ ENDMAPONE
# When storing information, store as part 0
# When requesting information, request from full part
#-------------------------------------------------------------------
- foreach (split(/\,/,$keyp{$rid})) {
+ foreach (&keysplit($keyp{$rid})) {
my $tempkeyp = $_;
my $fullkeyp = $tempkeyp;
$tempkeyp =~ s/_\w+_/_0_/;
@@ -1494,11 +1622,10 @@ ENDMAPONE
$r->print('