--- loncom/homework/grades.pm 2003/12/05 14:59:51 1.167
+++ loncom/homework/grades.pm 2004/02/17 16:45:58 1.176
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.167 2003/12/05 14:59:51 sakharuk Exp $
+# $Id: grades.pm,v 1.176 2004/02/17 16:45:58 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -49,7 +49,7 @@ use Apache::loncoursedata;
use Apache::lonmsg qw(:user_normal_msg);
use Apache::Constants qw(:common);
use Apache::lonlocal;
-#use String::Similarity;
+use String::Similarity;
my %oldessays=();
my %perm=();
@@ -89,10 +89,15 @@ sub getpartlist {
# --- Get the symbolic name of a problem and the url
sub get_symb_and_url {
- my ($request) = @_;
+ my ($request,$silent) = @_;
(my $url=$ENV{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url)));
- if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; }
+ if ($symb eq '') {
+ if (!$silent) {
+ $request->print("Unable to handle ambiguous references:$url:.");
+ return ();
+ }
+ }
return ($symb,$url);
}
@@ -738,9 +743,12 @@ LISTJAVASCRIPT
if ($num_students eq 0) {
$gradeTable='
There are no students currently enrolled.';
} else {
+ my $submissions='submissions';
+ if ($submitonly eq 'incorrect') { $submissions = 'incorrect submissions'; }
+ if ($submitonly eq 'graded' ) { $submissions = 'ungraded submissions'; }
$gradeTable='
'.
- 'No submissions found for this resource for any students. ('.$num_students.
- ' checked for submissions)
';
+ 'No '.$submissions.' found for this resource for any students. ('.$num_students.
+ ' students checked for '.$submissions.')
';
}
} elsif ($ctr == 1) {
$gradeTable =~ s/type=checkbox/type=checkbox checked/;
@@ -1679,10 +1687,11 @@ KEYWORDS
my $toGrade.=' '."\n" if (&canmodify($usec));
- $toGrade.=''."\n";
- $toGrade.=&show_grading_menu_form($symb,$url)
- if (($ENV{'form.command'} eq 'submission') ||
- ($ENV{'form.command'} eq 'processGroup' && $counter == $total));
+ $toGrade.=''."\n";
+ if (($ENV{'form.command'} eq 'submission') ||
+ ($ENV{'form.command'} eq 'processGroup' && $counter == $total)) {
+ $toGrade.=''.&show_grading_menu_form($symb,$url)
+ }
$request = print($toGrade);
return;
}
@@ -2248,8 +2257,14 @@ sub viewgrades {
&viewgrades_js($request);
my ($symb,$url) = ($ENV{'form.symb'},$ENV{'form.url'});
- my $result='
- Specify file location and which Folder/Sequence to grade + | + Specify file and which Folder/Sequence to grade | |
- Sequence to grade: $sequence_selector - | +Sequence to grade: | $sequence_selector |
- Filename of scoring office file: $file_selector - | +Filename of scoring office file: | $file_selector |
- Format of data file: $format_selector - | +Format of data file: | $format_selector |
- Last line to expect an answer on: + Last line to expect an answer on: | ||
+ |
- Specify a Scantron data file to upload. + Specify a Scantron data file to upload. |
SCANTRONFORM
- &scantron_upload_scantron_data($r);
+ my $default_form_data=&defaultFormData(&get_symb_and_url($r,1));
+ my $cdom= $ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+ my $cnum= $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ $r->print(< took $lasttime "); +# my $lasttime = &Time::HiRes::time()-$start; +# $r->print("took $lasttime "); $navmap->untieHashes(); - $r->print("Done "); + $r->print("Done "); $r->print(&show_grading_menu_form($symb,$url)); return ''; } @@ -4153,7 +4193,7 @@ sub scantron_upload_scantron_data { 'domainid'); my $domsel=&Apache::loncommon::select_dom_form($ENV{'request.role.domain'}, 'domainid'); - my $default_form_data=&defaultFormData(&get_symb_and_url($r)); + my $default_form_data=&defaultFormData(&get_symb_and_url($r,1)); $r->print(<'."\n"); + } return ''; } |