--- loncom/publisher/testbankimport.pm 2006/04/06 22:15:19 1.9 +++ loncom/publisher/testbankimport.pm 2006/04/10 22:30:31 1.10 @@ -1,5 +1,5 @@ # Handler for parsing text upload problem descriptions into .problems -# $Id: testbankimport.pm,v 1.9 2006/04/06 22:15:19 albertel Exp $ +# $Id: testbankimport.pm,v 1.10 2006/04/10 22:30:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -348,10 +348,16 @@ sub jscript_three { $source = $env{'form.go'}; } + my %body_layout = ('rightmargin' => "0", + 'leftmargin' => "0", + 'marginwidth' => "0", + 'topmargin' => "0", + 'marginheight' => "0"); + my $start_page = &Apache::loncommon::start_page('Create Testbank directory',undef, {'only_body' => 1, - 'add_entries' => "topmargin='0' leftmargin='0' marginheight='0'marginwidth='0' rightmargin='0'", + 'add_entries' => \%body_layout, 'js_ready' => 1,}); my $end_page = &Apache::loncommon::end_page({'js_ready' => 1,}); @@ -1705,7 +1711,6 @@ sub handler { my $javascript = ''; my $page_name = ''; my $current_page = ''; - my $loadentries = ''; my $qcount = ''; # # phase two: re-attach user @@ -1747,7 +1752,6 @@ sub handler { my $dirpath = '/home/'.$uname.'/public_html'; my @text = (); - my $loadentries = ''; if ($env{'form.phase'} eq 'three') { if (-e "$dirpath$fn") { open(TESTBANK,"<$dirpath$fn"); @@ -1762,20 +1766,21 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; + my %loadentries; if ($env{'form.phase'} eq 'three') { $current_page = &display_control(); my @PAGES = ('Welcome','Blocks','Format','Target','Confirmation'); $page_name = $PAGES[$current_page]; if ($page_name eq 'Blocks') { - $loadentries = 'onLoad= "setElements()"'; + $loadentries{'onload'} = "setElements()"; &jscript_one(\$javascript); } elsif ($page_name eq 'Format') { $qcount = question_count($env{'form.qnumformat'},\@text); &jscript_two(\$javascript,$qcount); } elsif ($page_name eq 'Target') { if ($env{'form.go'} eq "PreviousPage") { - $loadentries = 'onLoad = "setElements()"'; + $loadentries{'onload'} = "setElements()"; } &jscript_three($fullpath,\$javascript); } elsif ($page_name eq 'Confirmation') { @@ -1788,7 +1793,7 @@ sub handler { $r->print(&Apache::loncommon::start_page('Upload testbank questions to Construction Space', $javascript, - {'add_entries' => $loadentries})); + {'add_entries' => \%loadentries})); if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { $r->print('

'.&mt('Co-Author').': '.$uname.