--- loncom/homework/grades.pm 2005/08/29 10:06:07 1.280 +++ loncom/homework/grades.pm 2005/11/22 19:10:16 1.296 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.280 2005/08/29 10:06:07 foxr Exp $ +# $Id: grades.pm,v 1.296 2005/11/22 19:10:16 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -334,7 +334,16 @@ COMMONJSFUNCTIONS #--- section, ids and fullnames for each user. sub getclasslist { my ($getsec,$filterlist) = @_; - $getsec = $getsec eq '' ? 'all' : $getsec; + my @getsec; + if (!ref($getsec)) { + if ($getsec ne '' && $getsec ne 'all') { + @getsec=($getsec); + } + } else { + @getsec=@{$getsec}; + } + if (grep(/^all$/,@getsec)) { undef(@getsec); } + my $classlist=&Apache::loncoursedata::get_classlist(); # Bail out if we were unable to get the classlist return if (! defined($classlist)); @@ -363,7 +372,7 @@ sub getclasslist { } $section = ($section ne '' ? $section : 'none'); if (&canview($section)) { - if ($getsec eq 'all' || $getsec eq $section) { + if (!@getsec || grep(/^\Q$section\E$/,@getsec)) { $sections{$section}++; $fullnames{$student}=$fullname; } else { @@ -471,6 +480,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=''; @@ -532,7 +545,13 @@ sub verifyreceipt { if ($env{"course.$courseid.receiptalg"} eq 'receipt2') { $receiptparts=1; } my $parts=['0']; if ($receiptparts) { ($parts)=&response_type($url,$symb); } - foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { + foreach (sort + { + if (lc($$fullname{$a}) ne lc($$fullname{$b})) { + return (lc($$fullname{$a}) cmp lc($$fullname{$b})); + } + return $a cmp $b; + } (keys(%$fullname))) { my ($uname,$udom)=split(/\:/); foreach my $part (@$parts) { if ($receipt eq &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb,$part)) { @@ -698,7 +717,14 @@ LISTJAVASCRIPT $gradeTable.=''."\n"; my $ctr = 0; - foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) { + foreach my $student (sort + { + if (lc($$fullname{$a}) ne lc($$fullname{$b})) { + return (lc($$fullname{$a}) cmp lc($$fullname{$b})); + } + return $a cmp $b; + } + (keys(%$fullname))) { my ($uname,$udom) = split(/:/,$student); my %status = (); if ($env{'form.showgrading'} eq 'yes' && $submitonly ne 'all') { @@ -1366,10 +1392,10 @@ sub gradeBox { my $ctr = 0; $result.='
'."\n";
+ my $endform='';
+ if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
+ $endform.=' '. + &Apache::loncommon::track_student_link(&mt('View recent activity'),$uname,$udom,'check'); + } + if (&Apache::lonnet::allowed('opa',$env{'request.course.id'})) { + $endform.=' '. + &Apache::loncommon::pprmlink(&mt('Set/Change parameters'),$uname,$udom,$symb,'check'); + } + $endform.='
+ '."\n"); $request->print(&show_grading_menu_form($symb,$url)); return ''; } @@ -3357,13 +3417,13 @@ LISTJAVASCRIPT $result.=''."\n". ''."\n"; - $result.=' View Problems Text: no '."\n". - ' yes '." \n"; + $result.=' View Problems Text: \n"; $result.=' Submission Details: '. - ' none'."\n". - ' by dates and submissions'."\n". - ' all details'."\n"; + ' | |||||
'.$ptr.' | '; - $studentTable.='' - .&nameUserString(undef,$$fullname{$student},$uname,$udom)."\n"; + $studentTable.=' | | |||
- + |
Sequence To be Graded: | $title |
Sequence to be Graded: | $title |
Data File that will be used: | $env{'form.scantron_selectfile'} |