--- loncom/homework/grades.pm 2005/06/04 19:05:31 1.273 +++ loncom/homework/grades.pm 2005/09/23 16:57:42 1.289 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.273 2005/06/04 19:05:31 albertel Exp $ +# $Id: grades.pm,v 1.289 2005/09/23 16:57:42 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -471,6 +471,10 @@ sub most_similar { $uessay=~s/\W+/ /gs; +# ignore empty submissions (occuring when only files are sent) + + unless ($uessay=~/\w+/) { return ''; } + # these will be returned. Do not care if not at least 50 percent similar my $limit=0.6; my $sname=''; @@ -743,7 +747,7 @@ LISTJAVASCRIPT if ($env{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { foreach (sort keys(%status)) { next if (/^resource.*?submitted_by$/); - $gradeTable.='
\n"; + ','.$ctr.')" />'.$ctr."\n"; $result.=(($ctr+1)%10 == 0 ? ' | |||||
'. @@ -2665,10 +2672,11 @@ sub viewstudentgrade { ''.$fullname.' '. '('.$uname.($env{'user.domain'} eq $udom ? '' : ':'.$udom).') | '."\n"; + $student=~s/:/_/; # colon doen't work in javascript for names foreach my $apart (@$parts) { my ($part,$type) = &split_part_type($apart); my $score=$record{"resource.$part.$type"}; - $result.=''; + $result.=' | '; my ($aggtries,$totaltries); unless (exists($aggregates{$part})) { $totaltries = $record{'resource.'.$part.'.tries'}; @@ -2786,12 +2794,10 @@ sub editgrades { for ($i=0; $i<$env{'form.total'}; $i++) { my $line; my $user = $env{'form.ctr'.$i}; - my $usercolon = $user; - $usercolon =~s/_/:/; - my ($uname,$udom)=split(/_/,$user); + my ($uname,$udom)=split(/:/,$user); my %newrecord; my $updateflag = 0; - $line .= ' | '.&nameUserString(undef,$$fullname{$usercolon},$uname,$udom).' | '; + $line .= ''.&nameUserString(undef,$$fullname{$user},$uname,$udom).' | '; my $usec=$classlist->{"$uname:$udom"}[5]; if (!&canmodify($usec)) { my $numcols=scalar(@partid)*4+2; @@ -2800,6 +2806,7 @@ sub editgrades { } my %aggregate = (); my $aggregateflag = 0; + $user=~s/:/_/; # colon doen't work in javascript for names foreach (@partid) { my $old_aw = $env{'form.GD_'.$user.'_'.$_.'_awarded_s'}; my $old_part_pcr = $old_aw/($weight{$_} ne '0' ? $weight{$_}:1); @@ -3062,10 +3069,7 @@ sub csvuploadmap_footer { ENDPICK } -sub upcsvScores_form { - my ($request) = shift; - my ($symb,$url)=&get_symb_and_url($request); - if (!$symb) {return '';} +sub checkforfile_js { my $result =<
Sequence To be Graded: | $title |
Sequence to be Graded: | $title |
Data File that will be used: | $env{'form.scantron_selectfile'} |
$quest | "); for (my $i=0;$i<$max+1;$i++) { - $r->print(''); + $r->print("\n".' | '); if ($selected[0] eq $alphabet[$i]) { $r->print('X'); shift(@selected) } else { $r->print(' '); } $r->print(' | '); } - $r->print('|
"); - my $home=&Apache::lonnet::homeserver($env{'form.courseid'}, - $env{'form.domainid'}); my $fname=$env{'form.upfile.filename'}; #FIXME #copied from lonnet::userfileupload() @@ -5159,7 +5228,7 @@ sub scantron_upload_scantron_data_save { if (length($env{'form.upfile'}) < 2) { $r->print("Error: The file you attempted to upload, ".&HTML::Entities::encode($env{'form.upfile.filename'},'<>&"').", contained no information. Please check that you entered the correct filename."); } else { - my $result=&Apache::lonnet::finishuserfileupload($env{'form.courseid'},$env{'form.domainid'},$home,'upfile',$fname); + my $result=&Apache::lonnet::finishuserfileupload($env{'form.courseid'},$env{'form.domainid'},'upfile',$fname); if ($result =~ m|^/uploaded/|) { $r->print("Success: Successfully uploaded ".(length($env{'form.upfile'})-1)." bytes of data into location ".$result.""); } else { @@ -5334,10 +5403,10 @@ GRADINGMENUJS $result.=' | |||
'. + $result.=' | |||
'. - ' '. - 'Current Resource: For all students in selected section or course | |||
'. - ' '. - 'The complete set/page/sequence: For one student | |||
'. ''. @@ -5383,6 +5452,9 @@ GRADINGMENUJS $result.=' | |||
'. ' access times. | |||
'. + ' saved CODEs. |