--- loncom/homework/grades.pm 2004/09/02 21:02:21 1.208 +++ loncom/homework/grades.pm 2004/09/14 13:30:09 1.209 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.208 2004/09/02 21:02:21 albertel Exp $ +# $Id: grades.pm,v 1.209 2004/09/14 13:30:09 ng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3472,10 +3472,11 @@ sub scantron_filenames { } sub scantron_uploads { + my ($file2grade) = @_; my $result= '"; return $result; @@ -3521,13 +3522,13 @@ sub scantron_CODEunique { } sub scantron_selectphase { - my ($r) = @_; + my ($r,$file2grade) = @_; my ($symb,$url)=&get_symb_and_url($r); if (!$symb) {return '';} my $sequence_selector=&getSequenceDropDown($r,$symb); my $default_form_data=&defaultFormData($symb,$url); my $grading_menu_button=&show_grading_menu_form($symb,$url); - my $file_selector=&scantron_uploads(); + my $file_selector=&scantron_uploads($file2grade); my $format_selector=&scantron_scantab(); my $CODE_selector=&scantron_CODElist(); my $CODE_unique=&scantron_CODEunique(); @@ -4718,7 +4719,7 @@ sub scantron_upload_scantron_data_save { } return ''; } - $r->print("Doing upload to ".$ENV{'form.courseid'}."
"); +# $r->print("Doing upload to ".$ENV{'form.courseid'}."
"); my $home=&Apache::lonnet::homeserver($ENV{'form.courseid'}, $ENV{'form.domainid'}); my $fname=$ENV{'form.upfile.filename'}; @@ -4735,19 +4736,23 @@ sub scantron_upload_scantron_data_save { $fname=~s/[^\w\.\-]//g; # See if there is anything left unless ($fname) { return 'error: no uploaded file'; } + my $uploadedfile=$fname; $fname='scantron_orig_'.$fname; 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); - if ($result =~ m|^/uploaded/|) { - $r->print("Success: Successfully uploaded ".(length($ENV{'form.upfile'})-1)." bytes of data into location ".$result.""); - } else { - $r->print("Error: An error (".$result.") occured when attempting to upload the file, ".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"').""); +# if ($result =~ m|^/uploaded/|) { + if ($result !~ m|^/uploaded/|) { +# $r->print("Success: Successfully uploaded ".(length($ENV{'form.upfile'})-1)." bytes of data into location ".$result.""); +# } else { + $r->print("Error: An error (".$result.") occurred when attempting to upload the file, ".&HTML::Entities::encode($ENV{'form.upfile.filename'},'<>&"').""); } } if ($symb) { - $r->print(&show_grading_menu_form($symb,$url)); +# $r->print(&show_grading_menu_form($symb,$url)); + $r->print(&scantron_selectphase($r,$uploadedfile)); + } else { $r->print($doanotherupload); }