Diff for /loncom/homework/inputtags.pm between versions 1.333.2.2 and 1.337

version 1.333.2.2, 2015/04/21 22:52:44 version 1.337, 2015/10/05 02:35:40
Line 640  sub file_selector { Line 640  sub file_selector {
     my $current_files_display = &current_file_submissions($part,$id);      my $current_files_display = &current_file_submissions($part,$id);
     my $addfiles;      my $addfiles;
     if ($current_files_display) {      if ($current_files_display) {
         $result .= &Apache::lonhtmlcommon::row_title(&mt('Currently submitted files')).          $result .= &Apache::lonhtmlcommon::row_title(&mt('Files currently selected for submission')).
                    $current_files_display.                     $current_files_display.
                    &Apache::lonhtmlcommon::row_closure();                     &Apache::lonhtmlcommon::row_closure();
         $addfiles = &mt('Submit other file(s)');          $addfiles = &mt('Submit other file(s)');
Line 661  sub file_selector { Line 661  sub file_selector {
         $result .= $constraints.'<br />';          $result .= $constraints.'<br />';
     }      }
     if ($which eq 'uploadonly' || $which eq 'both') {       if ($which eq 'uploadonly' || $which eq 'both') { 
  $result.=&mt('Submit a file: (only one file per submission)').          my $free_space = $maxfilesize * 1048576;
     ' <br /><input type="file" size="50" name="HWFILE'.          $result .= &mt('Submit a file: (only one file per submission)').
     $jspart.'_'.$id.'" id="HWFILE'.$jspart.'_'.$id.'" /><br />';              ' <br /><input type="file" size="50" name="HWFILE'.$jspart.'_'.$id.
     }              '" id="HWFILE'.$jspart.'_'.$id.'" class="flUpload" /><br />'.
               '<input type="hidden" id="free_space" value="'.$free_space.'" /><br />'
           }
     if ( $which eq 'both') {      if ( $which eq 'both') {
  $result.='<br />'.'<strong>'.&mt('OR:').'</strong><br />';   $result.='<br />'.'<strong>'.&mt('OR:').'</strong><br />';
     }      }
Line 698  sub current_file_submissions { Line 700  sub current_file_submissions {
     my $uploadedfile=$Apache::lonhomework::history{"resource.$part.$id.uploadedfile"};      my $uploadedfile=$Apache::lonhomework::history{"resource.$part.$id.uploadedfile"};
     my $portfiles=$Apache::lonhomework::history{"resource.$part.$id.portfiles"};      my $portfiles=$Apache::lonhomework::history{"resource.$part.$id.portfiles"};
     return if (($uploadedfile eq '') && ($portfiles !~/[^\s]/));      return if (($uploadedfile eq '') && ($portfiles !~/[^\s]/));
       my @unversioned;
       foreach my $file (split(/\s*,\s*/,&unescape($portfiles))) {
           my ($path,$name) = ($file =~ m{^(.*/)([^/]+)$});
           my ($origname,$version,$ext) = &Apache::lonnet::file_name_version_ext($name);
           unless ($version) {
               push(@unversioned,$file);
           }    
       }
       return if (!@unversioned);
     my $header = &portpath_popup_js().      my $header = &portpath_popup_js().
                  &Apache::loncommon::start_data_table().                   &Apache::loncommon::start_data_table().
                  &Apache::loncommon::start_data_table_header_row();                   &Apache::loncommon::start_data_table_header_row();
Line 708  sub current_file_submissions { Line 719  sub current_file_submissions {
                  '<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 ($symb,$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,%legacy,@bad_file_list);      my ($result,$header_shown,%okfiles,%rows,%legacy,@bad_file_list);
     if ($uploadedfile) {      if ($uploadedfile) {
Line 727  sub current_file_submissions { Line 738  sub current_file_submissions {
             push(@bad_file_list,$error);              push(@bad_file_list,$error);
         }          }
     }      }
     if ($portfiles =~ /[^\s]/) {      if (@unversioned > 0) {
         my $prefix = "/uploaded/$udom/$uname/portfolio";          my $prefix = "/uploaded/$udom/$uname/portfolio";
         foreach my $file (split(/\s*,\s*/,&unescape($portfiles))) {          foreach my $file (@unversioned) {
             my ($path,$name) = ($file =~ m{^(.*/)([^/]+)$});              my ($path,$name) = ($file =~ m{^(.*/)([^/]+)$});
             my $url = $prefix.$path.$name;              my $url = $prefix.$path.$name;
             my $uploadedfile = &HTML::Entities::encode($url,'<>&"');              my $uploadedfile = &HTML::Entities::encode($url,'<>&"');
Line 1689  sub gradestatus { Line 1700  sub gradestatus {
  && $status ne 'NOT_IN_A_SLOT'   && $status ne 'NOT_IN_A_SLOT'
          && $status ne 'RESERVABLE'           && $status ne 'RESERVABLE'
          && $status ne 'RESERVABLE_LATER'           && $status ne 'RESERVABLE_LATER'
          && $status ne 'NOTRESERVABLE') {           && $status ne 'NOTRESERVABLE'
            && $status ne 'NEED_DIFFERENT_IP') {
   
  if ($status eq 'SHOW_ANSWER') {   if ($status eq 'SHOW_ANSWER') {
             $showbutton = 0;              $showbutton = 0;

Removed from v.1.333.2.2  
changed lines
  Added in v.1.337


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