Diff for /loncom/homework/inputtags.pm between versions 1.270 and 1.271.2.1

version 1.270, 2010/08/29 19:39:16 version 1.271.2.1, 2010/11/09 17:41:47
Line 535  sub current_file_submissions { Line 535  sub current_file_submissions {
     if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {      if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
         $header .= '<th>'.&mt('Delete?').'</th>';          $header .= '<th>'.&mt('Delete?').'</th>';
     }      }
     $header .=   '<th>'.&mt('Name').'</th>'.      $header .=   '<th>'.&mt('File').'</th>'.
                  '<th>'.&mt('Size (MB)').'</th>'.                   '<th>'.&mt('Size (MB)').'</th>'.
                  '<th>'.&mt('Last Modified').'</th>'.                   '<th>'.&mt('Last Modified').'</th>'.
                  &Apache::loncommon::end_data_table_header_row();                   &Apache::loncommon::end_data_table_header_row();
     my (undef,$crsid,$udom,$uname)=&Apache::lonnet::whichuser();      my (undef,$crsid,$udom,$uname)=&Apache::lonnet::whichuser();
     my ($cdom,$cnum) = ($crsid =~ /^($LONCAPA::match_domain)_($LONCAPA::match_courseid)$/);      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) {      if ($uploadedfile) {
         my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};          my $url=$Apache::lonhomework::history{"resource.$part.$id.uploadedurl"};
         my $link = &HTML::Entities::encode($url,'<>&"');          my $link = &HTML::Entities::encode($url,'<>&"');
Line 551  sub current_file_submissions { Line 551  sub current_file_submissions {
         if ($status eq 'ok') {          if ($status eq 'ok') {
             push(@{$okfiles{$name}},$url);              push(@{$okfiles{$name}},$url);
             $rows{$url} = $hashref;              $rows{$url} = $hashref;
               $legacy{$url} = 1;
             &Apache::lonxml::extlink($url);              &Apache::lonxml::extlink($url);
             &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);              &Apache::lonnet::allowuploaded('/adm/essayresponse',$url);
         } else {          } else {
Line 575  sub current_file_submissions { Line 576  sub current_file_submissions {
     }      }
     foreach my $name (sort(keys(%okfiles))) {      foreach my $name (sort(keys(%okfiles))) {
         if (ref($okfiles{$name}) eq 'ARRAY') {          if (ref($okfiles{$name}) eq 'ARRAY') {
               my $num = 0;
             foreach my $url (@{$okfiles{$name}}) {              foreach my $url (@{$okfiles{$name}}) {
                 if (ref($rows{$url}) eq 'HASH') {                  if (ref($rows{$url}) eq 'HASH') {
                     my $link = $rows{$url}{link};                      my $link = $rows{$url}{link};
Line 591  sub current_file_submissions { Line 593  sub current_file_submissions {
                         if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {                          if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') {
                             $result .=                              $result .=
                                  '<td valign="bottom"><input type="checkbox" name="HWFILE'.$jspart.'_'.$id.'_delete"'.                                   '<td valign="bottom"><input type="checkbox" name="HWFILE'.$jspart.'_'.$id.'_delete"'.
                                  ' value="'.$portfile.'" /></td>'."\n";                                   ' value="'.$portfile.'" id="HWFILE'.$jspart.'_'.$id.'_'.$num.'_delete" /></td>'."\n";
                               $num ++;
                           }
                           my $showname = $rows{$url}{path}.$name;
                           if ($legacy{$url}) {
                               $showname = $name.' '.&mt('not in portfolio');
                         }                          }
                         $result .=                           $result .= 
                             '<td><a href="'.$link.'"><img src="'.$icon.                              '<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}{size}.'</td>'."\n".
                             '<td align="right" valign="bottom">'.$rows{$url}{lastmodified}.'</td>'."\n".                              '<td align="right" valign="bottom">'.$rows{$url}{lastmodified}.'</td>'."\n".
                             &Apache::loncommon::end_data_table_row();                              &Apache::loncommon::end_data_table_row();
Line 605  sub current_file_submissions { Line 612  sub current_file_submissions {
         }          }
     }      }
     if ($header_shown) {      if ($header_shown) {
         $result .= &Apache::loncommon::end_data_table();          $result .= &Apache::loncommon::end_data_table().
                      '<br /><span class="LC_warning">'.
                      &mt('Items checked for deletion will not be included amongst the files evaluated when your submission is graded.').'</span>';
     }      }
     if (@bad_file_list) {      if (@bad_file_list) {
         my $bad_files = '<span class="LC_filename">'.          my $bad_files = '<span class="LC_filename">'.

Removed from v.1.270  
changed lines
  Added in v.1.271.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>