--- loncom/homework/grades.pm 2003/12/11 13:51:09 1.170 +++ loncom/homework/grades.pm 2004/03/12 18:03:38 1.180 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.170 2003/12/11 13:51:09 albertel Exp $ +# $Id: grades.pm,v 1.180 2004/03/12 18:03:38 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -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); } @@ -521,18 +526,27 @@ sub verifyreceipt { my ($string,$contents,$matches) = ('','',0); my (undef,undef,$fullname) = &getclasslist('all','0'); - + + my $receiptparts=0; + 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) { my ($uname,$udom)=split(/\:/); - if ($receipt eq - &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb)) { - $contents.='
Fullname | '."\n". 'Username | '."\n". - 'Domain | Domain | '; + if ($receiptparts) { + $string.='Problem Part | '; + } + $string.=''."\n".$contents. '
- 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 ''; } @@ -4168,7 +4207,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 ''; } |