[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 30 Jun 2006 04:56:59 -0000


albertel		Fri Jun 30 00:56:59 2006 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - making this look more consistent
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.198 loncom/homework/inputtags.pm:1.199
--- loncom/homework/inputtags.pm:1.198	Thu Jun 29 20:32:25 2006
+++ loncom/homework/inputtags.pm	Fri Jun 30 00:56:56 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.198 2006/06/30 00:32:25 albertel Exp $
+# $Id: inputtags.pm,v 1.199 2006/06/30 04:56:56 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -440,12 +440,12 @@
 	    '<input type="text" size="50" name="HWPORT'.$jspart.'_'.$id.'" value="" />'.
 	    '<br />';
 	if ($Apache::lonhomework::history{"resource.$part.$id.portfiles"}=~/[^\s]/){
-	    my (@filelist,@bad_file_list);
-	    foreach my $file (split(',',&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
+	    my (@file_list,@bad_file_list);
+	    foreach my $file (split(/\s*,\s*/,&unescape($Apache::lonhomework::history{"resource.$part.$id.portfiles"}))) {
 		my (undef,undef,$domain,$user)=&Apache::lonxml::whichuser();
 		my $url="/uploaded/$domain/$user/portfolio$file";
 		my $icon=&Apache::loncommon::icon($url);
-		push(@filelist,'<a href="'.$url.'"><img src="'.$icon.
+		push(@file_list,'<a href="'.$url.'"><img src="'.$icon.
 		     '" border="0" />'.$file.'</a>');
 		if (! &Apache::lonnet::stat_file($url)) {
 		    &Apache::lonnet::logthis("bad file is $url");
@@ -453,9 +453,15 @@
 			 '" border="0" />'.$file.'</a>');
 		}
 	    }
-	    $result.=&mt("Portfolio files previously selected: <strong>[_1]</strong>",join(', ',@filelist));
+	    my $files = '<span class="LC_filename">'.
+		join('</span>, <span class="LC_filename">',@file_list).
+		'</span>';
+	    $result.=&mt("Portfolio files previously selected: [_1]",$files);
 	    if (@bad_file_list) {
-		$result.='<br />'.&mt('<span class="LC_error">These file(s) don\'t exist:</span> <span class="LC_filename">[_1]</span>',join(', ',@bad_file_list));
+		my $bad_files = '<span class="LC_filename">'.
+		    join('</span>, <span class="LC_filename">',@bad_file_list).
+		    '</span>';
+		$result.='<br />'.&mt('<span class="LC_error">These file(s) don\'t exist:</span> [_1]',$bad_files);
 	    }
 	}
     }