[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 04 Sep 2003 22:36:47 -0000


www		Thu Sep  4 18:36:47 2003 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Overview mode - saving my work.
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.122 loncom/interface/lonparmset.pm:1.123
--- loncom/interface/lonparmset.pm:1.122	Wed Sep  3 21:09:04 2003
+++ loncom/interface/lonparmset.pm	Thu Sep  4 18:36:47 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.122 2003/09/04 01:09:04 www Exp $
+# $Id: lonparmset.pm,v 1.123 2003/09/04 22:36:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1678,7 +1678,7 @@
 <title>LON-CAPA Course Environment</title>
 </head>
 $bodytag
-<form method="post" action="/adm/parmset" name="overview">
+<form method="post" action="/adm/parmset" name="overviewform">
 <input type="hidden" name="overview" value="1" />
 ENDOVER
 # Read and display
@@ -1686,20 +1686,22 @@
     my $oldsection='';
     my $oldrealm='';
     my $oldpart='';
+    my $pointer=0;
     foreach my $thiskey (sort keys %resourcedata) {
-	my ($course,$middle,$part,$name)=
-	    ($thiskey=~/^(\w+)\.(.*)\.*([\w\s]+)\.(\w+)$/);
-	unless ($name eq 'type') {
+	if ($resourcedata{$thiskey.'.type'}) {
+	    my ($course,$middle,$part,$name)=
+		($thiskey=~/^(\w+)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
 	    my $section='All Students';
 	    if ($middle=~/^\[(.*)\]\./) {
 		$section='Group/Section: '.$1;
 		$middle=~s/^\[(.*)\]\.//;
 	    }
-	    my $realm='All Resources';
+	    $middle=~s/\.$//;
+	    my $realm='<font color="red">All Resources</font>';
 	    if ($middle=~/^(.+)\_\_\_\(all\)$/) {
-		$realm='Folder/Map: '.$1;
+		$realm='<font color="green">Folder/Map: '.&Apache::lonnet::gettitle($1).'</font>';
 	    } elsif ($middle) {
-		$realm='Resource: '.$middle;
+		$realm='<font color="orange">Resource: '.&Apache::lonnet::gettitle($middle).'</font>';
 	    }
 	    if ($section ne $oldsection) {
 		$r->print("\n<hr /><h1>$section</h1>");
@@ -1712,11 +1714,27 @@
 		$oldpart='';
 	    }
 	    if ($part ne $oldpart) {
-		$r->print("\n<h3>Part: $part</h3>");
+		$r->print("\n<h3><font color='blue'>Part: $part</font></h3>");
 		$oldpart=$part;
 	    }
-
-	    $r->print('<br />'.$name.': '.$thiskey.' = '.$resourcedata{$thiskey});
+#
+# Ready to print
+#
+	    $r->print('<br /><b>'.$name.':</b>');
+	    if ($resourcedata{$thiskey.'.type'}=~/^date/) {
+		my $jskey='key_'.$pointer;
+		$pointer++;
+		$r->print(
+			  &Apache::lonhtmlcommon::date_setter('overviewform',
+							      $jskey,
+						      $resourcedata{$thiskey}).
+'<input type="hidden" name="datepointer_'.$thiskey.'" value="'.$jskey.'" />'
+			  );
+	    } else {
+		$r->print(
+			  '<input type="text" name="set_'.$thiskey.'" value="'.
+			  $resourcedata{$thiskey}.'">');
+	    }
 	}
     }
     $r->print('</form></body></html>');