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

raeburn raeburn@source.lon-capa.org
Sun, 05 Sep 2010 20:57:42 -0000


raeburn		Sun Sep  5 20:57:42 2010 EDT

  Modified files:              
    /loncom/homework	inputtags.pm 
  Log:
  - Include directory path within user's portfolio
    in listing of currently submitted files (requested at MSU for cse101).
  
  
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.270 loncom/homework/inputtags.pm:1.271
--- loncom/homework/inputtags.pm:1.270	Sun Aug 29 19:39:16 2010
+++ loncom/homework/inputtags.pm	Sun Sep  5 20:57:42 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # input  definitons
 #
-# $Id: inputtags.pm,v 1.270 2010/08/29 19:39:16 raeburn Exp $
+# $Id: inputtags.pm,v 1.271 2010/09/05 20:57:42 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -535,13 +535,13 @@
     if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
         $header .= '<th>'.&mt('Delete?').'</th>';
     }
-    $header .=   '<th>'.&mt('Name').'</th>'.
+    $header .=   '<th>'.&mt('File').'</th>'.
                  '<th>'.&mt('Size (MB)').'</th>'.
                  '<th>'.&mt('Last Modified').'</th>'.
                  &Apache::loncommon::end_data_table_header_row();
     my (undef,$crsid,$udom,$uname)=&Apache::lonnet::whichuser();
     my ($cdom,$cnum) = ($crsid =~ /^($LONCAPA::match_domain)_($LONCAPA::match_courseid)$/);
-    my ($result,$header_shown,%okfiles,%rows,@bad_file_list);
+    my ($result,$header_shown,%okfiles,%rows,%legacy,@bad_file_list);
     if ($uploadedfile) {
         my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};
         my $link = &HTML::Entities::encode($url,'<>&"');
@@ -551,6 +551,7 @@
         if ($status eq 'ok') {
             push(@{$okfiles{$name}},$url);
             $rows{$url} = $hashref;
+            $legacy{$url} = 1;
             &Apache::lonxml::extlink($url);
             &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);
         } else {
@@ -593,9 +594,13 @@
                                  '<td valign="bottom"><input type="checkbox" name="HWFILE'.$jspart.'_'.$id.'_delete"'.
                                  ' value="'.$portfile.'" /></td>'."\n";
                         }
+                        my $showname = $rows{$url}{path}.$name;
+                        if ($legacy{$url}) {
+                            $showname = $name.' '.&mt('not in portfolio');
+                        }
                         $result .= 
                             '<td><a href="'.$link.'"><img src="'.$icon.
-                            '" border="0" />'.$name.'</a></td>'."\n".
+                            '" border="0" />'.$showname.'</a></td>'."\n".
                             '<td align="right" valign="bottom">'.$rows{$url}{size}.'</td>'."\n".
                             '<td align="right" valign="bottom">'.$rows{$url}{lastmodified}.'</td>'."\n".
                             &Apache::loncommon::end_data_table_row();