--- loncom/homework/grades.pm 2020/08/30 20:30:21 1.773 +++ loncom/homework/grades.pm 2020/09/09 23:01:12 1.776 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.773 2020/08/30 20:30:21 raeburn Exp $ +# $Id: grades.pm,v 1.776 2020/09/09 23:01:12 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -293,6 +293,17 @@ sub showResourceInfo { $result .= ''; } $result .= '
'; + if (!keys(%partsseen)) { + $result = ''; + if ($uploads) { + return '
'. + '

'. + &mt('No dropbox items or essayresponse items with uploadedfiletypes set.'). + '

'; + } else { + return '
'; + } + } return $result; } @@ -2576,8 +2587,8 @@ sub submission { $rndseed = $record{"resource.$partid.rndseed"}; } if ($env{'form.checkPlag'}) { - my ($oname,$odom,$ocrsid,$oessay,$osim)= - &most_similar($uname,$udom,$symb,$subval); + my ($oname,$odom,$ocrsid,$oessay,$osim)= + &most_similar($uname,$udom,$symb,$subval); if ($osim) { $osim=int($osim*100.0); if ($hide eq 'anon') { @@ -2641,7 +2652,6 @@ sub submission { '('.&mt('Response ID: [_1]',$respid).')'. '   '; my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record); - if (@$files) { if ($hide eq 'anon') { $lastsubonly.='
'.&mt('[quant,_1,file] uploaded to this anonymous survey',scalar(@{$files})); @@ -2653,7 +2663,7 @@ sub submission { } else { $lastsubonly .= &mt('Like all files provided by users, these files may contain viruses!'); } - $lastsubonly .= ''; + $lastsubonly .= ''; foreach my $file (@$files) { &Apache::lonnet::allowuploaded('/adm/grades',$file); $lastsubonly.='
'.$file.''; @@ -2664,7 +2674,7 @@ sub submission { if ($hide eq 'anon') { $lastsubonly.='
'.&mt('Anonymous Survey').''; } else { - $lastsubonly.='
'.&mt('Submitted Answer:').' '; + $lastsubonly.='
'.&mt('Submitted Answer:').' '; if ($draft) { $lastsubonly.= ' '.&mt('Draft Copy').''; } @@ -2676,7 +2686,7 @@ sub submission { } $lastsubonly.=$subval."\n"; } - if ($similar) {$lastsubonly.="

$similar\n";} + if ($similar) {$lastsubonly.="

$similar\n";} $lastsubonly.=''; } } @@ -3242,7 +3252,7 @@ sub processHandGrade { # Keywords sorted in alphabatical order my $loginuser = $env{'user.name'}.':'.$env{'user.domain'}; $env{'form.keywords'} =~ s/,\s{0,}|\s+/ /g; - $env{'form.keywords'} =~ s/^\s+|\s+$//; + $env{'form.keywords'} =~ s/^\s+|\s+$//g; my (@keywords) = sort(split(/\s+/,$env{'form.keywords'})); $env{'form.keywords'} = join(' ',@keywords); $keyhash{$symb.'_keywords'} = $env{'form.keywords'}; @@ -9462,7 +9472,7 @@ END if ($count > 1) { $formatextra = ''; $onclick = ' onclick="toggleScantab(this.form);"'; $formatjs = <<"END"; @@ -11394,6 +11404,9 @@ sub handler { } &startpage($request,$symb,[{href=>"", text=>"Student Submissions"}],undef,undef,$stuvcurrent,$stuvdisp,undef,$js,$onload,$divforres); if ($versionform) { + if ($divforres) { + $request->print('
'); + } $request->print($versionform); } ($env{'form.student'} eq '' ? &listStudents($request,$symb,'',$divforres) : &submission($request,0,0,$symb,$divforres,$command)); @@ -11546,6 +11559,7 @@ sub handler { [{href=>&href_symb_cmd($symb,'downloadfilesselect'), text=>'Select which submissions to download'}, {href=>'', text=>'Download submitted files'}], undef,undef,undef,undef,undef,undef,undef,1); + $request->print('
'); &submit_download_link($request,$symb); } elsif ($command) { &startpage($request,$symb,[{href=>'', text=>'Access denied'}]);