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(<
+ function checkUpload(formname) {
+ if (formname.upfile.value == "") {
+ alert("Please use the browse button to select a file from your local directory.");
+ return false;
+ }
+ formname.submit();
+ }
+
+
+
+UPLOAD
$r->print(<
@@ -3821,7 +3856,7 @@ sub scantron_getfile {
} else {
$scanlines{'skipped'}=[(split("\n",$lines,-1))];
}
- my @tmp=&Apache::lonnet::dump('scantrondata',$cdom,$cname);
+ my @tmp=&Apache::lonnet::dump('nohist_scantrondata',$cdom,$cname);
if ($tmp[0] =~ /^(error:|no_such_host)/) { @tmp=(); }
my %scan_data = @tmp;
return (\%scanlines,\%scan_data);
@@ -3853,7 +3888,7 @@ sub scantron_putfile {
&lonnet_putfile(join("\n",@{$scanlines->{'skipped'}}),
$prefix.'skipped_'.
$ENV{'form.scantron_selectfile'});
- &Apache::lonnet::put('scantrondata',$scan_data,$cdom,$cname);
+ &Apache::lonnet::put('nohist_scantrondata',$scan_data,$cdom,$cname);
}
sub scantron_get_line {
@@ -3970,7 +4005,7 @@ sub scantron_get_correction {
'scantron_username','scantron_domain'));
$r->print(": ");
$r->print("\n@".
- &Apache::loncommon::select_dom_form(undef,'scantron_domain'));
+ &Apache::loncommon::select_dom_form($ENV{'request.role..domain'},'scantron_domain'));
$r->print('');
} elsif ($error eq 'doublebubble') {
@@ -4171,7 +4206,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(<
function checkUpload(formname) {
@@ -4227,7 +4262,15 @@ sub scantron_upload_scantron_data_save {
$r->print(&Apache::lonnet::finishuserfileupload($ENV{'form.courseid'},
$ENV{'form.domainid'},
$home,'upfile',$fname));
- $r->print(&show_grading_menu_form(&get_symb_and_url($r)));
+ my ($symb,$url)=&get_symb_and_url($r);
+ if ($symb) {
+ $r->print(&show_grading_menu_form(&get_symb_and_url($r)));
+ } else {
+ $r->print(' '."\n");
+ }
return '';
}
|